Documentation ¶
Overview ¶
_ _
*__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
_ _
*__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
_ _
*__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
_ _
*__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
_ _
*__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
_ _
*__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
_ _
*__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
_ _
*__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
_ _
*__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
_ _
*__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
_ _
*__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. All rights reserved. * LICENSE: https://github.com/creativesoftwarefdn/weaviate/blob/develop/LICENSE.md * DESIGN & CONCEPT: Bob van Luijt (@bobvanluijt) * CONTACT: hello@creativesoftwarefdn.org
Index ¶
- func EscapeString(str string) string
- type Datum
- func (d *Datum) AssertEdge() *Edge
- func (d *Datum) AssertKey(key string) *Datum
- func (d *Datum) AssertPath() *Path
- func (d *Datum) AssertStringSlice() []string
- func (d *Datum) AssertVertex() *Vertex
- func (d *Datum) Edge() (*Edge, error)
- func (d *Datum) Key(key string) (*Datum, error)
- func (d *Datum) Path() (*Path, error)
- func (d *Datum) Type() string
- func (d *Datum) Vertex() (*Vertex, error)
- type Edge
- type Graph
- type Gremlin
- type Path
- type Property
- type PropertyValue
- func (p *PropertyValue) AssertBool() bool
- func (p *PropertyValue) AssertFloat() float64
- func (p *PropertyValue) AssertGeoCoordinates() *models.GeoCoordinates
- func (p *PropertyValue) AssertInt() int
- func (p *PropertyValue) AssertInt64() int64
- func (p *PropertyValue) AssertString() string
- func (p *PropertyValue) Bool() (bool, bool)
- func (p *PropertyValue) Float() (float64, bool)
- func (p *PropertyValue) GeoCoordinates() (*models.GeoCoordinates, error)
- func (p *PropertyValue) Int() (int, bool)
- func (p *PropertyValue) Int64() (int64, bool)
- func (p *PropertyValue) String() (string, bool)
- type Query
- func Current() *Query
- func EqBool(value bool) *Query
- func EqDate(value time.Time) *Query
- func EqFloat(value float64) *Query
- func EqInt(value int) *Query
- func EqString(value string) *Query
- func GeoWithinCircle(lat, lon, dist float32) *Query
- func GtDate(value time.Time) *Query
- func GtFloat(value float64) *Query
- func GtInt(value int) *Query
- func GteDate(value time.Time) *Query
- func GteFloat(value float64) *Query
- func GteInt(value int) *Query
- func LtDate(value time.Time) *Query
- func LtFloat(value float64) *Query
- func LtInt(value int) *Query
- func LteDate(value time.Time) *Query
- func LteFloat(value float64) *Query
- func LteInt(value int) *Query
- func NeqBool(value bool) *Query
- func NeqDate(value time.Time) *Query
- func NeqFloat(value float64) *Query
- func NeqInt(value int) *Query
- func NeqString(value string) *Query
- func New() *Query
- func RawQuery(query string) *Query
- func (q *Query) AddE(label string) *Query
- func (q *Query) AddV(label string) *Query
- func (q *Query) Aggregate(label string) *Query
- func (q *Query) And(queries ...*Query) *Query
- func (q *Query) As(names ...string) *Query
- func (q *Query) AsProjectBy(labels ...string) *Query
- func (q *Query) BoolProperty(key string, value bool) *Query
- func (q *Query) By(label string) *Query
- func (q *Query) ByQuery(subquery *Query) *Query
- func (q *Query) Cap(label string) *Query
- func (q *Query) Coalesce(query *Query) *Query
- func (q *Query) Count() *Query
- func (q *Query) CountLocal() *Query
- func (q *Query) Drop() *Query
- func (q *Query) E() *Query
- func (q *Query) Float64Property(key string, value float64) *Query
- func (q *Query) Fold() *Query
- func (q *Query) FromRef(reference string) *Query
- func (q *Query) GeoshapePointProperty(key string, lat float32, lon float32) *Query
- func (q *Query) Group() *Query
- func (q *Query) GroupCount() *Query
- func (q *Query) Has(key string, query *Query) *Query
- func (q *Query) HasBool(key string, value bool) *Query
- func (q *Query) HasLabel(label string) *Query
- func (q *Query) HasProperty(key string) *Query
- func (q *Query) HasString(key string, value string) *Query
- func (q *Query) In() *Query
- func (q *Query) InE() *Query
- func (q *Query) InEWithLabel(label string) *Query
- func (q *Query) InV() *Query
- func (q *Query) InWithLabel(label string) *Query
- func (q *Query) Int64Property(key string, value int64) *Query
- func (q *Query) Limit(limit int) *Query
- func (q *Query) Match(queries ...*Query) *Query
- func (q *Query) Max() *Query
- func (q *Query) MaxLocal() *Query
- func (q *Query) Mean() *Query
- func (q *Query) MeanLocal() *Query
- func (q *Query) Min() *Query
- func (q *Query) MinLocal() *Query
- func (q *Query) Optional(query *Query) *Query
- func (q *Query) Or(queries ...*Query) *Query
- func (q *Query) OrderLocalByValuesLimit(order string, limit int) *Query
- func (q *Query) OrderLocalByValuesSelectKeysLimit(order string, limit int) *Query
- func (q *Query) Out() *Query
- func (q *Query) OutE() *Query
- func (q *Query) OutEWithLabel(label string) *Query
- func (q *Query) OutV() *Query
- func (q *Query) OutWithLabel(label string) *Query
- func (q *Query) Path() *Query
- func (q *Query) Project(label string) *Query
- func (q *Query) Properties(names []string) *Query
- func (q *Query) Range(offset int, limit int) *Query
- func (q *Query) Raw(query string) *Query
- func (q *Query) Select(refs []string) *Query
- func (q *Query) String() string
- func (q *Query) StringProperty(key string, value string) *Query
- func (q *Query) Sum() *Query
- func (q *Query) SumLocal() *Query
- func (q *Query) ToQuery(query *Query) *Query
- func (q *Query) Unfold() *Query
- func (q *Query) Union(queries ...*Query) *Query
- func (q *Query) V() *Query
- func (q *Query) Values(propNames []string) *Query
- func (q *Query) Where(queries ...*Query) *Query
- type Response
- type Vertex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeString ¶
Escape a string so that it can be used without risk of SQL-injection like escapes. TODO gh-614: figure out other ways of doing string interpolation in Groovy and escape them.
Types ¶
type Datum ¶
type Datum struct {
Datum interface{}
}
A single piece of data returned by a Gremlin query.
func (*Datum) AssertEdge ¶
func (*Datum) AssertPath ¶
func (*Datum) AssertStringSlice ¶
func (*Datum) AssertVertex ¶
type Edge ¶
type Edge struct { Id string Label string Properties map[string]PropertyValue }
func (*Edge) AssertPropertyValue ¶
func (e *Edge) AssertPropertyValue(name string) *PropertyValue
func (*Edge) PropertyValue ¶
func (e *Edge) PropertyValue(name string) *PropertyValue
type Property ¶
type Property struct { Id string Value PropertyValue }
type PropertyValue ¶
type PropertyValue struct {
Value interface{}
}
func (*PropertyValue) AssertBool ¶
func (p *PropertyValue) AssertBool() bool
func (*PropertyValue) AssertFloat ¶
func (p *PropertyValue) AssertFloat() float64
func (*PropertyValue) AssertGeoCoordinates ¶
func (p *PropertyValue) AssertGeoCoordinates() *models.GeoCoordinates
func (*PropertyValue) AssertInt ¶
func (p *PropertyValue) AssertInt() int
func (*PropertyValue) AssertInt64 ¶
func (p *PropertyValue) AssertInt64() int64
func (*PropertyValue) AssertString ¶
func (p *PropertyValue) AssertString() string
func (*PropertyValue) Bool ¶
func (p *PropertyValue) Bool() (bool, bool)
func (*PropertyValue) Float ¶
func (p *PropertyValue) Float() (float64, bool)
func (*PropertyValue) GeoCoordinates ¶
func (p *PropertyValue) GeoCoordinates() (*models.GeoCoordinates, error)
func (*PropertyValue) Int ¶
func (p *PropertyValue) Int() (int, bool)
func (*PropertyValue) Int64 ¶
func (p *PropertyValue) Int64() (int64, bool)
func (*PropertyValue) String ¶
func (p *PropertyValue) String() (string, bool)
type Query ¶
type Query struct {
// contains filtered or unexported fields
}
A query represents the (partial) query build with the DSL
func GeoWithinCircle ¶
GeoWithinCircle returns a testing predicate such as geoWithin(Geoshape.Circle(x,y,d))
func New ¶
func New() *Query
New returns a new (empty) query. Most useful for subqueries which don't start with g.V() or g.E().
func (*Query) And ¶
And can combine 0..n queries together
If used on an existing query it will lead with a dot, e.g:
existingQuery().and(<some joined queries>)
Otherwise it will not lead with a dot, e.g.:
and(<some joined queries>)
func (*Query) As ¶
As create a reference or label
As is a special case in that it cannot lead a query in Gremlin, because it is a reserved word in Groovy. That means it's fine if it is appended to an existing query like so: existingQuery.as(), but it cannot start a query like so: as().somethingElse(). That's why there is a workaround in Germlin to start a query with as like so: __.as()
func (*Query) AsProjectBy ¶
AsProjectBy is a helper construct to wrap a result in a map, it a query like so: .as("isCapital").project("isCapital").by(select("isCapital")))
func (*Query) By ¶
By filters down previous segement, most likely used after a count, groupCount or select statement
func (*Query) ByQuery ¶
ByQuery filters down previous segement, most likely used after a group(), count(), groupCount() or select() statement. It takes a query rather than a label string
func (*Query) CountLocal ¶
CountLocal is most likely used in conjuction with an aggregation query and wrapped in a By() statement
func (*Query) GeoshapePointProperty ¶
func (*Query) GroupCount ¶
GroupCount by values. Will most likely be followed by a `By()`
func (*Query) Has ¶
Has can be used for arbitrary filtering on props
Example: Has("population", EqInt(1000))
for population == 1000
which in turn translates to Gremlin: .has("population", eq(1000))
func (*Query) HasProperty ¶
Has Property checks if a property is set, regardless of its value
func (*Query) InEWithLabel ¶
func (*Query) InWithLabel ¶
func (*Query) MaxLocal ¶
MaxLocal is most likely used in conjuction with an aggregation query and wrapped in a By() statement
func (*Query) MeanLocal ¶
MeanLocal is most likely used in conjuction with an aggregation query and wrapped in a By() statement
func (*Query) MinLocal ¶
MinLocal is most likely used in conjuction with an aggregation query and wrapped in a By() statement
func (*Query) Or ¶
Or can combine 0..n queries together
If used on an existing query it will lead with a dot, e.g:
existingQuery().or(<some joined queries>)
Otherwise it will not lead with a dot, e.g.:
or(<some joined queries>)
func (*Query) OrderLocalByValuesLimit ¶
OrderLocalByValuesLimit is a helper construct to select the most occuring items, like so if called with "decr", 3: .order(local).by(values, decr).limit(local, 3)
func (*Query) OrderLocalByValuesSelectKeysLimit ¶
OrderLocalByValuesSelectKeysLimit is a helper construct to select the most occuring items and extract the keys, like so if called with "decr", 3: .order(local).by(values, decr).select(keys).limit(local, 3)
func (*Query) OutEWithLabel ¶
func (*Query) OutWithLabel ¶
func (*Query) Project ¶
Project can be used to project a result into a map. Most likely used in combination with Select().By(), example: select("foo").by(project("bar")).
func (*Query) Properties ¶
func (*Query) SumLocal ¶
SumLocal is most likely used in conjuction with an aggregation query and wrapped in a By() statement
type Response ¶
type Response struct {
Data []Datum
}
The result of a successful Gremlin query.
func (*Response) AssertFirst ¶
func (*Response) AssertStringSlice ¶
type Vertex ¶
func (*Vertex) AssertPropertyValue ¶
func (v *Vertex) AssertPropertyValue(name string) *PropertyValue
func (*Vertex) PropertyValue ¶
func (v *Vertex) PropertyValue(name string) *PropertyValue
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
_ _ *__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate.
|
_ _ *__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. |
_ _ *__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate.
|
_ _ *__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ V V / __/ (_| |\ V /| | (_| | || __/ * \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| * * Copyright © 2016 - 2019 Weaviate. |