SPARQLService[url,patt]
represents a pattern that is matched on a SPARQL endpoint located at url.
SPARQLService
SPARQLService[url,patt]
represents a pattern that is matched on a SPARQL endpoint located at url.
范例
基本范例 (1)
Needs["GraphStore`"]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];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:
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 语言函数,https://reference.wolfram.com/language/GraphStore/ref/SPARQLService.html.
CMS
Wolfram 语言. 2019. "SPARQLService." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/GraphStore/ref/SPARQLService.html.
APA
Wolfram 语言. (2019). SPARQLService. Wolfram 语言与系统参考资料中心. 追溯自 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: 11-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: 11-August-2026]}