Documentation ¶
Index ¶
- Constants
- Variables
- func IsNull(it graph.Iterator) bool
- func IsNull2(it graph.IteratorShape) bool
- func NewComparison(sub graph.Iterator, op Operator, val quad.Value, qs graph.Namer) graph.Iterator
- func NewRegex(sub graph.Iterator, re *regexp.Regexp, qs graph.Namer) graph.Iterator
- func NewRegexWithRefs(sub graph.Iterator, re *regexp.Regexp, qs graph.Namer) graph.Iterator
- func OutputQueryShapeForIterator(it graph.Iterator, qs graph.Namer, outputMap map[string]interface{})
- func RunFloatOp(a quad.Float, op Operator, b quad.Float) bool
- func RunIntOp(a quad.Int, op Operator, b quad.Int) bool
- func RunStrOp(a string, op Operator, b string) bool
- func RunTimeOp(a time.Time, op Operator, b time.Time) bool
- func Tag(it graph.Iterator, tag string) graph.Iterator
- func TagShape(it graph.IteratorShape, tag string) graph.IteratorShape
- type And
- type Count
- type Error
- func (it *Error) Close() error
- func (it *Error) Contains(ctx context.Context, v graph.Ref) bool
- func (it *Error) Err() error
- func (it *Error) Next(ctx context.Context) bool
- func (it *Error) NextPath(ctx context.Context) bool
- func (it *Error) Optimize() (graph.Iterator, bool)
- func (it *Error) Reset()
- func (it *Error) Result() graph.Ref
- func (it *Error) Size() (int64, bool)
- func (it *Error) Stats() graph.IteratorStats
- func (it *Error) String() string
- func (it *Error) SubIterators() []graph.Iterator
- func (it *Error) TagResults(dst map[string]graph.Ref)
- type Fixed
- type HasA
- type Int64Node
- type Limit
- type Link
- type LinksTo
- type Materialize
- type Morphism
- type Morphism2
- type Node
- type Not
- type Null
- func (it *Null) Close() error
- func (it *Null) Contains(ctx context.Context, v graph.Ref) bool
- func (it *Null) Err() error
- func (it *Null) Next(ctx context.Context) bool
- func (it *Null) NextPath(ctx context.Context) bool
- func (it *Null) Optimize() (graph.Iterator, bool)
- func (it *Null) Reset()
- func (it *Null) Result() graph.Ref
- func (it *Null) Size() (int64, bool)
- func (it *Null) Stats() graph.IteratorStats
- func (it *Null) String() string
- func (it *Null) SubIterators() []graph.Iterator
- func (it *Null) TagResults(dst map[string]graph.Ref)
- type Operator
- type Or
- type Recursive
- type Resolver
- type Save
- type Skip
- type Sort
- type Unique
- type ValueFilter
- type ValueFilterFunc
Constants ¶
const MaterializeLimit = 1000
Variables ¶
var DefaultMaxRecursiveSteps = 50
Functions ¶
func IsNull2 ¶ added in v0.7.6
func IsNull2(it graph.IteratorShape) bool
func NewComparison ¶
func NewRegex ¶ added in v0.6.0
NewRegex returns an unary operator -- a filter across the values in the relevant subiterator. It works similarly to gremlin's filter{it.matches('exp')}, reducing the iterator set to values whose string representation passes a regular expression test.
func NewRegexWithRefs ¶ added in v0.7.6
NewRegexWithRefs is like NewRegex but allows regexp iterator to match IRIs and BNodes.
Consider using it carefully. In most cases it's better to reconsider your graph structure instead of relying on slow unoptimizable regexp.
An example of incorrect usage is to match IRIs:
<http://example.org/page> <http://example.org/page/foo>
Via regexp like:
http://example.org/page.*
The right way is to explicitly link graph nodes and query them by this relation:
<http://example.org/page/foo> <type> <http://example.org/page>
func TagShape ¶ added in v0.7.6
func TagShape(it graph.IteratorShape, tag string) graph.IteratorShape
Types ¶
type And ¶
The And iterator. Consists of a number of subiterators, the primary of which will be Next()ed if next is called.
func NewAnd ¶
NewAnd creates an And iterator. `qs` is only required when needing a handle for QuadStore-specific optimizations, otherwise nil is acceptable.
func (*And) AddOptionalIterator ¶ added in v0.7.6
AddOptionalIterator adds an iterator that will only be Contain'ed and will not affect iteration results. Only tags will be propagated from this iterator.
func (*And) AddSubIterator ¶
Add a subiterator to this And iterator.
The first iterator that is added becomes the primary iterator. This is important. Calling Optimize() is the way to change the order based on subiterator statistics. Without Optimize(), the order added is the order used.
func (*And) AsShape ¶ added in v0.7.6
func (it *And) AsShape() graph.IteratorShape
type Count ¶ added in v0.6.0
Count iterator returns one element with size of underlying iterator.
func NewCount ¶ added in v0.6.0
NewCount creates a new iterator to count a number of results from a provided subiterator. qs may be nil - it's used to check if count Contains (is) a given value.
func (*Count) AsShape ¶ added in v0.7.6
func (it *Count) AsShape() graph.IteratorShape
type Error ¶ added in v0.7.0
type Error struct {
// contains filtered or unexported fields
}
Error iterator always returns a single error with no other results.
func (*Error) Stats ¶ added in v0.7.0
func (it *Error) Stats() graph.IteratorStats
func (*Error) SubIterators ¶ added in v0.7.0
type Fixed ¶
A Fixed iterator consists of it's values, an index (where it is in the process of Next()ing) and an equality function.
func (*Fixed) Add ¶
Add a value to the iterator. The array now contains this value. TODO(barakmich): This ought to be a set someday, disallowing repeated values.
func (*Fixed) AsShape ¶ added in v0.7.6
func (it *Fixed) AsShape() graph.IteratorShape
type HasA ¶
A HasA consists of a reference back to the graph.QuadStore that it references, a primary subiterator, a direction in which the quads for that subiterator point, and a temporary holder for the iterator generated on Contains().
func NewHasA ¶
Construct a new HasA iterator, given the quad subiterator, and the quad direction for which it stands.
func (*HasA) AsShape ¶ added in v0.7.6
func (it *HasA) AsShape() graph.IteratorShape
type Limit ¶ added in v0.6.0
Limit iterator will stop iterating if certain a number of values were encountered. Zero and negative limit values means no limit.
func (*Limit) AsShape ¶ added in v0.7.6
func (it *Limit) AsShape() graph.IteratorShape
type LinksTo ¶
A LinksTo has a reference back to the graph.QuadStore (to create the iterators for each node) the subiterator, and the direction the iterator comes from. `next_it` is the tempoarary iterator held per result in `primary_it`.
func NewLinksTo ¶
Construct a new LinksTo iterator around a direction and a subiterator of nodes.
func (*LinksTo) AsShape ¶ added in v0.7.6
func (it *LinksTo) AsShape() graph.IteratorShape
type Materialize ¶ added in v0.4.0
func NewMaterialize ¶ added in v0.4.0
func NewMaterialize(sub graph.Iterator) *Materialize
func NewMaterializeWithSize ¶ added in v0.7.0
func NewMaterializeWithSize(sub graph.Iterator, size int64) *Materialize
func (*Materialize) AsShape ¶ added in v0.7.6
func (it *Materialize) AsShape() graph.IteratorShape
type Morphism2 ¶ added in v0.7.6
type Morphism2 func(graph.IteratorShape) graph.IteratorShape
type Not ¶ added in v0.4.1
Not iterator acts like a complement for the primary iterator. It will return all the vertices which are not part of the primary iterator.
func (*Not) AsShape ¶ added in v0.7.6
func (it *Not) AsShape() graph.IteratorShape
type Null ¶
type Null struct{}
Here we define the simplest iterator -- the Null iterator. It contains nothing. It is the empty set. Often times, queries that contain one of these match nothing, so it's important to give it a special iterator.
func (*Null) Optimize ¶
A good iterator will close itself when it returns true. Null has nothing it needs to do.
func (*Null) Stats ¶
func (it *Null) Stats() graph.IteratorStats
A null iterator costs nothing. Use it!
func (*Null) SubIterators ¶
type Or ¶
func NewShortCircuitOr ¶
func (*Or) AddSubIterator ¶
Add a subiterator to this Or graph.iterator. Order matters.
func (*Or) AsShape ¶ added in v0.7.6
func (it *Or) AsShape() graph.IteratorShape
type Recursive ¶ added in v0.6.1
Recursive iterator takes a base iterator and a morphism to be applied recursively, for each result.
func NewRecursive ¶ added in v0.6.1
func (*Recursive) AddDepthTag ¶ added in v0.6.1
func (*Recursive) AsShape ¶ added in v0.7.6
func (it *Recursive) AsShape() graph.IteratorShape
type Resolver ¶ added in v0.7.5
A Resolver iterator consists of it's order, an index (where it is in the, process of iterating) and a store to resolve values from.
func NewResolver ¶ added in v0.7.5
Creates a new Resolver iterator.
func (*Resolver) AsShape ¶ added in v0.7.6
func (it *Resolver) AsShape() graph.IteratorShape
type Save ¶ added in v0.7.6
func (*Save) AsShape ¶ added in v0.7.6
func (it *Save) AsShape() graph.IteratorShape
func (*Save) CopyFromTagger ¶ added in v0.7.6
func (it *Save) CopyFromTagger(st graph.TaggerBase)
type Skip ¶ added in v0.6.0
Skip iterator will skip certain number of values from primary iterator.
func (*Skip) AsShape ¶ added in v0.7.6
func (it *Skip) AsShape() graph.IteratorShape
type Sort ¶ added in v0.7.6
Sort iterator orders values from it's subiterator.
func NewSort ¶ added in v0.7.6
NewSort creates a new Sort iterator. TODO(dennwc): This iterator must not be used inside And: it may be moved to a Contains branch and won't do anything.
We should make And/Intersect account for this.
func (*Sort) AsShape ¶ added in v0.7.6
func (it *Sort) AsShape() graph.IteratorShape
AsShape returns Sort's underlying iterator shape
type Unique ¶ added in v0.5.0
Unique iterator removes duplicate values from it's subiterator.
func (*Unique) AsShape ¶ added in v0.7.6
func (it *Unique) AsShape() graph.IteratorShape
type ValueFilter ¶ added in v0.7.6
func NewValueFilter ¶ added in v0.7.6
func NewValueFilter(qs graph.Namer, sub graph.Iterator, filter ValueFilterFunc) *ValueFilter
func (*ValueFilter) AsShape ¶ added in v0.7.6
func (it *ValueFilter) AsShape() graph.IteratorShape