Documentation ¶
Index ¶
- func AppendTriple(subjects map[string]*LdEntry, t *Triple) error
- func GetResourceID(t Term) string
- func NewHttpClient(skip bool) *http.Client
- func RandStringBytesMask(n int) string
- type BlankNode
- type Graph
- func (g *Graph) Add(t *Triple)
- func (g *Graph) AddTriple(s Term, p Term, o Term)
- func (g *Graph) All(s Term, p Term, o Term) []*Triple
- func (g *Graph) GenerateJSONLD() ([]map[string]interface{}, error)
- func (g *Graph) IterTriples() (ch chan *Triple)
- func (g *Graph) IterTriplesOrdered() (ch chan *Triple)
- func (g *Graph) Len() int
- func (g *Graph) LoadURI(uri string) error
- func (g *Graph) Merge(toMerge *Graph)
- func (g *Graph) One(s Term, p Term, o Term) *Triple
- func (g *Graph) Parse(reader io.Reader, mime string) error
- func (g *Graph) Remove(t *Triple)
- func (g *Graph) Serialize(w io.Writer, mime string) error
- func (g *Graph) SerializeFlatJSONLD(w io.Writer) error
- func (g *Graph) String() string
- func (g *Graph) Term() Term
- func (g *Graph) URI() string
- type LdEntry
- type LdObject
- type Literal
- type Resource
- type Term
- type Triple
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendTriple ¶
AppendTriple appends a triple to a subject map
func GetResourceID ¶
func NewHttpClient ¶
NewHttpClient creates an http.Client to be used for parsing resources directly from the Web
func RandStringBytesMask ¶ added in v0.1.1
Types ¶
type BlankNode ¶
type BlankNode struct {
ID string
}
BlankNode is an RDF blank node i.e. an unqualified URI/IRI.
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
Graph structure
func (*Graph) GenerateJSONLD ¶
GenerateJSONLD creates a interface based model of the RDF Graph. This can be used to create various JSON-LD output formats, e.g. expand, flatten, compacted, etc.
func (*Graph) IterTriples ¶
IterTriples iterates through all the triples in a graph
func (*Graph) IterTriplesOrdered ¶ added in v0.1.4
IterTriples iterates through all the triples in a graph by insertion order
type LdEntry ¶
type Literal ¶
Literal is a textual value, with an associated language or datatype.
type Resource ¶
type Resource struct {
URI string
}
Resource is an URI / IRI reference.
type Term ¶
type Term interface { // Method String should return the NTriples representation of this term. String() string // Method RawValue should return the raw value of this term. RawValue() string // Method Equal should return whether this term is equal to another. Equal(Term) bool }
A Term is the value of a subject, predicate or object i.e. a IRI reference, blank node or literal.
func NewAnonNode ¶
func NewAnonNode() (term Term)
NewAnonNode returns a new blank node with a pseudo-randomly generated ID.
func NewBlankNode ¶
NewBlankNode returns a new blank node with the given ID.
func NewLiteral ¶
NewLiteral returns a new literal with the given value.
func NewLiteralWithDatatype ¶
NewLiteralWithDatatype returns a new literal with the given value and datatype.
func NewLiteralWithLanguage ¶
NewLiteralWithLanguage returns a new literal with the given value and language.
func NewResource ¶
NewResource returns a new resource object.
type Triple ¶
type Triple struct { Subject Term Predicate Term Object Term // contains filtered or unexported fields }
Triple contains a subject, a predicate and an object term.