WOLFRAM

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

SPARQLGraph[iri,expr]

represents expr in the context of the graph identified by the identifier iri.

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

SPARQLGraph[iri,expr]

represents expr in the context of the graph identified by the identifier iri.

Details and Options

  • SPARQLGraph[iri,patt] can be used in SPARQLSelect and related functions to match the graph pattern patt against the graph identified by the identifier iri.
  • SPARQLGraph[iri,data] can be used in SPARQLInsertData and related functions to insert data into the graph identified by the identifier iri.

Examples

Basic Examples  (1)

Wolfram Language code: Needs["GraphStore`"]

Current and historical data about countries:

Wolfram Language code: rdfs[s_] := URL["http://www.w3.org/2000/01/rdf-schema#" <> s]; time[s_] := URL["http://www.w3.org/2006/time#" <> s]; ex[s_] := URL["http://example.org/" <> s];
Wolfram Language code: countryData = RDFStore[ { RDFTriple[ex["spain"], rdfs["label"], "Spain"], RDFTriple[ex["spain"], ex["population"], 46528024], RDFTriple[ex["hungary"], rdfs["label"], "Hungary"], RDFTriple[ex["hungary"], ex["population"], 9817958] }, <| ex["historical/1980"] -> { RDFTriple[ex["historical/1980"], time["year"], 1980], RDFTriple[ex["spain"], ex["population"], 37439035] } |> ]

Look up historical data for Spain:

Wolfram Language code: countryData//SPARQLSelect[SPARQLGraph[SPARQLVariable["g"], { RDFTriple[SPARQLVariable["g"], time["year"], SPARQLVariable["year"]], RDFTriple[ex["spain"], ex["population"], SPARQLVariable["pop"]] }] -> {"year", "pop"}]

The latest data:

Wolfram Language code: countryData//SPARQLSelect[RDFTriple[ex["spain"], ex["population"], SPARQLVariable["pop"]]]

Insert additional historical data:

Wolfram Language code: countryData = countryData//SPARQLInsertData[SPARQLGraph[ex["historical/1961"], { RDFTriple[ex["historical/1961"], time["year"], 1961], RDFTriple[ex["spain"], ex["population"], 30739250] }]]

An additional named graph has been added to the RDF dataset:

Wolfram Language code: countryData//SPARQLSelect[SPARQLGraph[SPARQLVariable["g"], {}]]
Wolfram Research (2019), SPARQLGraph, Wolfram Language function, https://reference.wolfram.com/language/GraphStore/ref/SPARQLGraph.html.

Text

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

CMS

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

APA

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

BibTeX

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

BibLaTeX

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

Top [フレーム]

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