Documentation ¶
Index ¶
- Constants
- Variables
- type BlankNode
- type DefaultGraph
- type Literal
- func (node *Literal) Datatype() Term
- func (node *Literal) Equal(term Term) bool
- func (node *Literal) Language() string
- func (node *Literal) MarshalJSON() ([]byte, error)
- func (node *Literal) String() string
- func (node *Literal) TermType() string
- func (node *Literal) UnmarshalJSON(data []byte) error
- func (node *Literal) Value() string
- type NamedNode
- type Quad
- type Term
- type TermLiteral
- type Variable
Constants ¶
const BlankNodeType = "BlankNode"
BlankNodeType is the TermType blank nodes
const DefaultGraphType = "DefaultGraph"
DefaultGraphType is the TermType for default graphs
const LiteralType = "Literal"
LiteralType is the TermType literals
const NamedNodeType = "NamedNode"
NamedNodeType is the TermType for IRIs
const VariableType = "Variable"
VariableType is the TermType for variables
Variables ¶
var Default = &DefaultGraph{}
Default is the default default graph
var ErrParseTerm = errors.New("Error parsing term")
ErrParseTerm indicates that a string could not parse into a term
var ErrTermType = errors.New("Mismatching term types")
ErrTermType indicates an unexpected or mismatching term types
var RDFLangString = &NamedNode{"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"}
RDFLangString is the datatype for language-tagged literals
var XSDString = &NamedNode{"http://www.w3.org/2001/XMLSchema#string"}
XSDString is the default datatype for literals
Functions ¶
This section is empty.
Types ¶
type BlankNode ¶ added in v0.2.0
type BlankNode struct {
// contains filtered or unexported fields
}
A BlankNode is labelled blank node
func NewBlankNode ¶ added in v0.2.0
NewBlankNode creates a new blank node
func (*BlankNode) MarshalJSON ¶ added in v0.2.0
MarshalJSON marshals the blank node into a byte slice
func (*BlankNode) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON umarshals a byte slice into the blank node
type DefaultGraph ¶ added in v0.2.0
type DefaultGraph struct{}
DefaultGraph is the default graph term
func NewDefaultGraph ¶ added in v0.2.0
func NewDefaultGraph() *DefaultGraph
NewDefaultGraph creates a new default graph
func (*DefaultGraph) Equal ¶ added in v0.2.0
func (node *DefaultGraph) Equal(term Term) bool
Equal checks for functional equivalence of terms
func (*DefaultGraph) MarshalJSON ¶ added in v0.2.0
func (node *DefaultGraph) MarshalJSON() ([]byte, error)
MarshalJSON marshals the literal into a byte slice
func (*DefaultGraph) String ¶ added in v0.2.1
func (node *DefaultGraph) String() string
func (*DefaultGraph) TermType ¶ added in v0.2.0
func (node *DefaultGraph) TermType() string
TermType of a default graph is "DefaultGraph"
func (*DefaultGraph) UnmarshalJSON ¶ added in v0.2.0
func (node *DefaultGraph) UnmarshalJSON(data []byte) error
UnmarshalJSON umarshals a byte slice into the blank node
func (*DefaultGraph) Value ¶ added in v0.2.0
func (node *DefaultGraph) Value() string
Value of a DefaultGraph is the empty string
type Literal ¶ added in v0.2.0
type Literal struct {
// contains filtered or unexported fields
}
A Literal is literal term
func NewLiteral ¶ added in v0.2.0
NewLiteral creates a new literal
func (*Literal) MarshalJSON ¶ added in v0.2.0
MarshalJSON marshals the literal into a byte slice
func (*Literal) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON umarshals a byte slice into the literal
type NamedNode ¶ added in v0.2.0
type NamedNode struct {
// contains filtered or unexported fields
}
A NamedNode is an IRI term
func NewNamedNode ¶ added in v0.2.0
NewNamedNode creates a new IRI
func (*NamedNode) MarshalJSON ¶ added in v0.2.0
MarshalJSON marshals the named node into a byte slice
func (*NamedNode) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON umarshals a byte slice into the named node
type Quad ¶
type Quad [4]Term
A Quad is a 4-tuple of terms
func ReadQuads ¶ added in v0.3.3
ReadQuads parses an io.Reader of serialize n-quads into a slice of *Quads
func (*Quad) MarshalJSON ¶ added in v0.2.0
MarshalJSON marshals a quad into a byte slice
func (*Quad) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON unmarshals a byte slice into a quad
type Term ¶
type Term interface { String() string TermType() string Value() string Equal(term Term) bool MarshalJSON() ([]byte, error) UnmarshalJSON(data []byte) error }
Term is the interface that all terms satisfy
func UnmarshalTerm ¶
UnmarshalTerm unmarshals a byte slice into a Term
func UnmarshalTerms ¶ added in v0.3.1
UnmarshalTerms unmarshals a JSON array of RDFJS terms into a slice of rdf.Terms
type TermLiteral ¶ added in v0.2.0
TermLiteral is an interface for literal terms. This is only used in the Equal() method of the Literal struct. You shouldn't have to worry about this unless you're going to use external implementations of Term, in which case you need to make sure that literal terms implement this interface.
type Variable ¶ added in v0.2.0
type Variable struct {
// contains filtered or unexported fields
}
A Variable is labelled variable
func NewVariable ¶ added in v0.2.0
NewVariable creates a new variable
func (*Variable) MarshalJSON ¶ added in v0.2.0
MarshalJSON marshals the variable into a byte slice
func (*Variable) UnmarshalJSON ¶ added in v0.2.0
UnmarshalJSON umarshals a byte slice into the variable