SPARQLInsert[patterntemplate]
is an insert operator that can be applied to an RDFStore, which inserts data generated from template, based on solutions of matching pattern.
SPARQLInsert
SPARQLInsert[patterntemplate]
is an insert operator that can be applied to an RDFStore, which inserts data generated from template, based on solutions of matching pattern.
更多信息和选项
- SPARQLInsert can be used in SPARQLExecute to insert data into a SPARQL endpoint.
- In SPARQLInsert[patterntemplate], template corresponds to the INSERT clause, and pattern corresponds to the WHERE clause of a SPARQL update request.
范例
打开所有单元 关闭所有单元基本范例 (1)
Needs["GraphStore`"]Specify a graph containing data about geometric objects:
ex[s_] := URL["http://example.org/" <> s];graph = RDFStore[{
RDFTriple[ex["square"], ex["edgeLength"], 1],
RDFTriple[ex["square"], ex["area"], 1],
RDFTriple[ex["disk"], ex["radius"], 1],
RDFTriple[ex["disk"], ex["area"], 3.14]
}];Add the diameter to objects that have a radius:
graph = graph//SPARQLInsert[{
RDFTriple[SPARQLVariable["obj"], ex["radius"], SPARQLVariable["r"]],
"d" -> 2SPARQLVariable["r"]
} -> RDFTriple[SPARQLVariable["obj"], ex["diameter"], SPARQLVariable["d"]]]graph//SPARQLSelect[RDFTriple[SPARQLVariable["obj"], ex["diameter"], SPARQLVariable["d"]]]Applications (1)
Needs["GraphStore`"]Export an insert operator as a SPARQL update string:
ExportString[
SPARQLInsert[{
RDFTriple[SPARQLVariable["obj"], URL["http://example.org/radius"], SPARQLVariable["r"]],
"d" -> 2SPARQLVariable["r"]
} -> RDFTriple[SPARQLVariable["obj"], URL["http://example.org/diameter"], SPARQLVariable["d"]]],
"SPARQLUpdate",
"Prefixes" -> <|"ex" -> "http://example.org/"|>
]文本
Wolfram Research (2019),SPARQLInsert,Wolfram 语言函数,https://reference.wolfram.com/language/GraphStore/ref/SPARQLInsert.html.
CMS
Wolfram 语言. 2019. "SPARQLInsert." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/GraphStore/ref/SPARQLInsert.html.
APA
Wolfram 语言. (2019). SPARQLInsert. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/GraphStore/ref/SPARQLInsert.html 年
BibTeX
@misc{reference.wolfram_2026_sparqlinsert, author="Wolfram Research", title="{SPARQLInsert}", year="2019", howpublished="\url{https://reference.wolfram.com/language/GraphStore/ref/SPARQLInsert.html}", note=[Accessed: 17-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_sparqlinsert, organization={Wolfram Research}, title={SPARQLInsert}, year={2019}, url={https://reference.wolfram.com/language/GraphStore/ref/SPARQLInsert.html}, note=[Accessed: 17-August-2026]}