quad

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2014 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package quad defines quad and triple handling.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalid    = errors.New("invalid N-Quad")
	ErrIncomplete = errors.New("incomplete N-Quad")
)

Functions

This section is empty.

Types

type Direction

type Direction byte

Direction specifies an edge's type.

const (
	Any Direction = iota
	Subject
	Predicate
	Object
	Label
)

List of the valid directions of a triple.

func (Direction) Prefix

func (d Direction) Prefix() byte

func (Direction) String

func (d Direction) String() string

type Quad

type Quad struct {
	Subject   string `json:"subject"`
	Predicate string `json:"predicate"`
	Object    string `json:"object"`
	Label     string `json:"label,omitempty"`
}

Our triple struct, used throughout.

func (*Quad) Equals

func (q *Quad) Equals(o *Quad) bool

func (*Quad) Get

func (q *Quad) Get(d Direction) string

Per-field accessor for triples

func (*Quad) IsValid

func (q *Quad) IsValid() bool

func (*Quad) NTriple

func (q *Quad) NTriple() string

Prints a triple in N-Quad format.

func (*Quad) String

func (q *Quad) String() string

Pretty-prints a triple.

type Unmarshaler

type Unmarshaler interface {
	Unmarshal() (*Quad, error)
}

Directories

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

Jump to

Keyboard shortcuts

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