The Resource Description Framework (RDF) is a general-purpose language for representing information in the Web.
This document defines a textual syntax for RDF called Trig that allows an RDF dataset to be completely written in a compact and natural text form, with abbreviations for common usage patterns and datatypes. TriG is an extension of the Turtle format.
This document defines TriG a concrete syntax for RDF as defined in the RDF Concepts and Abstract Syntax ([[!RDF-CONCEPTS]]) W3C Recommendation. TriG is an extension of Turtle ([[!TURTLE]]), extended to support representing a complete RDF Dataset.
The TriG Syntax and TriG Grammar sections formally define the language.
A TriG document allows writing down an RDF Dataset in a compact
textual form. It consists of a sequence of directives, graph statements
which contain triple-generating statements and optional blank lines.
Comments may be given after a #
that is not part of another
lexical token and continue to the end of the line.
Graph statements are a pair of an IRI and a group of triple statements
surrounded by {}
. The IRI of the graph statement may be
used in another graph statement which implies merging the tripes generated
by each graph statement, and may reoccur as part of any triple statement.
Optionally one graph statement may not not be labeled with an IRI. Such a
graph statement corresponds to the Default Graph of an RDF Dataset.
Examples should not refer to TriX vocabularies.
A graph statement pairs an IRI with a RDF Graph. The triple statements that make up the graph are enclosed in {}
.
In a TriG document a graph IRI MAY be used to label more then one graph. The IRI of a graph statement may be omitted. In this case the graph is considered the default graph of the RDF Dataset.
A RDF Dataset may contain only a single graph.
A RDF Dataset may contain a default graph, and named graphs.
A providence example
A verisions example
A web snapshot example
All other terms and directives come from Turtle.
BlankNodes sharing the same label in differently labeled graph statements MUST be considered to be the same BlankNode.
There should likely be some content here.
Defer to Turtle
The EBNF used here is defined in XML 1.0 (Third Edition) [[!EBNF-NOTATION]].
The media type of TriG is application/trig
.
The content encoding of TriG content is always UTF-8.
See Internet Media
Type, File Extension and Macintosh File Type for the media type
registration form.
TODO