Categorygithub.com/knakk/rdf
modulepackage
0.0.0-20190304171630-8521bf4c5042
Repository: https://github.com/knakk/rdf.git
Documentation: pkg.go.dev

# README

rdf

This package introduces data structures for representing RDF resources, and includes functions for parsing and serialization of RDF data.

For complete documentation see godoc.

# Functions

NewBlank returns a new blank node with a given label.
NewIRI returns a new IRI, or an error if it's not valid.
NewLangLiteral creates a RDF literal with a given language tag, or fails if the language tag is not well-formed.
NewLiteral returns a new Literal, or an error on invalid input.
NewQuadDecoder returns a new QuadDecoder capable of parsing quads from the given io.Reader in the given serialization format.
NewQuadEncoder returns a new QuadEncoder on the given writer.
NewTripleDecoder returns a new TripleDecoder capable of parsing triples from the given io.Reader in the given serialization format.
NewTripleEncoder returns a new TripleEncoder capable of serializing into the given io.Writer in the given serialization format.
NewTypedLiteral returns a literal with the given datatype.
QuadsEqual tests if two Quads are identical.
TermsEqual returns true if two Terms are equal, or false if they are not.
TriplesEqual tests if two Triples are identical.

# Constants

Base IRI to resolve relative IRIs against (for formats that support relative IRIs: Turtle, RDF/XML, TriG, JSON-LD).
N-Quads.
Supported parser/serialization formats for Triples and Quads.
Supported parser/serialization formats for Triples and Quads.
Exported RDF term types.
Exported RDF term types.
Exported RDF term types.
Supported parser/serialization formats for Triples and Quads.

# Variables

DateFormat defines the string representation of xsd:DateTime values.
ErrEncoderClosed is the error returned from Encode() when the Triple/Quad-Encoder is closed.

# Structs

Blank represents a RDF blank node; an unqualified IRI with identified by a label.
IRI represents a RDF IRI resource.
Literal represents a RDF literal; a value with a datatype and (optionally) an associated language tag for strings.
Quad represents a RDF Quad; a Triple plus the context in which it occurs.
QuadDecoder parses RDF quads in one of the following formats: N-Quads.
QuadEncoder serializes RDF Quads.
Triple represents a RDF triple.
TripleEncoder serializes RDF Triples into one of the following formats: N-Triples, Turtle, RDF/XML.

# Interfaces

Context interface distiguishes which Terms are valid as a Quad's Context.
Object interface distiguishes which Terms are valid as a Object of a Triple.
Predicate interface distiguishes which Terms are valid as a Predicate of a Triple.
Subject interface distiguishes which Terms are valid as a Subject of a Triple.
Term represents an RDF term.
TripleDecoder parses RDF documents (serializations of an RDF graph).

# Type aliases

Format represents a RDF serialization format.
A ParseOption allows to customize the behaviour of a decoder.
TermType describes the type of RDF term: Blank node, IRI or Literal.