WOLFRAM

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

SPARQLUpdate[operator1/*operator2/*]

is an update operator that can be applied to an RDFStore .

SPARQLUpdate["update"]

uses a SPARQL update string.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
See Also
Related Guides
Cite this Page

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)

Wolfram Language code: Needs["GraphStore`"]

Start with an empty graph:

Wolfram Language code: g = RDFStore[{}];

Insert data about strawberries:

Wolfram Language code: rdfs[s_] := URL["http://www.w3.org/2000/01/rdf-schema#" <> s]; ex[s_] := URL["http://example.org/" <> s];
Wolfram Language code: g = SPARQLUpdate[ SPARQLInsertData[{ RDFTriple[ex["strawberry"], rdfs["label"], "strawberry"], RDFTriple[ex["strawberry"], ex["color"], "red"] }] ][g]

Insert more data using a SPARQL update string:

Wolfram Language code: 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:

Wolfram Language code: 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 Language function, https://reference.wolfram.com/language/GraphStore/ref/SPARQLUpdate.html.

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: 18-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: 18-August-2026]}

Top [フレーム]

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