[][src]Crate rdftk_io

Traits for reading/writing Statements and Graphs as well as implementations for common file formats.

The following are some well-known formats (see Wikipedia for a description of different serializations), support is indicated in the final column with an R for read support and W for write support. One additional module, dot allows for the creation of GraphViz dot files for a visualization of a graph's structure.

ModuleNameMIME TypeSpecificationR/W
ntN-Triplesapplication/n-triplesW3CW
nqN-Quadsapplication/n-quadsW3CW
n3N3text/rdf+n3W3C Submission
turtleTurtletext/turtleW3CW
xmlRDF/XMLapplication/rdf+xmlW3C
jsonJSON-LDapplication/ld+jsonW3C
TBDRDFatext/htmlW3C
TBDRDF/JSONapplication/rdf+jsonW3C
TBDTriGapplication/trigW3C
TBDHDT?W3C Submission
TBDBinaryRDFapplication/x-binary-rdfCommunity

Each module will also provide public constants NAME, FILE_EXTENSION, and MIME_TYPE.

Example

TBD

Modules

dot

Provides for writing a Graph instance in the GraphViz dot file format.

nq

Provides for writing a NamedGraph instance in the RDF 1.1 N-Quads, a line-based syntax for RDF datasets, format.

nt

Provides for writing a Graph instance in the RDF 1.1 N-Triples, a line-based syntax for an RDF graph format.

Traits

GraphReader

Read an entire Graph from the provided implementation of Read.

GraphWriter

Write all Statements in the Graph using the provided implementation of Write.

NamedGraphWriter

Write all Statements in the NamedGraph using the provided implementation of Write.

Functions

write_graph_to_string

A convenience function that will return a String containing the output of the GraphWriter for the given Graph instance.

write_named_graph_to_string

A convenience function that will return a String containing the output of the NamedGraphWriter for the given NamedGraph instance.