WOLFRAM

Enable JavaScript to interact with content and submit forms on Wolfram websites. Learn how
Wolfram Language & System Documentation Center

SPARQLService[url,patt]

represents a pattern that is matched on a SPARQL endpoint located at url.

Examples  
Basic Examples  
See Also
Related Guides
Cite this Page

SPARQLService[url,patt]

represents a pattern that is matched on a SPARQL endpoint located at url.

Examples

Basic Examples  (1)

Wolfram Language code: Needs["GraphStore`"]

Country data:

Wolfram Language code: rdfs[s_] := URL["http://www.w3.org/2000/01/rdf-schema#" <> s]; owl[s_] := URL["http://www.w3.org/2002/07/owl#" <> s]; wd[s_] := URL["http://www.wikidata.org/entity/" <> s]; wdt[s_] := URL["http://www.wikidata.org/prop/direct/" <> s]; ex[s_] := URL["http://example.org/" <> s];
Wolfram Language code: countryData = RDFStore[{ RDFTriple[ex["spain"], rdfs["label"], "Spain"], RDFTriple[ex["spain"], owl["sameAs"], wd["Q29"]] }];

For all countries in the dataset look up the top-level domain (P78) in Wikidata:

Wolfram Language code: countryData//SPARQLSelect[{ RDFTriple[SPARQLVariable["country"], rdfs["label"], SPARQLVariable["label"]], RDFTriple[SPARQLVariable["country"], owl["sameAs"], SPARQLVariable["wditem"]], SPARQLService["https://query.wikidata.org/sparql", { RDFTriple[SPARQLVariable["wditem"], wdt["P78"], SPARQLVariable["tld"]] }] } -> {"label", "tld"}]
Wolfram Research (2019), SPARQLService, Wolfram Language function, https://reference.wolfram.com/language/GraphStore/ref/SPARQLService.html.

Text

Wolfram Research (2019), SPARQLService, Wolfram Language function, https://reference.wolfram.com/language/GraphStore/ref/SPARQLService.html.

CMS

Wolfram Language. 2019. "SPARQLService." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/GraphStore/ref/SPARQLService.html.

APA

Wolfram Language. (2019). SPARQLService. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/GraphStore/ref/SPARQLService.html

BibTeX

@misc{reference.wolfram_2026_sparqlservice, author="Wolfram Research", title="{SPARQLService}", year="2019", howpublished="\url{https://reference.wolfram.com/language/GraphStore/ref/SPARQLService.html}", note=[Accessed: 16-August-2026]}

BibLaTeX

@online{reference.wolfram_2026_sparqlservice, organization={Wolfram Research}, title={SPARQLService}, year={2019}, url={https://reference.wolfram.com/language/GraphStore/ref/SPARQLService.html}, note=[Accessed: 16-August-2026]}

Top [フレーム]

AltStyle によって変換されたページ (->オリジナル) /