SPARQLVariable["var"]
SPARQLクエリでラベル"var"を持つ変数を表す.
SPARQLVariable
SPARQLVariable["var"]
SPARQLクエリでラベル"var"を持つ変数を表す.
例題
すべて開く すべて閉じる例 (1)
Needs["GraphStore`"]人物についてのRDFStoreが与えられる:
store = GraphStore`RDFStore[{GraphStore`RDFTriple[URL["http://example.org/sophia"],
URL["http://xmlns.com/foaf/0.1/firstName"], "Sophia"],
GraphStore`RDFTriple[URL["http://example.org/sophia"], URL["http://xmlns.com/foaf/0.1/lastName"],
"Rodríguez"]}, Association[]];foaf[s_] := URL["http://xmlns.com/foaf/0.1/" <> s];store//SPARQLSelect[{
RDFTriple[SPARQLVariable["person"], foaf["firstName"], SPARQLVariable["first"]]
}]store//SPARQLSelect[{
RDFTriple[SPARQLVariable["person"], foaf["firstName"], SPARQLVariable["first"]],
RDFTriple[SPARQLVariable["person"], foaf["firstName"], SPARQLVariable["last"]]
}]考えられる問題 (1)
Needs["GraphStore`"]人物についてのRDFStoreが与えられる:
store = GraphStore`RDFStore[{GraphStore`RDFTriple[URL["http://example.org/sophia"],
URL["http://xmlns.com/foaf/0.1/firstName"], "Sophia"],
GraphStore`RDFTriple[URL["http://example.org/sophia"], URL["http://xmlns.com/foaf/0.1/lastName"],
"Rodríguez"]}, Association[]];foaf[s_] := URL["http://xmlns.com/foaf/0.1/" <> s];firstLastPatt = {
RDFTriple[SPARQLVariable["person"], foaf["firstName"], SPARQLVariable["first"]],
RDFTriple[SPARQLVariable["person"], foaf["lastName"], SPARQLVariable["last"]]
};"concat"関数内の文字列"first"と"last"はリテラルに解釈される:
store//SPARQLSelect[firstLastPatt -> {
"name" -> SPARQLEvaluation["concat"]["first", " ", "last"]
}]変数を参照する場合はSPARQLVariableラッパーを使う:
store//SPARQLSelect[firstLastPatt -> {
"name" -> SPARQLEvaluation["concat"][SPARQLVariable["first"], " ", SPARQLVariable["last"]]
}]関連するガイド
テキスト
Wolfram Research (2019), SPARQLVariable, Wolfram言語関数, https://reference.wolfram.com/language/GraphStore/ref/SPARQLVariable.html.
CMS
Wolfram Language. 2019. "SPARQLVariable." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/GraphStore/ref/SPARQLVariable.html.
APA
Wolfram Language. (2019). SPARQLVariable. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/GraphStore/ref/SPARQLVariable.html
BibTeX
@misc{reference.wolfram_2026_sparqlvariable, author="Wolfram Research", title="{SPARQLVariable}", year="2019", howpublished="\url{https://reference.wolfram.com/language/GraphStore/ref/SPARQLVariable.html}", note=[Accessed: 16-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_sparqlvariable, organization={Wolfram Research}, title={SPARQLVariable}, year={2019}, url={https://reference.wolfram.com/language/GraphStore/ref/SPARQLVariable.html}, note=[Accessed: 16-August-2026]}