TriG (syntax)

Last updated
TriG
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

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.

Example

This example encodes three interlinked named graphs:

@prefixrdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>.@prefixxsd:<http://www.w3.org/2001/XMLSchema#>.@prefixswp:<http://www.w3.org/2004/03/trix/swp-1/>.@prefixdc:<http://purl.org/dc/elements/1.1/>.@prefixex:<http://www.example.org/vocabulary#>.@prefix:<http://www.example.org/exampleDocument#>.:G1{:Monicaex:name"Monica Murphy".:Monicaex:homepage<http://www.example.org>.:Monicaex:email<mailto:monica@example.org>.:Monicaex:hasSkillex:Management}:G2{:Monicardf:typeex:Person.:Monicaex:hasSkillex:Programming}:G3{:G1swp:assertedBy_:w1._:w1swp:authority:Chris._:w1dc:date"2003-10-02"^^xsd:date.:G2swp:quotedBy_:w2.:G3swp:assertedBy_:w2._:w2dc:date"2003-09-03"^^xsd:date._:w2swp:authority:Chris.:Chrisrdf:typeex:Person.:Chrisex:email<mailto:chris@example.com>}