WOLFRAM

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

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
Details and Options Details and Options
Examples  
Basic Examples  
Properties & Relations  
See Also
Related Guides
Cite this Page

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 all

Basic Examples  (1)

Wolfram Language code: Needs["GraphStore`"]

Data about books:

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

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

Wolfram Language code: Needs["GraphStore`"]

Solutions for two variables:

Wolfram Language code: data = { <|"x" -> 1, "y" -> "a"|>, <|"x" -> 10, "y" -> "b"|>, <|"x" -> 100, "y" -> "c"|> };

Project to variable "x":

Wolfram Language code: data//SPARQLProject["x"]

The same using KeyTake :

Wolfram Language code: data//KeyTake["x"]

Compute the square of "x":

Wolfram Language code: data//SPARQLProject["xsquared" -> SPARQLVariable["x"] ^ 2]

The same using Query :

Wolfram Language code: data//Query[All, <|"xsquared" -> (#x ^ 2&)|>]
Wolfram Research (2020), SPARQLProject, Wolfram Language function, https://reference.wolfram.com/language/GraphStore/ref/SPARQLProject.html.

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

Top [フレーム]

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