rdf

package
v0.0.0-...-d535130 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UP direction = iota
	DOWN
)

Variables

View Source
var (
	ExtraLiteral   *literal.Literal
	MissingLiteral *literal.Literal
)
View Source
var (
	ParentOfPredicate  *predicate.Predicate
	AppliesOnPredicate *predicate.Predicate
	HasTypePredicate   *predicate.Predicate
	DiffPredicate      *predicate.Predicate
	PropertyPredicate  *predicate.Predicate
	MetaPredicate      *predicate.Predicate
)

Functions

func NewTripleFromStrings

func NewTripleFromStrings(sub *node.Node, pred string, obj string) (*triple.Triple, error)

Types

type Diff

type Diff struct {
	// contains filtered or unexported fields
}

func NewDiff

func NewDiff(fromG, toG *Graph) *Diff

func (*Diff) FromGraph

func (d *Diff) FromGraph() *Graph

func (*Diff) HasDiff

func (d *Diff) HasDiff() bool

func (*Diff) MergedGraph

func (d *Diff) MergedGraph() *Graph

func (*Diff) ToGraph

func (d *Diff) ToGraph() *Graph

type Differ

type Differ interface {
	Run(*node.Node, *Graph, *Graph) (*Diff, error)
}
var DefaultDiffer Differ

type Graph

type Graph struct {
	storage.Graph
	// contains filtered or unexported fields
}

func NewGraph

func NewGraph() *Graph

func NewGraphFromFile

func NewGraphFromFile(filepath string) (*Graph, error)

func NewGraphFromTriples

func NewGraphFromTriples(triples []*triple.Triple) *Graph

func (*Graph) Add

func (g *Graph) Add(triples ...*triple.Triple)

func (*Graph) AddGraph

func (g *Graph) AddGraph(graph *Graph)

func (*Graph) CountTriplesForSubjectAndPredicate

func (g *Graph) CountTriplesForSubjectAndPredicate(subject *node.Node, predicate *predicate.Predicate) (int, error)

func (*Graph) CountTriplesForSubjectAndPredicateObjectOfType

func (g *Graph) CountTriplesForSubjectAndPredicateObjectOfType(subject *node.Node, predicate *predicate.Predicate, objectType string) (int, error)

func (*Graph) HasTriple

func (g *Graph) HasTriple(t *triple.Triple) bool

func (*Graph) IsEmpty

func (g *Graph) IsEmpty() bool

func (*Graph) ListAttachedFrom

func (g *Graph) ListAttachedFrom(n *node.Node, pred *predicate.Predicate) ([]*node.Node, error)

func (*Graph) ListAttachedTo

func (g *Graph) ListAttachedTo(n *node.Node, pred *predicate.Predicate) ([]*node.Node, error)

func (*Graph) Marshal

func (g *Graph) Marshal() ([]byte, error)

func (*Graph) MustMarshal

func (g *Graph) MustMarshal() string

func (*Graph) NodesForType

func (g *Graph) NodesForType(t string) ([]*node.Node, error)

func (*Graph) TriplesForGivenPredicate

func (g *Graph) TriplesForGivenPredicate(pred *predicate.Predicate) ([]*triple.Triple, error)

func (*Graph) TriplesForPredicateObject

func (g *Graph) TriplesForPredicateObject(predicate *predicate.Predicate, object *triple.Object) ([]*triple.Triple, error)

func (*Graph) TriplesForSubjectPredicate

func (g *Graph) TriplesForSubjectPredicate(subject *node.Node, predicate *predicate.Predicate) ([]*triple.Triple, error)

func (*Graph) TriplesForType

func (g *Graph) TriplesForType(t string) ([]*triple.Triple, error)

func (*Graph) Unmarshal

func (g *Graph) Unmarshal(data []byte) error

func (*Graph) VisitBottomUp

func (g *Graph) VisitBottomUp(startNode *node.Node, each func(*Graph, *node.Node, int) error, distances ...int) error

func (*Graph) VisitSiblings

func (g *Graph) VisitSiblings(start *node.Node, each func(*Graph, *node.Node, int) error, distances ...int) error

func (*Graph) VisitTopDown

func (g *Graph) VisitTopDown(root *node.Node, each func(*Graph, *node.Node, int) error, distances ...int) error

type QueryType

type QueryType int
const (
	SUBJECT_PREDICATE QueryType = iota
	PREDICATE_OBJECT
	PREDICATE_ONLY
)

Jump to

Keyboard shortcuts

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