TriG is a serialization format for RDF (Resource Description Framework) graphs. It is a plain text format for serializing named graphs and RDF Datasets which offers a compact and readable alternative to the XML-based TriX syntax.
Filename extension |
.trig |
---|---|
Internet media type |
application/trig |
Developed by | Freie Universität Berlin |
Type of format | semantic web |
Container for | RDF data |
Extended from | Turtle |
Standard | W3C Recommendation |
Example
editThis example encodes three interlinked named graphs:
- http://www.example.org/exampleDocument#G1
- http://www.example.org/exampleDocument#G2
- http://www.example.org/exampleDocument#G3
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix swp: <http://www.w3.org/2004/03/trix/swp-1/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix ex: <http://www.example.org/vocabulary#> .
@prefix : <http://www.example.org/exampleDocument#> .
:G1 { :Monica ex:name "Monica Murphy" .
:Monica ex:homepage <http://www.monicamurphy.org> .
:Monica ex:email <mailto:monica@monicamurphy.org> .
:Monica ex:hasSkill ex:Management }
:G2 { :Monica rdf:type ex:Person .
:Monica ex:hasSkill ex:Programming }
:G3 { :G1 swp:assertedBy _:w1 .
_:w1 swp:authority :Chris .
_:w1 dc:date "2003-10-02"^^xsd:date .
:G2 swp:quotedBy _:w2 .
:G3 swp:assertedBy _:w2 .
_:w2 dc:date "2003-09-03"^^xsd:date .
_:w2 swp:authority :Chris .
:Chris rdf:type ex:Person .
:Chris ex:email <mailto:chris@bizer.de> }
External links
edit- TriG Specification (2007)
- RDF 1.1 TriG W3C Recommendation (2014)
- Yacker TriG validator, which does not handle sub-graphs, and does not validate the above example.