Formats Supported By dotNetRDF
The following table summarizes all of the formats that are supported by dotNetRDF for parsing and/or writing.
Where multiple dialects are listed, the selection of the dialect is generally controlled through a constructor argument when making a new instance of the relevant parser or writer. The dialect shown in bold-face is the default dialect used when loading from an HTTP response / local file without explicitly specifying the parser to be used.
The Form column shows what format the output of the reader is (or the input of the writer is expected to be).
The Reader Class and Writer Class link to the class documentation for the class that implements parsing and writing for the specified format. Where multiple classes are listed, the first one in the list is the class that is used by default when loading from an HTTP response / local file without explicitly specifying the parser to be used.
The Media Types column shows the IANA media type strings that are recognized for the format when loading RDF from a URL. The GZipped versions of parsers map to the same IANA media type strings as their non-gzipped counterpart and are used when an HTTP respnose indicates that the response body is compressed.
The File Extensions column shows the file extensions that are recognized for the format when loading RDF from a local file.
Note, for some formats parsing or writing is not supported. This is shown by the value N/A
in the Reader Class or Writer Class column where the format is not supported for reading/writing.
Format | Dialects | Form | Reader Class | Writer Class | Media Types | File Extenions |
---|---|---|---|---|---|---|
N-Triples | Original W3C Specification RDF 1.1 RDF-Star |
Graph | NTriplesParser | NTriplesWriter | application/n-triples text/plain text/ntriples text/ntriples+turtle application/rdf-triples application/x-ntriples application/ntriples |
.nt |
GZipped N-Triples | Original W3C Specification RDF 1.1 RDF-Star |
Graph | GZippedNTriplesParser | GZippedNTriplesWriter | .nt.gz | |
Turtle | Original RDF 1.1 RDF-Star |
Graph | TurtleParser | CompressingTurtleWriter | text/turtle application/x-turtle application/turtle |
.ttl |
GZipped Turtle | Original RDF 1.1 RDF-Star |
Graph | GzippedTurtleParser | GZippedTurtleWriter | .ttl.gz | |
N3 (Notation 3) | Graph | Notation3Parser | Notation3Writer | text/n3 text/rdf+n3 |
.n3 | |
GZipped N3 | Graph | GZippedNotation3Parser | GZippedNotation3Writer | .n3.gz | ||
NQuads | Original DERI Specification RDF 1.1 RDF-Star |
Store | NQuadsParser | NQuadsWriter | application/n-quads text/x-nquads |
.nq |
GZipped NQuads | Original DERI Specification RDF 1.1 RDF-Star |
Store | GZippedNQuadsParser | GZippedNQuadsWriter | .nq.gz | |
TriG | Original Member Submission RDF 1.1 RDF-Star |
Store | TriGParser | TriGWriter | application/x-trig | .trig |
GZipped Trig | Original Member Submission RDF 1.1 RDF-Star |
Store | GZippedTriGParser | GZippedTriGWriter | .trig.gz | |
TriX | Store | TriXParser | TriXWriter | application/trix | .xml | |
GZipped TriX | Store | GZippedTriXParser | GZippedTriXWriter | .xml.gz | ||
RDF/XML | Graph | RdfXmlParser | RdfXmlWriter PrettyRdfXmlWriter |
application/rdf+xml text/xml application/xml |
.rdf .owl |
|
GZipped RDF/XML | Graph | GZippedRdfXmlParser | GZippedRdfXmlWriter | .rdf.gz | ||
RDF/JSON | Graph | RdfJsonParser | RdfJsonWriter | application/json text/json application/rdf+json |
.rj .json |
|
GZipped RDF/JSON | Graph | GZippedRdfJsonParser | GZippedRdfJsonWriter | .rj.gz .json.gz |
||
JSON-LD | JSON-LD 1.0 JSON-LD 1.1 |
Store | JsonLdParser | JsonLdWriter | application/ld+json | .jsonld .json |
GZipped JSON-LD | JSON-LD 1.0 JSON-LD 1.1 |
Store | GZippedJsonLdParser | GZippedJsonLdWriter | .jsonld.gz .json.gz |
|
HTML + RDFa | RDFa 1.0 RDFa 1.1 Auto-detect (see notes) |
Graph | RdfAParser | HtmlWriter | text/html application/xhtml+xml |
.html .xhtml |
GZipped HTML + RDFa | Graph | GZippedRdfAParser | GZippedRdfAWriter | .html.gz .xhtml.gz |
||
CSV (Triples) | Graph | N/A | CsvWriter | |||
CSV (Quads) | Store | N/A | CsvStoreWriter | |||
TSV (Triples) | Graph | N/A | TsvWriter | |||
TSV (Quads) | Store | N/A | TsvStoreWriter | text/html application/xhtml+xml |
||
SPARQL Results XML | SPARQL Results | SparqlXmlParser | SparqlXmlWriter | application/sparql-results+xml | .srx | |
GZipped SPARQL Results XML | SPARQL Results | GZippedSparqlXmlParser | GZippedSparqlXmlWriter | .srx.gz | ||
SPARQL Results JSON | SPARQL Results | SparqlJsonParser | SparqlJsonWriter | application/sparql-results+json | .srj .json |
|
GZipped SPARQL Results JSON | SPARQL Results | GZippedSparqlJsonParser | GZippedSparqlJsonWriter | .srj.gz .json.gz |
||
SPARQL Results Boolean | SPARQL Results | SparqlBooleanParser | N/A | text/boolean | ||
SPARQL Results CSV | SPARQL Results | SparqlCsvParser | SparqlCsvWriter | text/csv text/comma-separated-values |
.csv | |
GZipped SPARQL Results CSV | SPARQL Results | GZippedSparqlCsvParser | GZippedSparqlCsvWriter | .csv.gz | ||
SPARQL Results TSV | SPARQL Results | SparqlTsvParser | SparqlTsvWriter | text/tab-separated-values | .tsv | |
GZipped SPARQL Results TSV | SPARQL Results | GZippedSparqlTsvParser | GZippedSparqlTsvWriter | .tsv.gz | ||
SPARQL Results RDF | See Notes | SPARQL Results | SparqlRdfParser | N/A | ||
SPARQL Results HTML | SPARQL Results | N/A | SparqlHtmlWriter | |||
SPARQL Query | SPARQL 1.0 SPARQL 1.1 SPARQL 1.1 plus dotNetRDF Extensions SPARQL-Star |
SPARQL Query | SparqlQueryParser | N/A | application/sparql-query | .rq |
SPARQL Update | SPARQL 1.0 SPARQL 1.1 SPARQL 1.1 plus dotNetRDF Extensions SPARQL-Star |
SPARQL Update | SparqlUpdateParser | N/A | application/sparql-update | .ru |
GraphViz DOT | Graph | N/A | GraphVizWriter | |||
GraphML | Graph | N/A | GraphMLWriter |
Notes
The HTML+RDFa parser supports auto-detection modes that default to either RDFa 1.1 or RDFa 1.0. The default mode used defaults to RDFa 1.1.
The SPARQL Results RDF parser will support any of the RDF syntaxes for graphs. It expects the results set to be expressed using the DAWG SPARQL Results vocabulary. It defaults to an attempt to auto-detect the format from the input stream (which will fall back to N-Triples if another format is not successfully detected).
Convenience Writers
The class SingleGraphWriter allows a Store writer to be used to write out a single IGraph instance by treating it as the default graph of a Store.