janusgraph

package
v0.0.0-...-8832f83 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: BSD-3-Clause Imports: 34 Imported by: 0

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

View Source
const INDEX_BY_KIND = "byKind"
View Source
const INDEX_BY_KIND_AND_CLASS = "byKindAndClass"
View Source
const INDEX_BY_UUID = "byUUID"

Common indices

View Source
const INDEX_SEARCH = "search"
View Source
const KEY_EDGE_LABEL = "_key"
View Source
const KEY_PARENT_LABEL = "keyParent"
View Source
const KEY_VERTEX_LABEL = "_key"
View Source
const MaximumBatchItemsPerQuery = 50

MaximumBatchItemsPerQuery is the threshold when batches will be broken up into smaller chunks so we avoid StackOverflowExceptions in the Janus backend

View Source
const PROP_AT_CONTEXT = "atContext"
View Source
const PROP_CLASS_ID = "classId"
View Source
const PROP_CREATION_TIME_UNIX = "creationTimeUnix"
View Source
const PROP_KEY_DELETE = "keyDelete"
View Source
const PROP_KEY_EMAIL = "keyEmail"
View Source
const PROP_KEY_EXECUTE = "keyExecute"
View Source
const PROP_KEY_EXPIRES_UNIX = "keyExpiresUnix"
View Source
const PROP_KEY_IP_ORIGIN = "keyIpOrigin"
View Source
const PROP_KEY_IS_ROOT = "keyIsRoot"

Properties for keys.

View Source
const PROP_KEY_READ = "keyRead"
View Source
const PROP_KEY_TOKEN = "keyToken"
View Source
const PROP_KEY_WRITE = "keyWrite"
View Source
const PROP_KIND = "kind"
View Source
const PROP_LAST_UPDATE_TIME_UNIX = "lastUpdateTimeUnix"
View Source
const PROP_REF_EDGE_CREF = "$cref"

Properties for SingleRef/MultipleRef's

View Source
const PROP_REF_EDGE_LOCATION = "locationUrl"
View Source
const PROP_REF_EDGE_TYPE = "refType"
View Source
const PROP_REF_ID = "refId"
View Source
const PROP_UUID = "uuid"

Shared properties for thing/action classes

View Source
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) AddAction

func (j *Janusgraph) AddAction(ctx context.Context, action *models.Action, UUID strfmt.UUID) error

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) AddThing

func (j *Janusgraph) AddThing(ctx context.Context, thing *models.Thing, UUID strfmt.UUID) 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 (j *Janusgraph) DeleteAction(ctx context.Context, action *models.Action, UUID strfmt.UUID) error

func (*Janusgraph) DeleteThing

func (j *Janusgraph) DeleteThing(ctx context.Context, thing *models.Thing, UUID strfmt.UUID) error

func (*Janusgraph) DropClass

func (j *Janusgraph) DropClass(ctx context.Context, kind kind.Kind, name string) error

Drop a class from the schema.

func (*Janusgraph) DropProperty

func (j *Janusgraph) DropProperty(ctx context.Context, kind kind.Kind, className string, propName string) error

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 (j *Janusgraph) MoveToHistoryAction(ctx context.Context, action *models.Action, UUID strfmt.UUID, deleted bool) error

func (*Janusgraph) MoveToHistoryThing

func (j *Janusgraph) MoveToHistoryThing(ctx context.Context, thing *models.Thing, UUID strfmt.UUID, deleted bool) error

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 (j *Janusgraph) UpdateAction(ctx context.Context, action *models.Action, UUID strfmt.UUID) error

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 (j *Janusgraph) UpdateProperty(ctx context.Context, kind kind.Kind, className string, propName string, newName *string, newKeywords *models.SemanticSchemaKeywords) error

func (*Janusgraph) UpdatePropertyAddDataType

func (j *Janusgraph) UpdatePropertyAddDataType(ctx context.Context, kind kind.Kind, className string, propName string, newDataType string) error

func (*Janusgraph) UpdateStateInStateManager

func (j *Janusgraph) UpdateStateInStateManager(ctx context.Context)

func (*Janusgraph) UpdateThing

func (j *Janusgraph) UpdateThing(ctx context.Context, thing *models.Thing, UUID strfmt.UUID) error

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.

Jump to

Keyboard shortcuts

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