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
Index ¶
- Constants
- func New(config interface{}) (error, dbconnector.DatabaseConnector)
- type Config
- type Janusgraph
- func (j *Janusgraph) AddAction(ctx context.Context, action *models.Action, UUID strfmt.UUID) error
- func (j *Janusgraph) AddActionsBatch(ctx context.Context, actions batchmodels.Actions) error
- func (j *Janusgraph) AddClass(ctx context.Context, kind kind.Kind, class *models.SemanticSchemaClass) error
- func (j *Janusgraph) AddProperty(ctx context.Context, kind kind.Kind, className string, ...) error
- func (j *Janusgraph) AddThing(ctx context.Context, thing *models.Thing, UUID strfmt.UUID) error
- func (j *Janusgraph) AddThingsBatch(ctx context.Context, things batchmodels.Things) error
- func (j *Janusgraph) AddUnindexedProperty(ctx context.Context, kind kind.Kind, className string, ...) error
- func (f *Janusgraph) Connect() error
- func (j *Janusgraph) DeleteAction(ctx context.Context, action *models.Action, UUID strfmt.UUID) error
- func (j *Janusgraph) DeleteThing(ctx context.Context, thing *models.Thing, UUID strfmt.UUID) error
- func (j *Janusgraph) DropClass(ctx context.Context, kind kind.Kind, name string) error
- func (j *Janusgraph) DropProperty(ctx context.Context, kind kind.Kind, className string, propName string) error
- func (j *Janusgraph) GetAction(ctx context.Context, UUID strfmt.UUID, ...) error
- func (j *Janusgraph) GetActions(ctx context.Context, UUIDs []strfmt.UUID, response *models.ActionsListResponse) error
- func (j *Janusgraph) GetThing(ctx context.Context, UUID strfmt.UUID, thingResponse *models.ThingGetResponse) error
- func (j *Janusgraph) GetThings(ctx context.Context, UUIDs []strfmt.UUID, response *models.ThingsListResponse) error
- func (j *Janusgraph) HistoryAction(ctx context.Context, UUID strfmt.UUID, history *models.ActionHistory) error
- func (j *Janusgraph) HistoryThing(ctx context.Context, UUID strfmt.UUID, history *models.ThingHistory) error
- func (f *Janusgraph) Init(ctx context.Context) error
- func (j *Janusgraph) ListActions(ctx context.Context, first int, offset int, wheres []*connutils.WhereQuery, ...) error
- func (j *Janusgraph) ListThings(ctx context.Context, first int, offset int, wheres []*connutils.WhereQuery, ...) error
- func (j *Janusgraph) LocalAggregate(params *graphql_aggregate.Params) (interface{}, error)
- func (j *Janusgraph) LocalFetchKindClass(params *graphqlfetch.Params) (interface{}, error)
- func (j *Janusgraph) LocalGetClass(params *get.Params) (interface{}, error)
- func (j *Janusgraph) LocalGetMeta(params *getmeta.Params) (interface{}, error)
- func (j *Janusgraph) MoveToHistoryAction(ctx context.Context, action *models.Action, UUID strfmt.UUID, deleted bool) error
- func (j *Janusgraph) MoveToHistoryThing(ctx context.Context, thing *models.Thing, UUID strfmt.UUID, deleted bool) error
- func (f *Janusgraph) SetMessaging(m *messages.Messaging)
- func (f *Janusgraph) SetSchema(schemaInput schema.Schema)
- func (f *Janusgraph) SetServerAddress(addr string)
- func (j *Janusgraph) SetState(ctx context.Context, state json.RawMessage)
- func (j *Janusgraph) SetStateManager(manager connector_state.StateManager)
- func (j *Janusgraph) UpdateAction(ctx context.Context, action *models.Action, UUID strfmt.UUID) error
- func (j *Janusgraph) UpdateClass(ctx context.Context, kind kind.Kind, className string, newClassName *string, ...) error
- func (j *Janusgraph) UpdateProperty(ctx context.Context, kind kind.Kind, className string, propName string, ...) error
- func (j *Janusgraph) UpdatePropertyAddDataType(ctx context.Context, kind kind.Kind, className string, propName string, ...) error
- func (j *Janusgraph) UpdateStateInStateManager(ctx context.Context)
- func (j *Janusgraph) UpdateThing(ctx context.Context, thing *models.Thing, UUID strfmt.UUID) error
Constants ¶
const INDEX_BY_KIND = "byKind"
const INDEX_BY_KIND_AND_CLASS = "byKindAndClass"
const INDEX_BY_UUID = "byUUID"
Common indices
const INDEX_SEARCH = "search"
const KEY_EDGE_LABEL = "_key"
const KEY_PARENT_LABEL = "keyParent"
const KEY_VERTEX_LABEL = "_key"
const MaximumBatchItemsPerQuery = 50
MaximumBatchItemsPerQuery is the threshold when batches will be broken up into smaller chunks so we avoid StackOverflowExceptions in the Janus backend
const PROP_AT_CONTEXT = "atContext"
const PROP_CLASS_ID = "classId"
const PROP_CREATION_TIME_UNIX = "creationTimeUnix"
const PROP_KEY_DELETE = "keyDelete"
const PROP_KEY_EMAIL = "keyEmail"
const PROP_KEY_EXECUTE = "keyExecute"
const PROP_KEY_EXPIRES_UNIX = "keyExpiresUnix"
const PROP_KEY_IP_ORIGIN = "keyIpOrigin"
const PROP_KEY_IS_ROOT = "keyIsRoot"
Properties for keys.
const PROP_KEY_READ = "keyRead"
const PROP_KEY_TOKEN = "keyToken"
const PROP_KEY_WRITE = "keyWrite"
const PROP_KIND = "kind"
const PROP_LAST_UPDATE_TIME_UNIX = "lastUpdateTimeUnix"
const PROP_REF_EDGE_CREF = "$cref"
Properties for SingleRef/MultipleRef's
const PROP_REF_EDGE_LOCATION = "locationUrl"
const PROP_REF_EDGE_TYPE = "refType"
const PROP_REF_ID = "refId"
const PROP_UUID = "uuid"
Shared properties for thing/action classes
const SCHEMA_VERSION = 1
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(config interface{}) (error, dbconnector.DatabaseConnector)
Types ¶
type Config ¶
type Config struct {
Url string
}
Config represents the config outline for Janusgraph. The Database config shoud be of the following form:
"database_config" : { "Url": "http://127.0.0.1:8182" }
Notice that the port is the GRPC-port.
type Janusgraph ¶
type Janusgraph struct {
// contains filtered or unexported fields
}
Janusgraph has some basic variables. This is mandatory, only change it if you need aditional, global variables
func (*Janusgraph) AddActionsBatch ¶
func (j *Janusgraph) AddActionsBatch(ctx context.Context, actions batchmodels.Actions) error
func (*Janusgraph) AddClass ¶
func (j *Janusgraph) AddClass(ctx context.Context, kind kind.Kind, class *models.SemanticSchemaClass) error
Add a class to the Thing or Action schema, depending on the kind parameter.
func (*Janusgraph) AddProperty ¶
func (j *Janusgraph) AddProperty(ctx context.Context, kind kind.Kind, className string, prop *models.SemanticSchemaClassProperty) error
func (*Janusgraph) AddThingsBatch ¶
func (j *Janusgraph) AddThingsBatch(ctx context.Context, things batchmodels.Things) error
func (*Janusgraph) AddUnindexedProperty ¶
func (j *Janusgraph) AddUnindexedProperty(ctx context.Context, kind kind.Kind, className string, prop *models.SemanticSchemaClassProperty) error
func (*Janusgraph) Connect ¶
func (f *Janusgraph) Connect() error
Connect connects to the Janusgraph websocket
func (*Janusgraph) DeleteAction ¶
func (*Janusgraph) DeleteThing ¶
func (*Janusgraph) DropProperty ¶
func (*Janusgraph) GetAction ¶
func (j *Janusgraph) GetAction(ctx context.Context, UUID strfmt.UUID, actionResponse *models.ActionGetResponse) error
func (*Janusgraph) GetActions ¶
func (j *Janusgraph) GetActions(ctx context.Context, UUIDs []strfmt.UUID, response *models.ActionsListResponse) error
func (*Janusgraph) GetThing ¶
func (j *Janusgraph) GetThing(ctx context.Context, UUID strfmt.UUID, thingResponse *models.ThingGetResponse) error
func (*Janusgraph) GetThings ¶
func (j *Janusgraph) GetThings(ctx context.Context, UUIDs []strfmt.UUID, response *models.ThingsListResponse) error
func (*Janusgraph) HistoryAction ¶
func (j *Janusgraph) HistoryAction(ctx context.Context, UUID strfmt.UUID, history *models.ActionHistory) error
func (*Janusgraph) HistoryThing ¶
func (j *Janusgraph) HistoryThing(ctx context.Context, UUID strfmt.UUID, history *models.ThingHistory) error
func (*Janusgraph) Init ¶
func (f *Janusgraph) Init(ctx context.Context) error
Init 1st initializes the schema in the database and 2nd creates a root key.
func (*Janusgraph) ListActions ¶
func (j *Janusgraph) ListActions(ctx context.Context, first int, offset int, wheres []*connutils.WhereQuery, response *models.ActionsListResponse) error
func (*Janusgraph) ListThings ¶
func (j *Janusgraph) ListThings(ctx context.Context, first int, offset int, wheres []*connutils.WhereQuery, response *models.ThingsListResponse) error
func (*Janusgraph) LocalAggregate ¶
func (j *Janusgraph) LocalAggregate(params *graphql_aggregate.Params) (interface{}, error)
LocalAggregate based on GraphQL Query params
func (*Janusgraph) LocalFetchKindClass ¶
func (j *Janusgraph) LocalFetchKindClass(params *graphqlfetch.Params) (interface{}, error)
LocalFetchKindClass based on GraphQL Query params
func (*Janusgraph) LocalGetClass ¶
func (j *Janusgraph) LocalGetClass(params *get.Params) (interface{}, error)
Implement the Local->Get->KIND->CLASS lookup.
func (*Janusgraph) LocalGetMeta ¶
func (j *Janusgraph) LocalGetMeta(params *getmeta.Params) (interface{}, error)
LocalGetMeta based on GraphQL Query params
func (*Janusgraph) MoveToHistoryAction ¶
func (*Janusgraph) MoveToHistoryThing ¶
func (*Janusgraph) SetMessaging ¶
func (f *Janusgraph) SetMessaging(m *messages.Messaging)
SetMessaging is used to send messages to the service. Available message types are: f.messaging.Infomessage ...DebugMessage ...ErrorMessage ...ExitError (also exits the service) ...InfoMessage
func (*Janusgraph) SetSchema ¶
func (f *Janusgraph) SetSchema(schemaInput schema.Schema)
SetSchema takes actionSchema and thingsSchema as an input and makes them available globally at f.schema
func (*Janusgraph) SetServerAddress ¶
func (f *Janusgraph) SetServerAddress(addr string)
SetServerAddress is used to fill in a global variable with the server address, but can also be used to do some custom actions. Does not return anything
func (*Janusgraph) SetState ¶
func (j *Janusgraph) SetState(ctx context.Context, state json.RawMessage)
Called by a connector when it has updated it's internal state that needs to be shared across all connectors in other Weaviate instances.
func (*Janusgraph) SetStateManager ¶
func (j *Janusgraph) SetStateManager(manager connector_state.StateManager)
Link a connector to this state manager. When the internal state of some connector is updated, this state connector will call SetState on the provided conn.
func (*Janusgraph) UpdateAction ¶
func (*Janusgraph) UpdateClass ¶
func (j *Janusgraph) UpdateClass(ctx context.Context, kind kind.Kind, className string, newClassName *string, newKeywords *models.SemanticSchemaKeywords) error
func (*Janusgraph) UpdateProperty ¶
func (*Janusgraph) UpdatePropertyAddDataType ¶
func (*Janusgraph) UpdateStateInStateManager ¶
func (j *Janusgraph) UpdateStateInStateManager(ctx context.Context)
func (*Janusgraph) UpdateThing ¶
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. |
_ _ *__ _____ __ ___ ___ __ _| |_ ___ *\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ * \ 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. |