Documentation ¶
Index ¶
- Constants
- func AbsoluteValue(value quad.Value, ns *voc.Namespaces) quad.Value
- func AbsoluteValues(values []quad.Value, ns *voc.Namespaces) []quad.Value
- func BuildIterator(step Step, qs graph.QuadStore, ns *voc.Namespaces) (query.Iterator, error)
- func Register(typ RegistryItem)
- func RegisteredTypes() []string
- func TypeByName(name string) (reflect.Type, bool)
- type DocumentIterator
- type EntityBNode
- type EntityIRI
- type EntityIdentifier
- type EntityIdentifierI
- type EntityIdentifierString
- type GraphPattern
- type IteratorStep
- type PathStep
- type PropertyIRI
- type PropertyIRIString
- type PropertyIRIStrings
- type PropertyIRIs
- type PropertyPath
- type PropertyPathI
- type PropertyStep
- type RegistryItem
- type Session
- type Step
- type TagsIterator
- type ValueIterator
Constants ¶
const ( // Name is the name exposed to the query interface. Name = "linkedql" // Namespace is an RDF namespace used for LinkedQL classes. Namespace = "http://cayley.io/linkedql#" // Prefix is an RDF namespace prefix used for LinkedQL classes. Prefix = "linkedql:" )
Variables ¶
This section is empty.
Functions ¶
func AbsoluteValue ¶
AbsoluteValue uses given ns to resolve short IRIs and types in typed strings to their full form
func AbsoluteValues ¶
AbsoluteValues applies AbsoluteValue on each item in provided values using provided ns
func BuildIterator ¶
BuildIterator for given Step returns a query.Iterator
func RegisteredTypes ¶
func RegisteredTypes() []string
RegisteredTypes returns type names of all registered types.
Types ¶
type DocumentIterator ¶
type DocumentIterator struct {
// contains filtered or unexported fields
}
DocumentIterator is an iterator of documents from the graph
func NewDocumentIterator ¶
func NewDocumentIterator(valueIt *ValueIterator) *DocumentIterator
NewDocumentIterator returns a new DocumentIterator for a QuadStore and Path.
func (*DocumentIterator) Close ¶
func (it *DocumentIterator) Close() error
Close implements query.Iterator.
func (*DocumentIterator) Err ¶
func (it *DocumentIterator) Err() error
Err implements query.Iterator.
func (*DocumentIterator) Next ¶
func (it *DocumentIterator) Next(ctx context.Context) bool
Next implements query.Iterator.
func (*DocumentIterator) Result ¶
func (it *DocumentIterator) Result() interface{}
Result implements query.Iterator.
type EntityBNode ¶
EntityBNode is an entity BNode.
func (EntityBNode) BuildIdentifier ¶
func (i EntityBNode) BuildIdentifier(ns *voc.Namespaces) (quad.Value, error)
BuildIdentifier implements EntityIdentifier
type EntityIRI ¶
EntityIRI is an entity IRI.
func (EntityIRI) BuildIdentifier ¶
BuildIdentifier implements EntityIdentifier
type EntityIdentifier ¶
type EntityIdentifier struct {
EntityIdentifierI
}
EntityIdentifier is a struct wrapping the interface EntityIdentifierI
func NewEntityIdentifier ¶
func NewEntityIdentifier(v EntityIdentifierI) EntityIdentifier
NewEntityIdentifier constructs a new EntityIdentifer from a EntityIdentiferI
func (*EntityIdentifier) UnmarshalJSON ¶
func (p *EntityIdentifier) UnmarshalJSON(data []byte) error
UnmarshalJSON implements RawMessage
type EntityIdentifierI ¶
type EntityIdentifierI interface {
BuildIdentifier(ns *voc.Namespaces) (quad.Value, error)
}
EntityIdentifierI is an interface to be used where a single entity identifier is expected.
type EntityIdentifierString ¶
type EntityIdentifierString string
EntityIdentifierString is an entity IRI or BNode strings.
func (EntityIdentifierString) BuildIdentifier ¶
func (i EntityIdentifierString) BuildIdentifier(ns *voc.Namespaces) (quad.Value, error)
BuildIdentifier implements EntityIdentifier
type GraphPattern ¶
type GraphPattern = map[string]interface{}
GraphPattern represents a JSON-LD document
type IteratorStep ¶
type IteratorStep interface { Step BuildIterator(qs graph.QuadStore, ns *voc.Namespaces) (query.Iterator, error) }
IteratorStep is a step that can build an Iterator.
type PathStep ¶
type PathStep interface { Step BuildPath(qs graph.QuadStore, ns *voc.Namespaces) (*path.Path, error) }
PathStep is a Step that can build a Path.
type PropertyIRI ¶
PropertyIRI is an IRI of a Property
func (PropertyIRI) BuildPath ¶
func (p PropertyIRI) BuildPath(qs graph.QuadStore, ns *voc.Namespaces) (*path.Path, error)
BuildPath implements PropertyPath
type PropertyIRIString ¶
type PropertyIRIString string
PropertyIRIString is a string of IRI of a Property
func (PropertyIRIString) BuildPath ¶
func (p PropertyIRIString) BuildPath(qs graph.QuadStore, ns *voc.Namespaces) (*path.Path, error)
BuildPath implements PropertyPath
type PropertyIRIStrings ¶
type PropertyIRIStrings []string
PropertyIRIStrings is a slice of property IRI strings.
func (PropertyIRIStrings) BuildPath ¶
func (p PropertyIRIStrings) BuildPath(qs graph.QuadStore, ns *voc.Namespaces) (*path.Path, error)
BuildPath implements PropertyPath.
func (PropertyIRIStrings) PropertyIRIs ¶
func (p PropertyIRIStrings) PropertyIRIs() PropertyIRIs
PropertyIRIs casts PropertyIRIStrings into PropertyIRIs
type PropertyIRIs ¶
type PropertyIRIs []PropertyIRI
PropertyIRIs is a slice of property IRIs.
func (PropertyIRIs) BuildPath ¶
func (p PropertyIRIs) BuildPath(qs graph.QuadStore, ns *voc.Namespaces) (*path.Path, error)
BuildPath implements PropertyPath.
type PropertyPath ¶
type PropertyPath struct {
PropertyPathI
}
PropertyPath is a struct wrapping PropertyPathI
func NewPropertyPath ¶
func NewPropertyPath(p PropertyPathI) *PropertyPath
NewPropertyPath constructs a new PropertyPath
func (*PropertyPath) Description ¶
func (*PropertyPath) Description() string
Description implements Step.
func (*PropertyPath) UnmarshalJSON ¶
func (p *PropertyPath) UnmarshalJSON(data []byte) error
UnmarshalJSON implements RawMessage
type PropertyPathI ¶
type PropertyPathI interface {
BuildPath(qs graph.QuadStore, ns *voc.Namespaces) (*path.Path, error)
}
PropertyPathI is an interface to be used where a path of properties is expected.
type PropertyStep ¶
type PropertyStep struct {
PathStep
}
PropertyStep is a step that should resolve to a path of properties
func (PropertyStep) BuildPath ¶
func (p PropertyStep) BuildPath(qs graph.QuadStore, ns *voc.Namespaces) (*path.Path, error)
BuildPath implements PropertyPath
type RegistryItem ¶
type RegistryItem interface {
Description() string
}
RegistryItem in the registry.
func Unmarshal ¶
func Unmarshal(data []byte) (RegistryItem, error)
Unmarshal attempts to unmarshal an Item or returns error.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session represents a LinkedQL query processing.
type TagsIterator ¶
type TagsIterator struct { ValueIt *ValueIterator Selected []string ExcludeID bool // contains filtered or unexported fields }
TagsIterator is a result iterator for records consisting of selected tags or all the tags in the query.
func NewTagsIterator ¶
func NewTagsIterator(valueIt *ValueIterator, selected []string, excludeID bool) TagsIterator
NewTagsIterator creates a new TagsIterator
func (*TagsIterator) Next ¶
func (it *TagsIterator) Next(ctx context.Context) bool
Next implements query.Iterator.
func (*TagsIterator) Result ¶
func (it *TagsIterator) Result() interface{}
Result implements query.Iterator.
type ValueIterator ¶
ValueIterator is an iterator of values from the graph.
func NewValueIterator ¶
func NewValueIterator(p *path.Path, namer refs.Namer) *ValueIterator
NewValueIterator returns a new ValueIterator for a path and namer.
func NewValueIteratorFromPathStep ¶
func NewValueIteratorFromPathStep(step PathStep, qs graph.QuadStore, ns *voc.Namespaces) (*ValueIterator, error)
NewValueIteratorFromPathStep attempts to build a path from PathStep and return a new ValueIterator of it. If BuildPath fails returns error.
func (*ValueIterator) Close ¶
func (it *ValueIterator) Close() error
Close implements query.Iterator.
func (*ValueIterator) Next ¶
func (it *ValueIterator) Next(ctx context.Context) bool
Next implements query.Iterator.
func (*ValueIterator) Result ¶
func (it *ValueIterator) Result() interface{}
Result implements query.Iterator.
func (*ValueIterator) Value ¶
func (it *ValueIterator) Value() quad.Value
Value returns the current value