quad

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2015 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 quad.

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 quad struct, used throughout.

func (Quad) Get

func (q Quad) Get(d Direction) string

Per-field accessor for quads.

func (Quad) IsValid

func (q Quad) IsValid() bool

func (Quad) NQuad added in v0.4.1

func (q Quad) NQuad() string

Prints a quad in N-Quad format.

func (Quad) String

func (q Quad) String() string

Pretty-prints a quad.

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