SPARQLProject["var"]
is a query operator that yields solutions containing only values for the variable "var".
SPARQLProject["newvar"expr]
yields solutions containing only the variable "newvar" whose value is computed from expr.
SPARQLProject[{vspec1,vspec2,…}]
selects and computes values for multiple variables.
SPARQLProject
SPARQLProject["var"]
is a query operator that yields solutions containing only values for the variable "var".
SPARQLProject["newvar"expr]
yields solutions containing only the variable "newvar" whose value is computed from expr.
SPARQLProject[{vspec1,vspec2,…}]
selects and computes values for multiple variables.
Details and Options
- A RightComposition of operators SPARQLSelect[…]/*…/*SPARQLProject[…]/*… can be used in SPARQLExecute to query a SPARQL endpoint. Composition is also supported.
- SPARQLProject[…] can be applied to the result of a SPARQLSelect query.
- In SPARQLProject[{…,"newvari"expri,…,"newvari+n"expri+n,…}], SPARQLVariable["newvari"] can be used in expri+n to refer to the value of expri.
Examples
open all close allBasic Examples (1)
Needs["GraphStore`"]books = GraphStore`RDFStore[{GraphStore`RDFTriple[URL["http://example.org/gravitation"],
URL["https://schema.org/datePublished"], DateObject[{1973}, "Year", "Gregorian", 2.]],
GraphStore`RDFTriple[URL["http://example.org/faust"], URL["https://schema.org/datePublished"],
DateObject[{1808}, "Year", "Gregorian", 2.]]}, Association[]];Find books and compute their time since publication in years:
books//SPARQLQuery[
SPARQLSelect[RDFTriple[SPARQLVariable["book"], URL["https://schema.org/datePublished"], SPARQLVariable["date"]]] /*
SPARQLProject[{"book", "age" -> DateValue["Year"] - SPARQLEvaluation["year"][SPARQLVariable["date"]]}]
]Properties & Relations (1)
Needs["GraphStore`"]data = {
<|"x" -> 1, "y" -> "a"|>,
<|"x" -> 10, "y" -> "b"|>,
<|"x" -> 100, "y" -> "c"|>
};data//SPARQLProject["x"]The same using KeyTake:
data//KeyTake["x"]data//SPARQLProject["xsquared" -> SPARQLVariable["x"] ^ 2]The same using Query:
data//Query[All, <|"xsquared" -> (#x ^ 2&)|>]Related Guides
Text
Wolfram Research (2020), SPARQLProject, Wolfram Language function, https://reference.wolfram.com/language/GraphStore/ref/SPARQLProject.html.
CMS
Wolfram Language. 2020. "SPARQLProject." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/GraphStore/ref/SPARQLProject.html.
APA
Wolfram Language. (2020). SPARQLProject. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/GraphStore/ref/SPARQLProject.html
BibTeX
@misc{reference.wolfram_2026_sparqlproject, author="Wolfram Research", title="{SPARQLProject}", year="2020", howpublished="\url{https://reference.wolfram.com/language/GraphStore/ref/SPARQLProject.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_sparqlproject, organization={Wolfram Research}, title={SPARQLProject}, year={2020}, url={https://reference.wolfram.com/language/GraphStore/ref/SPARQLProject.html}, note=[Accessed: 15-June-2026]}