GraphStore`
GraphStore`

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

  • 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 allclose all

Basic Examples  (1)

Data about books:

Find books and compute their time since publication in years:

Properties & Relations  (1)

Solutions for two variables:

Project to variable "x":

The same using KeyTake:

Compute the square of "x":

The same using Query: