GraphStore`

TriG (.trig)

Background

Import & Export

  • Import["file.trig"] imports a TriG file, returning and RDFStore.
  • Import["file.trig",elements] imports the specified elements.
  • Export["file.trig",expr] exports an RDFStore to a TriG 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"an RDFStore
    "Base"base IRI used to resolve relative IRIs
    "Prefixes"association of prefixes to namespace IRIs

Options

  • Import options:
  • "Base"Automaticbase 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:
  • Automaticthe file name of the imported file
    Noneno base IRI
    "iri" or IRI["iri"]an IRI
  • Export options:
  • "Base"Noneproduce 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 don't change the meaning of the RDFStore that the file represents.

Examples

Basic Examples  (1)

In[1]:=
Click for copyable input

Import TriG data:

In[2]:=
Click for copyable input
Out[2]=

Export the same dataset:

In[3]:=
Click for copyable input
Out[3]=

Specify prefixes to shorten IRIs:

In[4]:=
Click for copyable input
Out[4]=

Specify a base instead:

In[5]:=
Click for copyable input
Out[5]=