This document describes SPARQL service description, a method for discovering, and vocabulary for describing SPARQL services made available via the SPARQL 1.1 Protocol for RDF [SPROT]. These descriptions provide a mechanism by which a client or end user can discover information about the SPARQL service such as supported extension functions and details about the available dataset.
1 IntroductionA SPARQL service description lists the features of a SPARQL service made available via the SPARQL 1.1 Protocol for RDF [SPROT]. This document describes both a method for discovering a service description from a specific SPARQL service and an RDF schema for encoding such descriptions in RDF.
1.1 TerminologyWhen this document uses the words MUST, SHOULD and MAY, and the words appear as emphasized text, they must be interpreted as described in [RFC2119].
The following terms are also in use throughout this document:
SPARQL services made available via the SPARQL Protocol SHOULD return a service description document at the service endpoint when dereferenced using the HTTP GET operation without any query parameter strings provided. This service description MUST be made available in an RDF serialization, MAY be embedded in (X)HTML by way of RDFa [RDFA], and SHOULD use content negotiation [CONNEG] if available in other RDF representations.
3 Service Description Vocabulary 3.1 SPARQL Service Description Namespace and OWL OntologyThe SPARQL service description namespace IRI is:
http://www.w3.org/ns/sparql-service-description#
The prefix used in this document for this namespace is sd
.
An RDF encoding of the Service Description ontology is available by HTTP content negotiation from the namespace IRI.
3.2 Properties 3.2.1 sd:endpointRelates an instance of sd:Service
to a SPARQL endpoint that implements the SPARQL Protocol service [SPROT] for the service. The object of the sd:endpoint property is an IRI.
owl:InverseFunctionalProperty
domain: sd:Service
3.2.2 sd:feature
Relates an instance of sd:Service
with a resource representing a supported feature.
Relates an instance of sd:Service
with a resource representing an entailment regime used for basic graph pattern matching. This property is intended for use when a single entailment regime by default applies to all graphs in the default dataset of the service. In situations where a different entailment regime applies to a specific graph in the dataset, the sd:entailmentRegime
property should be used to indicate this fact in the description of that graph.
Relates a named graph description with a resource representing an entailment regime used for basic graph pattern matching over that graph.
3.2.6 sd:supportedEntailmentProfileRelates a named graph description with a resource representing a supported profile of the entailment regime (as declared by sd:entailmentRegime
) used for basic graph pattern matching over that graph.
Relates an instance of sd:Service
to an aggregate that may be used in a SPARQL aggregate query (for instance in a HAVING clause or SELECT expression) besides the standard list of supported aggregates COUNT, SUM, MIN, MAX, AVG, GROUP_CONCAT, and SAMPLE.
Relates an instance of sd:Service
to a resource representing an implemented extension to the SPARQL Query or Update language.
Relates an instance of sd:Service
to a SPARQL language (e.g. Query and Update) that it implements.
Relates an instance of sd:Service
to a resource representing an implemented feature that extends the SPARQL Query or Update language and that is accessed by using the named property.
Relates an instance of sd:Service
to a description of the default dataset available when no explicit dataset is specified in the query, update request or via protocol parameters.
Relates an instance of sd:Service
to a description of the graphs which are allowed in the construction of a dataset via the SPARQL Protocol, with FROM/FROM NAMED clauses in a query, or with USING/USING NAMED in an update request, if the service limits the scope of dataset construction.
Relates an instance of sd:Dataset
to the description of its default graph.
Relates an instance of sd:GraphCollection
(or its subclass sd:Dataset
) to the description of one of its named graphs. The description of such a named graph MUST include the sd:name
property and MAY include the sd:graph
property.
Relates a named graph to the name by which it may be referenced in a FROM/FROM NAMED clause. The object of the sd:name property is an IRI.
3.2.19 sd:graphRelates a named graph to its graph description.
3.3 Classes 3.3.1 sd:ServiceAn instance of sd:Service
represents a SPARQL service made available via the SPARQL Protocol.
An instance of sd:EntailmentProfile
represents a profile of an entailment regime. An entailment profile MAY impose restrictions on what constitutes valid RDF with respect to entailment. URIs for commonly used entailment profiles are defined by Unique URIs for OWL 2 Profiles [OWL2PROF].
An instance of sd:Graph
represents the description of an RDF graph.
This document does not define properties with domain sd:Graph
. Instead, such instances may be described using other appropriate vocabularies (see example below).
An instance of sd:NamedGraph
represents a named graph having a name (via sd:name
) and an optional graph description (via sd:graph
).
sd:UnionDefaultGraph
, when used as the object of the sd:feature property, indicates that the default graph of the dataset used during query and update evaluation (when an explicit dataset is not specified) is comprised of the union of all the named graphs in that dataset.
sd:EmptyGraphs
, when used as the object of the sd:feature property, indicates that the underlying graph store supports empty graphs. A graph store that supports empty graphs MUST NOT remove graphs that are left empty after triples are removed from them. (See 3.1 Graph Update in SPARQL 1.1 Update.)
The following HTTP traces illustrate the retrieval of a service description from the SPARQL endpoint http://www.example/sparql/
.
This RDF describes a SPARQL service available at the URL http://www.example/sparql/
that supports the SPARQL 1.1 Query language. The service will dereference URLs used in FROM/FROM NAMED clauses, supports both the RDF/XML and Turtle serialization formats, supports the http://example.org/Distance
extension function, and has a dataset with a default graph and one named graph, both described using the voiD vocabulary [VOID]. The default graph contains 100 triples and supports RDFS entailment while the graph named http://www.example/named-graph contains 2000 triples and supports OWL2 RL entailment.
Given the HTTP request:
GET /sparql/ HTTP/1.1 Host: www.example
the SPARQL service responds with an RDF/XML encoded service description (no content negotiation or RDFa encoding is used):
HTTP/1.1 200 OK Date: Fri, 09 Oct 2009 17:31:12 GMT Server: Apache/1.3.29 (Unix) PHP/4.3.4 DAV/1.0.3 Connection: close Content-Type: application/rdf+xml <?xml version="1.0" encoding="utf-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sd="http://www.w3.org/ns/sparql-service-description#" xmlns:prof="http://www.w3.org/ns/owl-profile/" xmlns:scovo="http://purl.org/NET/scovo#" xmlns:void="http://rdfs.org/ns/void#"> <sd:Service> <sd:endpoint rdf:resource="http://www.example/sparql/"/> <sd:supportedLanguage rdf:resource="http://www.w3.org/ns/sparql-service-description#SPARQL11Query"/> <sd:resultFormat rdf:resource="http://www.w3.org/ns/formats/RDF_XML"/> <sd:resultFormat rdf:resource="http://www.w3.org/ns/formats/Turtle"/> <sd:feature rdf:resource="http://www.w3.org/ns/sparql-service-description#DereferencesURIs"/> <sd:defaultEntailmentRegime rdf:resource="http://www.w3.org/ns/entailment/RDFS"/> <sd:extensionFunction> <sd:Function rdf:about="http://example.org/Distance"/> </sd:extensionFunction> <sd:defaultDataset> <sd:Dataset> <sd:defaultGraph> <sd:Graph> <void:triples rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">100</void:triples> </sd:Graph> </sd:defaultGraph> <sd:namedGraph> <sd:NamedGraph> <sd:name rdf:resource="http://www.example/named-graph"/> <sd:entailmentRegime rdf:resource="http://www.w3.org/ns/entailment/OWL-RDF-Based"/> <sd:supportedEntailmentProfile rdf:resource="http://www.w3.org/ns/owl-profile/RL"/> <sd:graph> <sd:Graph> <void:triples rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">2000</void:triples> </sd:Graph> </sd:graph> </sd:NamedGraph> </sd:namedGraph> </sd:Dataset> </sd:defaultDataset> </sd:Service> </rdf:RDF>4.2 Turtle Service Description
Given the HTTP request:
GET /sparql/ HTTP/1.1 Host: www.example Accept: text/turtle
the SPARQL service responds with a Turtle [TURTLE] encoded service description:
HTTP/1.1 200 OK Date: Fri, 09 Oct 2009 17:31:12 GMT Server: Apache/1.3.29 (Unix) PHP/4.3.4 DAV/1.0.3 Connection: close Content-Type: text/turtle @prefix sd: <http://www.w3.org/ns/sparql-service-description#> . @prefix ent: <http://www.w3.org/ns/entailment/> . @prefix prof: <http://www.w3.org/ns/owl-profile/> . @prefix scovo: <http://purl.org/NET/scovo#> . @prefix void: <http://rdfs.org/ns/void#> . [] a sd:Service ; sd:endpoint <http://www.example/sparql/> ; sd:supportedLanguage sd:SPARQL11Query ; sd:resultFormat <http://www.w3.org/ns/formats/RDF_XML>, <http://www.w3.org/ns/formats/Turtle> ; sd:extensionFunction <http://example.org/Distance> ; sd:feature sd:DereferencesURIs ; sd:defaultEntailmentRegime ent:RDFS ; sd:defaultDataset [ a sd:Dataset ; sd:defaultGraph [ a sd:Graph ; void:triples 100 ] ; sd:namedGraph [ a sd:NamedGraph ; sd:name <http://www.example/named-graph> ; sd:entailmentRegime ent:OWL-RDF-Based ; sd:supportedEntailmentProfile prof:RL ; sd:graph [ a sd:Graph ; void:triples 2000 ] ] ] . <http://example.org/Distance> a sd:Function .5 Conformance
A SPARQL service conformant with this specification:
<service-endpoint-URL>
MUST include at least one triple matching:
?service sd:endpoint <service-endpoint-URL> .
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.3