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.
Details and Options
- 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.
Examples
Basic Examples (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]Related Guides
Text
Wolfram Research (2019), SPARQLUpdate, Wolfram Language function, https://reference.wolfram.com/language/GraphStore/ref/SPARQLUpdate.html.
CMS
Wolfram Language. 2019. "SPARQLUpdate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/GraphStore/ref/SPARQLUpdate.html.
APA
Wolfram Language. (2019). SPARQLUpdate. Wolfram Language & System Documentation Center. Retrieved from 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: 13-June-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: 13-June-2026]}