nquads

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package nquads implements parsing the RDF 1.1 N-Quads like line-based syntax for RDF datasets.

Typed parsing is performed as based on a simplified grammar derived from the N-Quads grammar defined by http://www.w3.org/TR/n-quads/.

Raw parsing is performed as defined by http://www.w3.org/TR/n-quads/ with the exception that parser will allow relative IRI values, which are prohibited by the N-Quads quad-Quads specifications.

For a complete definition of the grammar, see cquads.rl and nquads.rl.

Index

Constants

This section is empty.

Variables

View Source
var AutoConvertTypedString = true

AutoConvertTypedString allows to convert TypedString values to native equivalents directly while parsing. It will call ToNative on all TypedString values.

If conversion error occurs, it will preserve original TypedString value.

View Source
var DecodeRaw = false

Functions

func Parse

func Parse(statement string) (quad.Quad, error)

ParseTyped returns a valid quad.Quad or a non-nil error. ParseTyped does handle comments except where the comment placement does not prevent a complete valid quad.Quad from being defined.

func ParseRaw added in v0.6.1

func ParseRaw(statement string) (quad.Quad, error)

ParseRaw returns a valid quad.Quad or a non-nil error. ParseRaw does handle comments except where the comment placement does not prevent a complete valid quad.Quad from being defined.

Types

type Reader added in v0.6.1

type Reader struct {
	// contains filtered or unexported fields
}

Reader implements N-Quad document parsing according to the RDF 1.1 N-Quads specification.

func NewReader added in v0.6.1

func NewReader(r io.Reader, raw bool) *Reader

NewReader returns an N-Quad decoder that takes its input from the provided io.Reader.

func (*Reader) Close added in v0.6.1

func (dec *Reader) Close() error

func (*Reader) ReadQuad added in v0.6.1

func (dec *Reader) ReadQuad() (quad.Quad, error)

ReadQuad returns the next valid N-Quad as a quad.Quad, or an error.

type Writer added in v0.6.1

type Writer struct {
	// contains filtered or unexported fields
}

Writer implements N-Quad document generator according to the RDF 1.1 N-Quads specification.

func NewWriter added in v0.6.1

func NewWriter(w io.Writer) *Writer

NewWriter returns an N-Quad encoder that writes its output to the provided io.Writer.

func (*Writer) Close added in v0.6.1

func (enc *Writer) Close() error

func (*Writer) WriteQuad added in v0.6.1

func (enc *Writer) WriteQuad(q quad.Quad) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL