quad

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: Apache-2.0 Imports: 1 Imported by: 1,293

Documentation

Overview

Package quad is deprecated. Use github.com/cayleygraph/quad.

Index

Constants

View Source
const (
	Any       = quad.Any
	Subject   = quad.Subject
	Predicate = quad.Predicate
	Object    = quad.Object
	Label     = quad.Label
)

List of the valid directions of a quad.

View Source
const (
	// IRIDefault preserves current IRI formatting.
	IRIDefault = quad.IRIDefault
	// IRIShort changes IRI to use a short namespace prefix (ex: <rdf:type>).
	IRIShort = quad.IRIShort
	// IRIFull changes IRI to use full form (ex: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>).
	IRIFull = quad.IRIFull
)
View Source
const HashSize = quad.HashSize

HashSize is a size of the slice, returned by HashOf.

Deprecated: use github.com/cayleygraph/quad package instead.

Variables

View Source
var (
	ErrInvalid    = quad.ErrInvalid
	ErrIncomplete = quad.ErrIncomplete
)
View Source
var DefaultBatch = quad.DefaultBatch
View Source
var Directions = quad.Directions

Functions

func Copy deprecated added in v0.6.1

func Copy(dst Writer, src Reader) (n int, err error)

Copy will copy all quads from src to dst. It returns copied quads count and an error, if it failed.

Copy will try to cast dst to BatchWriter and will switch to CopyBatch implementation in case of success.

Deprecated: use github.com/cayleygraph/quad package instead.

func CopyBatch deprecated added in v0.6.1

func CopyBatch(dst BatchWriter, src Reader, batchSize int) (int, error)

CopyBatch will copy all quads from src to dst in a batches of batchSize. It returns copied quads count and an error, if it failed.

If batchSize <= 0 default batch size will be used.

Deprecated: use github.com/cayleygraph/quad package instead.

func HashOf deprecated added in v0.6.0

func HashOf(v Value) []byte

HashOf calculates a hash of value v.

Deprecated: use github.com/cayleygraph/quad package instead.

func HashTo deprecated added in v0.6.0

func HashTo(v Value, p []byte)

HashTo calculates a hash of value v, storing it in a slice p.

Deprecated: use github.com/cayleygraph/quad package instead.

func IsValidValue added in v0.7.0

func IsValidValue(v Value) bool

func NativeOf deprecated added in v0.6.0

func NativeOf(v Value) interface{}

NativeOf safely call v.Native, returning nil in case of nil Value.

Deprecated: use github.com/cayleygraph/quad package instead.

func RegisterFormat deprecated added in v0.6.1

func RegisterFormat(f Format)

RegisterFormat registers a new quad-file format.

Deprecated: use github.com/cayleygraph/quad package instead.

func RegisterStringConversion deprecated added in v0.6.0

func RegisterStringConversion(dataType IRI, fnc StringConversion)

RegisterStringConversion will register an automatic conversion of TypedString values with provided type to a native equivalent such as Int, Time, etc.

If fnc is nil, automatic conversion from selected type will be removed.

Deprecated: use github.com/cayleygraph/quad package instead.

func StringOf deprecated added in v0.6.0

func StringOf(v Value) string

StringOf safely call v.String, returning empty string in case of nil Value.

Deprecated: use github.com/cayleygraph/quad package instead.

func ToString deprecated added in v0.7.0

func ToString(v Value) string

ToString casts a values to String or falls back to StringOf.

Deprecated: use github.com/cayleygraph/quad package instead.

Types

type BNode deprecated added in v0.6.0

type BNode = quad.BNode

BNode is an RDF Blank Node (ex: _:name).

Deprecated: use github.com/cayleygraph/quad package instead.

func RandomBlankNode deprecated added in v0.6.1

func RandomBlankNode() BNode

RandomBlankNode returns a randomly generated Blank Node.

Deprecated: use github.com/cayleygraph/quad package instead.

type BatchReader deprecated added in v0.6.1

type BatchReader = quad.BatchReader

BatchReader is an interface for reading quads in batches.

ReadQuads reads at most len(buf) quads into buf. It returns number of quads that were read and an error. It returns an io.EOF if there is no more quads to read.

Deprecated: use github.com/cayleygraph/quad package instead.

type BatchWriter deprecated added in v0.6.1

type BatchWriter = quad.BatchWriter

BatchWriter is an interface for writing quads in batches.

Deprecated: use github.com/cayleygraph/quad package instead.

type Bool deprecated added in v0.6.0

type Bool = quad.Bool

Bool is a native wrapper for bool type.

It uses NQuad notation similar to TypedString.

Deprecated: use github.com/cayleygraph/quad package instead.

type ByQuadString added in v0.6.0

type ByQuadString = quad.ByQuadString

type ByValueString added in v0.6.0

type ByValueString = quad.ByValueString

type Direction deprecated

type Direction = quad.Direction

Direction specifies an edge's type.

Deprecated: use github.com/cayleygraph/quad package instead.

type Equaler deprecated added in v0.6.0

type Equaler = quad.Value

Equaler interface is implemented by values, that needs a special equality check.

Deprecated: use github.com/cayleygraph/quad package instead.

type Float deprecated added in v0.6.0

type Float = quad.Float

Float is a native wrapper for float64 type.

It uses NQuad notation similar to TypedString.

Deprecated: use github.com/cayleygraph/quad package instead.

type Format deprecated added in v0.6.1

type Format = quad.Format

Format is a description for quad-file formats.

Deprecated: use github.com/cayleygraph/quad package instead.

func FormatByExt deprecated added in v0.6.1

func FormatByExt(name string) *Format

FormatByExt returns a registered format by its file extension. Will return nil if format is not found.

Deprecated: use github.com/cayleygraph/quad package instead.

func FormatByMime deprecated added in v0.6.1

func FormatByMime(name string) *Format

FormatByMime returns a registered format by its MIME type. Will return nil if format is not found.

Deprecated: use github.com/cayleygraph/quad package instead.

func FormatByName deprecated added in v0.6.1

func FormatByName(name string) *Format

FormatByName returns a registered format by its name. Will return nil if format is not found.

Deprecated: use github.com/cayleygraph/quad package instead.

func Formats deprecated added in v0.6.1

func Formats() []Format

Formats returns a list of all supported quad formats.

Deprecated: use github.com/cayleygraph/quad package instead.

type IRI deprecated added in v0.6.0

type IRI = quad.IRI

IRI is an RDF Internationalized Resource Identifier (ex: <name>).

Deprecated: use github.com/cayleygraph/quad package instead.

type IRIFormat deprecated added in v0.7.6

type IRIFormat = quad.IRIFormat

IRIFormat is a format of IRI.

Deprecated: use github.com/cayleygraph/quad package instead.

type IRIOptions deprecated added in v0.7.6

type IRIOptions = quad.IRIOptions

IRIOptions is a set of option

Deprecated: use github.com/cayleygraph/quad package instead.

type Int deprecated added in v0.6.0

type Int = quad.Int

Int is a native wrapper for int64 type.

It uses NQuad notation similar to TypedString.

Deprecated: use github.com/cayleygraph/quad package instead.

type LangString deprecated added in v0.6.0

type LangString = quad.LangString

LangString is an RDF string with language (ex: "name"@lang).

Deprecated: use github.com/cayleygraph/quad package instead.

type Quad deprecated

type Quad = quad.Quad

Our quad struct, used throughout.

Deprecated: use github.com/cayleygraph/quad package instead.

func Make deprecated added in v0.6.0

func Make(subject, predicate, object, label interface{}) Quad

Make creates a quad with provided values.

Deprecated: use github.com/cayleygraph/quad package instead.

func MakeIRI deprecated added in v0.6.1

func MakeIRI(subject, predicate, object, label string) Quad

MakeIRI creates a quad with provided IRI values.

Deprecated: use github.com/cayleygraph/quad package instead.

func MakeRaw deprecated added in v0.6.0

func MakeRaw(subject, predicate, object, label string) Quad

MakeRaw creates a quad with provided raw values (nquads-escaped).

Deprecated: use Make pr MakeIRI instead.

func ReadAll deprecated added in v0.6.1

func ReadAll(r Reader) ([]Quad, error)

ReadAll reads all quads from r until EOF. It returns a slice with all quads that were read and an error, if any.

Deprecated: use github.com/cayleygraph/quad package instead.

type Quads added in v0.6.1

type Quads = quad.Quads

func NewReader deprecated added in v0.6.1

func NewReader(quads []Quad) *Quads

NewReader creates a quad reader from a quad slice.

Deprecated: use github.com/cayleygraph/quad package instead.

type ReadCloser added in v0.6.1

type ReadCloser = quad.ReadCloser

type ReadSkipCloser added in v0.6.1

type ReadSkipCloser = quad.ReadSkipCloser

type Reader deprecated added in v0.6.1

type Reader = quad.Reader

Reader is a minimal interface for quad readers. Used for quad deserializers and quad iterators.

ReadQuad reads next valid Quad. It returns io.EOF if no quads are left.

Deprecated: use github.com/cayleygraph/quad package instead.

type Sequence deprecated added in v0.6.1

type Sequence = quad.Sequence

Sequence is an object to generate a sequence of Blank Nodes.

Deprecated: use github.com/cayleygraph/quad package instead.

type Skipper deprecated added in v0.6.1

type Skipper = quad.Skipper

Skipper is an interface for quad reader that can skip quads efficiently without decoding them.

It returns io.EOF if no quads are left.

Deprecated: use github.com/cayleygraph/quad package instead.

type String deprecated added in v0.6.0

type String = quad.String

String is an RDF string value (ex: "name").

Deprecated: use github.com/cayleygraph/quad package instead.

type StringConversion deprecated added in v0.6.0

type StringConversion = quad.StringConversion

StringConversion is a function to convert string values with a specific IRI type to their native equivalents.

Deprecated: use github.com/cayleygraph/quad package instead.

type Time deprecated added in v0.6.0

type Time = quad.Time

Time is a native wrapper for time.Time type.

It uses NQuad notation similar to TypedString.

Deprecated: use github.com/cayleygraph/quad package instead.

type TypedString deprecated added in v0.6.0

type TypedString = quad.TypedString

TypedString is an RDF value with type (ex: "name"^^<type>).

Deprecated: use github.com/cayleygraph/quad package instead.

type TypedStringer added in v0.6.1

type TypedStringer interface {
	TypedString() TypedString
}

type Value deprecated added in v0.6.0

type Value = quad.Value

Value is a type used by all quad directions.

Deprecated: use github.com/cayleygraph/quad package instead.

func AsValue deprecated added in v0.6.0

func AsValue(v interface{}) (Value, bool)

AsValue converts native type into closest Value representation. It returns false if type was not recognized.

Deprecated: use github.com/cayleygraph/quad package instead.

func Raw deprecated added in v0.6.0

func Raw(s string) Value

Raw is a Turtle/NQuads-encoded value.

Deprecated: use IRI or String instead.

func StringToValue deprecated added in v0.6.0

func StringToValue(v string) Value

StringToValue is a function to convert strings to typed quad values.

Deprecated: use github.com/cayleygraph/quad package instead.

type WriteCloser added in v0.6.1

type WriteCloser = quad.WriteCloser

type Writer deprecated added in v0.6.1

type Writer = quad.Writer

Writer is a minimal interface for quad writers. Used for quad serializers and quad stores.

Deprecated: use github.com/cayleygraph/quad package instead.

func IRIWriter deprecated added in v0.7.6

func IRIWriter(w Writer, opt IRIOptions) Writer

IRIWriter is a writer implementation that converts all IRI values in quads according to the IRIOptions.

Deprecated: use github.com/cayleygraph/quad package instead.

func ValuesWriter deprecated added in v0.7.6

func ValuesWriter(w Writer, fnc func(d Direction, v Value) (Value, error)) Writer

ValuesWriter is a writer implementation that converts all quad values using the callback function.

Deprecated: use github.com/cayleygraph/quad package instead.

Directories

Path Synopsis
Package dot is deprecated.
Package dot is deprecated.
Package gml is deprecated.
Package gml is deprecated.
Package graphml is deprecated.
Package graphml is deprecated.
Package json is deprecated.
Package json is deprecated.
Package jsonld is deprecated.
Package jsonld is deprecated.
Package nquads is deprecated.
Package nquads is deprecated.
Package pquads is deprecated.
Package pquads is deprecated.
pio

Jump to

Keyboard shortcuts

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