SPARQL
SPARQL (pronounced "sparkle"[1] ) is an RDF query language; its name is a recursive acronym that stands for SPARQL Protocol and RDF Query Language. It was standardized by the RDF Data Access Working Group (DAWG) of the World Wide Web Consortium, and is considered a key semantic web technology. On 15 January 2008, SPARQL became an official W3C Recommendation. [2]
SPARQL allows for a query to consist of triple patterns, conjunctions, disjunctions, and optional patterns.[3]
Implementations for multiple programming languages exist.[4] "SPARQL will make a huge difference" according to Sir Tim Berners-Lee in a May 2006 interview. [5]
Benefits
SPARQL allows users to write globally unambiguous queries. For example, the following query returns names and emails of every person in the world.
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?email
WHERE {
?person a foaf:Person.
?person foaf:name ?name.
?person foaf:mbox ?email.
}
assuming the ontologies in use to describe a person eventually converge to FOAF. This illustrates the Semantic Web's vision of treating the Web as a single enormous database. Notice that this global unambiguity roots in the fact that every identifier in SPARQL, URI, is globally unambiguous, unlike "email" or "e-mail" normally used in SQL.
This query can be distributed to multiple SPARQL endpoints, computed distributedly, and results gathered, a procedure known as federated query.
Example
Another SPARQL query example that models the question "What are all the country capitals in Africa?":
PREFIX abc: <http://example.com/exampleOntology#>
SELECT ?capital ?country
WHERE {
?x abc:cityname ?capital ;
abc:isCapitalOf ?y .
?y abc:countryname ?country ;
abc:isInContinent abc:Africa .
}
Variables are indicated by a "?" or "$" prefix. Bindings for ?capital and the ?country will be returned.
The SPARQL query processor will search for sets of triples that match these four triple patterns, binding the variables in the query to the corresponding parts of each triple. Important to note here is the "property orientation" (class matches can be conducted solely through class-attributes / properties - see Duck typing)
To make queries concise, SPARQL allows the definition of prefixes and base URIs in a fashion similar to Turtle. In this query, the prefix "abc" stands for “http://example.com/exampleOntology#”.
References
- ↑ Jim Rapoza (May 2, 2006). "SPARQL Will Make the Web Shine". eWeek. http://www.eweek.com/article2/0,1759,1965980,00.asp. Retrieved 2007-01-17.
- ↑ "W3C Semantic Web Activity News - SPARQL is a Recommendation". W3.org. 2008-01-15. http://www.w3.org/blog/SW/2008/01/15/sparql_is_a_recommendation. Retrieved 2009-10-01.
- ↑ "XML and Web Services In The News". xml.org. 6 October 2006. http://www.xml.org/xml/news/archives/archive.10062006.shtml#5. Retrieved 2007-01-17.
- ↑ "SparqlImplementations - ESW Wiki". Esw.w3.org. http://esw.w3.org/topic/SparqlImplementations. Retrieved 2009-10-01.
- ↑ Reuters (22 May 2006). "Berners-Lee looks for Web's big leap". zdnet.co.uk. http://news.zdnet.co.uk/internet/0,1000000097,39270671,00.htm. Retrieved 2007-01-17.[dead link]
External links
- W3C SPARQL Working Group (was RDF Data Access Working Group)
- SPARQL Query language
- SPARQL Protocol
- SPARQL Query XML Results Format
- SPARQL Tutorial
Stub icon | This computer science article is a stub. You can help Wikipedia by expanding it. |
|
de:SPARQL es:SPARQL fr:SPARQL lv:SPARQL ja:SPARQL pl:SPARQL ru:SPARQL zh:SPARQL
If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...
- Pages using deprecated source tags
- Pages with syntax highlighting errors
- All articles with dead external links
- Articles with dead external links from August 2009
- Articles with invalid date parameter in template
- Pages with broken file links
- Computer science stubs
- Semantic Web
- RDF data access
- Query languages
- World Wide Web Consortium standards
- Web services