Weitere ähnliche Inhalte Ähnlich wie Getting Started With The Talis Platform (20) Mehr von Leigh Dodds (20) Kürzlich hochgeladen (20) Getting Started With The Talis Platform15. Use HTTP Response Codes 200 = OK 201 = Created (new resource) 202 = Accepted (for processing) 400 = Bad Request 500 = Server Error 16. Mime Types Used to identifiy content & meaning of request and response body 17. Content Negotiation Majority of services support multiple output options, list varies by resource Accept header output parameter 21. Authorization By default stores are world-readable, Store owner writable Customisable roles and privileges per-Store 24. Apollo 11 was launched from Cape Canaveral Subject Predicate Object 37. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> @prefix space: <http://purl.org/net/schemas/space/> @ @prefix dc: <http://purl.org/dc/elements/1.1/> <http://purl.org/net/schemas/space/spacecraft/1969-059A> rdf:type <http://purl.org/net/schemas/space/Spacecraft>; dc:description "Apollo 11 was…”; space:agency "United States" . 43. Server or Client Assignment of Identifiers Provides full control over how URIs assigned 47. Metadata for Contentbox Resources Minimum is URI and ETag Extract height & width of images … more metadata extraction in future 49. Full RDF Data Storage Create, read, update, delete RDF resources Query RDF data 54. Storing RDF POST application/rdf+xml Changes saved immediately Search indexing asynchronous 55. Triples are Merged into Store Can catch out the unwary Updates happen through separate mechanism 64. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cs="http://purl.org/vocab/changeset/schema#"> <cs:ChangeSet rdf:about="http://example.com/changesets/1"> <cs:subjectOfChange rdf:resource="http://purl.org/net/schema/space/launch/1969-059"/> <cs:changeReason>More accurate launch time</cs:changeReason> < cs:precedingChangeset rdf:resource=" http://example.com/changesets/2 "/> <!– changes --> </cs:ChangeSet> <cs:ChangeSet rdf:about=" http://example.com/changesets/2 "> <cs:subjectOfChange rdf:resource="http://purl.org/net/schema/space/launch/1969-059"/> <cs: precedingChangeset rdf:resource=" http://example.com/changesets/3 "/> <!– changes --> </cs:ChangeSet> <cs:ChangeSet rdf:about=" http://example.com/changesets/3 "> <cs:subjectOfChange rdf:resource="http://purl.org/net/schema/space/spacecraft/1969-059D"/> <!– changes --> ... </cs:ChangeSet> </rdf:RDF> 66. SPARQL RDF query language; HTTP protocol; Results format 4 different forms of query 68. #Was there a launch on 16 th July 1969? PREFIX space: <http://purl.org/net/schemas/space/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> ASK WHERE { ?launch space:launched "1969-07-16"^^xsd:date. } 71. #Describe launch(es) that occurred on 16 th July 1969 PREFIX space: <http://purl.org/net/schemas/space/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> DESCRIBE ?launch WHERE { ?launch space:launched "1969-07-16"^^xsd:date. } 72. #Describe spacecraft launched on 16 th July 1969 PREFIX space: <http://purl.org/net/schemas/space/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> DESCRIBE ?spacecraft WHERE { ?launch space:launched "1969-07-16"^^xsd:date. ?spacecraft space:launch ?launch. } 74. PREFIX space: <http://purl.org/net/schemas/space/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> CONSTRUCT { ?spacecraft foaf:name ?name; space:agency ?agency; space:mass ?mass. } WHERE { ?launch space:launched "1969-07-16"^^xsd:date. ?spacecraft space:launch ?launch; foaf:name ?name; space:agency ?agency; space:mass ?mass. } 76. PREFIX space: <http://purl.org/net/schemas/space/> PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> PREFIX foaf: <http://xmlns.com/foaf/0.1/> SELECT ?name ?agency ?mass WHERE { ?launch space:launched "1969-07-16"^^xsd:date. ?spacecraft space:launch ?launch; foaf:name ?name; space:agency ?agency; space:mass ?mass. } 77. …as XML <?xml version="1.0"?> <sparql xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2005/sparql-results#" > <head> <variable name="name"/> <variable name="agency"/> <variable name="mass"/> </head> <results> <result> <binding name="name"> <literal>Apollo 11 Command and Service Module (CSM)</literal> </binding> <binding name="agency"> <literal>United States</literal> </binding> <binding name="mass"> <literal>28801.0</literal> </binding> </result> <!– more results --> </results> </sparql> 78. …as JSON { "head": { "vars": [ "name" , "agency" , "mass" ] } , "results": { "bindings": [ { "name": { "type": "literal" , "value": "Apollo 11 Command and Service Module (CSM)" } , "agency": { "type": "literal" , "value": "United States" } , "mass": { "type": "literal" , "value": "28801.0" } } , { "name": { "type": "literal" , "value": "Apollo 11 SIVB" } , "agency": { "type": "literal" , "value": "United States" } , "mass": { "type": "literal" , "value": "13300.0" } } , { "name": { "type": "literal" , "value": "Apollo 11 Lunar Module / EASEP" } , "agency": { "type": "literal" , "value": "United States" } , "mass": { "type": "literal" , "value": "15065.0" } } ] } } 83. Query Results RSS 1.0 feed OpenSearch extensions (paging, relevance) Full description of each resource 84. <rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:relevance="http://a9.com/-/opensearch/extensions/relevance/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:os="http://a9.com/-/spec/opensearch/1.1/" xmlns:ns.1="http://purl.org/net/schemas/space/"> <channel rdf:about=“…"> <title>lunar</title> <link>…</link> <description>Results of a search for lunar on space</description> <items> <rdf:Seq rdf:about="urn:uuid:eae4ead8-ca6a-4b12-b714-fe631d38e447"> <rdf:li resource="http://purl.org/net/schemas/space/spacecraft/LUNAR-A" /> </rdf:Seq> </items> < os:startIndex >0</ os:startIndex > < os:itemsPerPage >10</ os:itemsPerPage > < os:totalResults >118</ os:totalResults > </channel> <item rdf:about="http://purl.org/net/schemas/space/spacecraft/LUNAR-A"> <title>Item</title> <link>http://purl.org/net/schemas/space/spacecraft/LUNAR-A</link> < relevance:score >1.0</ relevance:score > <foaf:name>Lunar-A</foaf:name> <space:mass>520.0</space:mass> <space:internationalDesignator>LUNAR-A</space:internationalDesignator> </item> </rdf:RDF> 87. <facet-results xmlns="http://schemas.talis.com/2007/facet-results#"> <head> <query>name:luna*</query> <fields>agency</fields> <top>10</top> <output>xml</output> </head> <fields> <field name="agency"> <term value="U.S.S.R" number="25" facet-uri=“…" search-uri=“…"/> <term value="United States" number="9" facet-uri=“…" search-uri=“…"/> <term value="Japan" number="1" facet-uri=“…" search-uri=“…"/> <term value="India" number="1" facet-uri=“…" search-uri=“…"/> </field> </fields> </facet-results> 90. Field Predicate Map Associate a short name to a RDF property Properties in field predicate map are indexed for searching Short name used in query syntax, sort order, etc 91. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:bf="http://schemas.talis.com/2006/bigfoot/configuration#" xmlns:frm="http://schemas.talis.com/2006/frame/schema#“ xml:base=“http://api.talis.com/stores/space”> <bf:FieldPredicateMap rdf:about="/indexes/default/fpmaps/default"> <frm:mappedDatatypeProperty> <rdf:Description rdf:about="/indexes/default/fpmaps/default#agency"> <frm:property rdf:resource="http://purl.org/net/schema/space/agency"/> <frm:name>agency</frm:name> </rdf:Description> </frm:mappedDatatypeProperty> </bf:FieldPredicateMap> </rdf:RDF> 93. <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:bf="http://schemas.talis.com/2006/bigfoot/configuration#" xmlns:frm="http://schemas.talis.com/2006/frame/schema#“ xml:base=“http://api.talis.com/stores/space”> <bf:QueryProfile rdf:about=""> <bf:fieldWeight> <rdf:Description rdf:about="/indexes/default/queryprofiles/default#name"> <bf:weight>10.0</bf:weight> <frm:name>name</frm:name> </rdf:Description> </bf:fieldWeight> <bf:fieldWeight> <rdf:Description rdf:about="/indexes/default/queryprofiles/default#agency"> <bf:weight>5.0</bf:weight> <frm:name>agency</frm:name> </rdf:Description> </bf:fieldWeight> </bf:QueryProfile> </rdf:RDF> 96. Jobs Each job is a resource, with a URI GET to monitor status, DELETE to remove