RDF formats

GraphDB supports multiple RDF formats for importing or exporting data. All RDF formats have at least one file extension and MIME type that identify the format. Where multiple file extensions or MIME types are available, the preferred file extension or MIME type is listed first.

The various formats differ when it comes to supporting named graphs, namespaces, and RDF-star. The following formats support everything and may be used to dump an entire repository preserving all of the information:

  • TriG-star (text, human readable, standard based)

  • BinaryRDF (binary, compact representation, RDF4J-specific)

Turtle

Named graphs

No

Namespaces

Yes

RDF-star

No

MIME types

text/turtle

application/x-turtle

File extensions

.ttl

RDF4J Java API constant

RDFFormat.TURTLE

Standard definition

http://www.w3.org/ns/formats/Turtle

Turtle-star

Named graphs

No

Namespaces

Yes

RDF-star

Yes

MIME types

text/x-turtlestar

application/x-turtlestar

File extensions

.ttls

RDF4J Java API constant

RDFFormat.TURTLESTAR

Standard definition

-

TriG

Named graphs

Yes

Namespaces

Yes

RDF-star

No

MIME types

application/trig

application/x-trig

File extensions

.trig

RDF4J Java API constant

RDFFormat.TRIG

Standard definition

http://www.w3.org/ns/formats/TriG

TriG-star

Named graphs

Yes

Namespaces

Yes

RDF-star

Yes

MIME types

application/x-trigstar

File extensions

.trigs

RDF4J Java API constant

RDFFormat.TRIGSTAR

Standard definition

-

N3

Named graphs

No

Namespaces

Yes

RDF-star

No

MIME types

text/n3

text/rdf+n3

File extensions

.n3

RDF4J Java API constant

RDFFormat.N3

Standard definition

http://www.w3.org/ns/formats/N3

N-Triples

Named graphs

No

Namespaces

No

RDF-star

No

MIME types

application/n-triples

text/plain

File extensions

.nt

RDF4J Java API constant

RDFFormat.NTRIPLES

Standard definition

http://www.w3.org/ns/formats/N-Triples

N-Quads

Named graphs

Yes

Namespaces

No

RDF-star

No

MIME types

application/n-quads

text/x-nquads

text/nquads

File extensions

.nq

RDF4J Java API constant

RDFFormat.NQUADS

Standard definition

http://www.w3.org/ns/formats/N-Quads

JSON-LD

Named graphs

Yes

Namespaces

Yes

RDF-star

No

MIME types

application/ld+json

File extensions

.jsonld

RDF4J Java API constant

RDFFormat.JSONLD

Standard definition

http://www.w3.org/ns/formats/JSON-LD

NDJSON-LD

Named graphs

Yes

Namespaces

Yes

RDF-star

No

MIME types

application/x-ld+ndjson

File extensions

.ndjsonld

.jsonl

.ndjson

RDF4J Java API constant

RDFFormat.NDJSONLD

Standard definition

-

RDF/JSON

Named graphs

Yes

Namespaces

No

RDF-star

No

MIME types

application/rdf+json

File extensions

.rj

RDF4J Java API constant

RDFFormat.RDFJSON

Standard definition

http://www.w3.org/ns/formats/RDF_JSON

RDF/XML

Named graphs

No

Namespaces

Yes

RDF-star

No

MIME types

application/rdf+xml

application/xml

text/xml

File extensions

.rdf

.rdfs

.owl

.xml

RDF4J Java API constant

RDFFormat.RDFXML

Standard definition

http://www.w3.org/ns/formats/RDF_XML

TriX

Named graphs

Yes

Namespaces

Yes

RDF-star

No

MIME types

application/trix

File extensions

.xml

.trix

RDF4J Java API constant

RDFFormat.TRIX

Standard definition

-

BinaryRDF

Named graphs

Yes

Namespaces

Yes

RDF-star

Yes

MIME types

application/x-binary-rdf

File extensions

.brf

RDF4J Java API constant

RDFFormat.BINARY

Standard definition

-