WOLFRAM

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

Background

Import & Export

Import Elements

Options

Examples  
Basic Examples  
See Also
GraphStore`

SPARQLQuery (.rq)

Background

Import & Export

  • Import ["file.rq"] imports a SPARQL query file, returning a symbolic SPARQL query operator.
  • Import ["file.rq",elements] imports the specified elements.
  • Export ["file.rq",expr] exports a symbolic SPARQL query operator to a SPARQL query file.

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Rules" full list of rules for each element and option
    "Options" list of rules for options, properties and settings
  • Data representation elements:
  • "Data" symbolic SPARQL query operator
    "Base" base IRI used to resolve relative IRIs
    "Prefixes" association of prefixes to namespace IRIs

Options

  • Import options:
  • "Base" Automatic base IRI used to resolve relative IRIs
  • The value of "Base" is only used if the file does not specify a base IRI.
  • "Base" can take the following values:
  • Automatic the file name of the imported file
    None no base IRI
    "iri" or URL ["iri"] an IRI
  • Export options:
  • "Base" None produce IRIs relative to this base
    "Prefixes" <||> produce prefixed names using these prefixes
  • A prefixed name has the form pre:local. The corresponding IRI is obtained by joining the namespace IRI associated with the prefix pre with the local part local.
  • "Base" and "Prefixes" can be used to shorten an exported file. These options do not change the meaning of the SPARQL query that the file represents.

Examples

Basic Examples  (1)

Wolfram Language code: Needs["GraphStore`"]

Import a SPARQL query string:

Wolfram Language code: query = ImportString[" select ?author (count(?work) as ?count) where { ?work <http://schema.org/author> ?author . } group by ?author ", "SPARQLQuery"]

Export as a query string:

Wolfram Language code: ExportString[query, "SPARQLQuery"]

Specify a prefix to shorten IRIs:

Wolfram Language code: ExportString[query, "SPARQLQuery", "Prefixes" -> <| "schema" -> "http://schema.org/" |>]

See Also

Formats: SPARQLUpdate

Top [フレーム]

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