SPARQLUpdate[operator1/*operator2/*…]
is an update operator that can be applied to an RDFStore.
SPARQLUpdate["update"]
uses a SPARQL update string.
SPARQLUpdate
SPARQLUpdate[operator1/*operator2/*…]
is an update operator that can be applied to an RDFStore.
SPARQLUpdate["update"]
uses a SPARQL update string.
更多信息和选项
- SPARQLUpdate can be used in SPARQLExecute to update data in SPARQL endpoint.
- When SPARQLUpdate is applied to an RDFStore an updated store is returned. The original store is not modified.
- The following options can be given:
-
"Base" None base IRI used to resolve relative IRIs - SPARQLUpdate[File[...]] and SPARQLQuery[URL[...]] are also supported.
范例
基本范例 (1)
Needs["GraphStore`"]g = RDFStore[{}];Insert data about strawberries:
rdfs[s_] := URL["http://www.w3.org/2000/01/rdf-schema#" <> s];
ex[s_] := URL["http://example.org/" <> s];g = SPARQLUpdate[
SPARQLInsertData[{
RDFTriple[ex["strawberry"], rdfs["label"], "strawberry"],
RDFTriple[ex["strawberry"], ex["color"], "red"]
}]
][g]Insert more data using a SPARQL update string:
g = SPARQLUpdate["
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix ex: <http://example.org/>
insert data {
ex:banana rdfs:label \"banana\" ;
ex:color \"yellow\" .
}
"][g]Delete all data about red fruits:
g = SPARQLUpdate[
SPARQLDelete[{
RDFTriple[SPARQLVariable["s"], ex["color"], "red"],
RDFTriple[SPARQLVariable["s"], SPARQLVariable["p"], SPARQLVariable["o"]]
} -> RDFTriple[SPARQLVariable["s"], SPARQLVariable["p"], SPARQLVariable["o"]]]
][g]文本
Wolfram Research (2019),SPARQLUpdate,Wolfram 语言函数,https://reference.wolfram.com/language/GraphStore/ref/SPARQLUpdate.html.
CMS
Wolfram 语言. 2019. "SPARQLUpdate." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/GraphStore/ref/SPARQLUpdate.html.
APA
Wolfram 语言. (2019). SPARQLUpdate. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/GraphStore/ref/SPARQLUpdate.html 年
BibTeX
@misc{reference.wolfram_2026_sparqlupdate, author="Wolfram Research", title="{SPARQLUpdate}", year="2019", howpublished="\url{https://reference.wolfram.com/language/GraphStore/ref/SPARQLUpdate.html}", note=[Accessed: 07-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_sparqlupdate, organization={Wolfram Research}, title={SPARQLUpdate}, year={2019}, url={https://reference.wolfram.com/language/GraphStore/ref/SPARQLUpdate.html}, note=[Accessed: 07-August-2026]}