data

package
v4.13.1 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: BSD-3-Clause Imports: 13 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

API Contains all the builders required to access the weaviate data API

func New

func New(con *connection.Connection, dbVersionSupport *db.VersionSupport) *API

New {semanticKind} api group from connection

func (*API) Checker

func (data *API) Checker() *Checker

Checker get a builder to check data object existence

func (*API) Creator

func (data *API) Creator() *Creator

Creator get a builder to create a data object

func (*API) Deleter

func (data *API) Deleter() *Deleter

Deleter get a builder to delete data objects

func (*API) ObjectsGetter

func (data *API) ObjectsGetter() *ObjectsGetter

ObjectsGetter get a builder to get an Action

func (*API) ReferenceCreator

func (data *API) ReferenceCreator() *ReferenceCreator

ReferenceCreator get a builder to add references to data objects

func (*API) ReferenceDeleter

func (data *API) ReferenceDeleter() *ReferenceDeleter

ReferenceDeleter get a builder to delete references on a data object

func (*API) ReferencePayloadBuilder

func (data *API) ReferencePayloadBuilder() *ReferencePayloadBuilder

ReferencePayloadBuilder get a builder to create the payloads that reference an object

func (*API) ReferenceReplacer

func (data *API) ReferenceReplacer() *ReferenceReplacer

ReferenceReplacer get a builder to replace references on a data object

func (*API) Updater

func (data *API) Updater() *Updater

Updater get a builder to update a data object

func (*API) Validator

func (data *API) Validator() *Validator

Validator get a builder to validate a data object definition

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker builder to check data object's existence

func (*Checker) Do

func (checker *Checker) Do(ctx context.Context) (bool, error)

Do check the specified data object if it exists in weaviate

func (*Checker) WithClassName

func (checker *Checker) WithClassName(className string) *Checker

WithClassName specifies the class name of the object to be checked

func (*Checker) WithID

func (checker *Checker) WithID(id string) *Checker

WithID specifies the id of an data object to be checked

func (*Checker) WithTenant added in v4.9.0

func (c *Checker) WithTenant(tenant string) *Checker

WithTenant sets tenant, object should be checked for

type Creator

type Creator struct {
	// contains filtered or unexported fields
}

Creator builder to create a data object in weaviate

func (*Creator) Do

func (creator *Creator) Do(ctx context.Context) (*ObjectWrapper, error)

Do create the data object as specified in the builder

func (*Creator) PayloadObject

func (creator *Creator) PayloadObject() (*models.Object, error)

PayloadObject returns the data object payload which may be used in a batch request

func (*Creator) WithClassName

func (creator *Creator) WithClassName(name string) *Creator

WithClassName indicates what class the data object is associated with

func (*Creator) WithConsistencyLevel added in v4.6.2

func (creator *Creator) WithConsistencyLevel(cl string) *Creator

WithConsistencyLevel determines how many replicas must acknowledge a request before it is considered successful. Mutually exclusive with node_name param. Can be one of 'ALL', 'ONE', or 'QUORUM'.

func (*Creator) WithID

func (creator *Creator) WithID(uuid string) *Creator

WithID if specified the object will be created under this uuid weaviate will generate a uuid if this was not called or an empty string is specified.

func (*Creator) WithProperties

func (creator *Creator) WithProperties(propertySchema models.PropertySchema) *Creator

WithProperties property values of the data object

func (*Creator) WithTenant added in v4.9.0

func (c *Creator) WithTenant(tenant string) *Creator

WithTenant sets tenant, object should be created for

func (*Creator) WithVector

func (creator *Creator) WithVector(vector []float32) *Creator

func (*Creator) WithVectors added in v4.13.0

func (creator *Creator) WithVectors(vectors models.Vectors) *Creator

type Deleter

type Deleter struct {
	// contains filtered or unexported fields
}

Deleter builder to delete a data object

func (*Deleter) Do

func (deleter *Deleter) Do(ctx context.Context) error

Do delete the specified data object from weaviate

func (*Deleter) WithClassName

func (deleter *Deleter) WithClassName(className string) *Deleter

WithClassName specifies the class name of the object about to be deleted

func (*Deleter) WithConsistencyLevel added in v4.6.2

func (deleter *Deleter) WithConsistencyLevel(cl string) *Deleter

WithConsistencyLevel determines how many replicas must acknowledge a request before it is considered successful. Mutually exclusive with node_name param. Can be one of 'ALL', 'ONE', or 'QUORUM'.

func (*Deleter) WithID

func (deleter *Deleter) WithID(uuid string) *Deleter

WithID specifies the uuid of the object about to be deleted

func (*Deleter) WithTenant added in v4.9.0

func (d *Deleter) WithTenant(tenant string) *Deleter

WithTenant sets tenant, object should be deleted from

type ObjectWrapper

type ObjectWrapper struct {
	Object *models.Object
}

ObjectWrapper wrapping the result of a creation for both actions and things

type ObjectsGetter

type ObjectsGetter struct {
	// contains filtered or unexported fields
}

ObjectsGetter Builder to retrieve Things from weaviate

func (*ObjectsGetter) Do

func (getter *ObjectsGetter) Do(ctx context.Context) ([]*models.Object, error)

Do get the data object

func (*ObjectsGetter) WithAdditional

func (getter *ObjectsGetter) WithAdditional(additional string) *ObjectsGetter

WithAdditional parameters such as for example: classification, featureProjection

func (*ObjectsGetter) WithAfter added in v4.6.2

func (getter *ObjectsGetter) WithAfter(id string) *ObjectsGetter

WithAfter is part of the Cursor API. It can be used to extract all elements by specfiying the last ID from the previous "page". Cannot be combined with any other filters or search operators other than limit. Requires WithClassName() and WithLimit() to be set.

func (*ObjectsGetter) WithClassName

func (getter *ObjectsGetter) WithClassName(className string) *ObjectsGetter

WithClassName specifies the class name of the object that should be retrieved

func (*ObjectsGetter) WithConsistencyLevel

func (getter *ObjectsGetter) WithConsistencyLevel(cl string) *ObjectsGetter

WithConsistencyLevel determines how many replicas must acknowledge a request before it is considered successful. Mutually exclusive with node_name param. Can be one of 'ALL', 'ONE', or 'QUORUM'. Note that WithConsistencyLevel and WithNodeName are mutually exclusive.

func (*ObjectsGetter) WithID

func (getter *ObjectsGetter) WithID(id string) *ObjectsGetter

WithID specifies the uuid of the object that should be retrieved if omitted a set of objects matching the builder specifications will be retrieved

func (*ObjectsGetter) WithLimit

func (getter *ObjectsGetter) WithLimit(limit int) *ObjectsGetter

WithLimit of results

func (*ObjectsGetter) WithNodeName

func (getter *ObjectsGetter) WithNodeName(name string) *ObjectsGetter

WithNodeName specifies the name of the target node which should fulfill the request. Note that WithNodeName and WithConsistencyLevel are mutually exclusive.

func (*ObjectsGetter) WithOffset added in v4.7.1

func (getter *ObjectsGetter) WithOffset(offset int) *ObjectsGetter

WithOffset of results

func (*ObjectsGetter) WithTenant added in v4.9.0

func (g *ObjectsGetter) WithTenant(tenant string) *ObjectsGetter

WithTenant sets tenant, object should be fetched for

func (*ObjectsGetter) WithVector

func (getter *ObjectsGetter) WithVector() *ObjectsGetter

WithVector include the raw vector of the data object

type ReferenceCreator

type ReferenceCreator struct {
	// contains filtered or unexported fields
}

ReferenceCreator builder to add a reference to the property of a data object

func (*ReferenceCreator) Do

func (rc *ReferenceCreator) Do(ctx context.Context) error

Do add the reference specified by the set payload to the object and property specified in the builder.

func (*ReferenceCreator) WithClassName

func (rc *ReferenceCreator) WithClassName(className string) *ReferenceCreator

WithClassName specifies the class name of the object on which to add the reference

func (*ReferenceCreator) WithConsistencyLevel added in v4.6.2

func (rc *ReferenceCreator) WithConsistencyLevel(cl string) *ReferenceCreator

WithConsistencyLevel determines how many replicas must acknowledge a request before it is considered successful. Mutually exclusive with node_name param. Can be one of 'ALL', 'ONE', or 'QUORUM'.

func (*ReferenceCreator) WithID

func (rc *ReferenceCreator) WithID(uuid string) *ReferenceCreator

WithID specifies the uuid of the object on which to add the reference

func (*ReferenceCreator) WithReference

func (rc *ReferenceCreator) WithReference(referencePayload *models.SingleRef) *ReferenceCreator

WithReference specifies the data object that should be referenced by the in this object specified reference property The payload may be created using the ReferencePayloadBuilder

func (*ReferenceCreator) WithReferenceProperty

func (rc *ReferenceCreator) WithReferenceProperty(propertyName string) *ReferenceCreator

WithReferenceProperty specifies the property that should hold the reference

func (*ReferenceCreator) WithTenant added in v4.9.0

func (rc *ReferenceCreator) WithTenant(tenant string) *ReferenceCreator

WithTenant specifies tenant of referenced objects

type ReferenceDeleter

type ReferenceDeleter struct {
	// contains filtered or unexported fields
}

ReferenceDeleter builder to remove a reference from a data object

func (*ReferenceDeleter) Do

func (rd *ReferenceDeleter) Do(ctx context.Context) error

Do remove the reference defined by the payload set in this builder to the property and object defined in this builder

func (*ReferenceDeleter) WithClassName

func (rd *ReferenceDeleter) WithClassName(className string) *ReferenceDeleter

WithClassName specifies the class name of the object on which the reference will be deleted

func (*ReferenceDeleter) WithConsistencyLevel added in v4.6.2

func (rd *ReferenceDeleter) WithConsistencyLevel(cl string) *ReferenceDeleter

WithConsistencyLevel determines how many replicas must acknowledge a request before it is considered successful. Mutually exclusive with node_name param. Can be one of 'ALL', 'ONE', or 'QUORUM'.

func (*ReferenceDeleter) WithID

func (rd *ReferenceDeleter) WithID(uuid string) *ReferenceDeleter

WithID specifies the uuid of the object on which the reference will be deleted

func (*ReferenceDeleter) WithReference

func (rd *ReferenceDeleter) WithReference(referencePayload *models.SingleRef) *ReferenceDeleter

WithReference specifies reference payload of the reference about to be deleted

func (*ReferenceDeleter) WithReferenceProperty

func (rd *ReferenceDeleter) WithReferenceProperty(propertyName string) *ReferenceDeleter

WithReferenceProperty specifies the property on which the reference should be deleted

func (*ReferenceDeleter) WithTenant added in v4.9.0

func (rd *ReferenceDeleter) WithTenant(tenant string) *ReferenceDeleter

WithTenant specifies tenant of referenced objects

type ReferencePayloadBuilder

type ReferencePayloadBuilder struct {
	// contains filtered or unexported fields
}

ReferencePayloadBuilder to create a payload that references a data object. The payload may be added to a reference property in another data object.

func (*ReferencePayloadBuilder) Payload

func (rpb *ReferencePayloadBuilder) Payload() *models.SingleRef

Payload to reference the in the builder specified data object

func (*ReferencePayloadBuilder) WithClassName

func (rpb *ReferencePayloadBuilder) WithClassName(className string) *ReferencePayloadBuilder

WithClassName specifies the class name of the object to be referenced

func (*ReferencePayloadBuilder) WithID

WithID specifies the uuid of the object to be referenced

type ReferenceReplacer

type ReferenceReplacer struct {
	// contains filtered or unexported fields
}

ReferenceReplacer builder to replace reference(s) with new one(s)

func (*ReferenceReplacer) Do

func (rr *ReferenceReplacer) Do(ctx context.Context) error

Do replace the references of the in this builder specified data object

func (*ReferenceReplacer) WithClassName

func (rr *ReferenceReplacer) WithClassName(className string) *ReferenceReplacer

WithClassName specifies the class name of the object about to get its reference replaced

func (*ReferenceReplacer) WithConsistencyLevel added in v4.6.2

func (rr *ReferenceReplacer) WithConsistencyLevel(cl string) *ReferenceReplacer

WithConsistencyLevel determines how many replicas must acknowledge a request before it is considered successful. Mutually exclusive with node_name param. Can be one of 'ALL', 'ONE', or 'QUORUM'.

func (*ReferenceReplacer) WithID

func (rr *ReferenceReplacer) WithID(uuid string) *ReferenceReplacer

WithID specifies the uuid of the object about to get its reference replaced

func (*ReferenceReplacer) WithReferenceProperty

func (rr *ReferenceReplacer) WithReferenceProperty(propertyName string) *ReferenceReplacer

WithReferenceProperty specifies the property that should replace

func (*ReferenceReplacer) WithReferences

func (rr *ReferenceReplacer) WithReferences(referencePayload *models.MultipleRef) *ReferenceReplacer

WithReferences the set of references that should replace the currently existing references

func (*ReferenceReplacer) WithTenant added in v4.9.0

func (rr *ReferenceReplacer) WithTenant(tenant string) *ReferenceReplacer

WithTenant specifies tenant of referenced objects

type Updater

type Updater struct {
	// contains filtered or unexported fields
}

Updater builder to update property values in a data object

func (*Updater) Do

func (updater *Updater) Do(ctx context.Context) error

Do update the data object specified in the builder

func (*Updater) WithClassName

func (updater *Updater) WithClassName(className string) *Updater

WithClassName specifies the class of the object about to be updated

func (*Updater) WithConsistencyLevel added in v4.6.2

func (updater *Updater) WithConsistencyLevel(cl string) *Updater

WithConsistencyLevel determines how many replicas must acknowledge a request before it is considered successful. Mutually exclusive with node_name param. Can be one of 'ALL', 'ONE', or 'QUORUM'.

func (*Updater) WithID

func (updater *Updater) WithID(uuid string) *Updater

WithID specifies the uuid of the object about to be updated

func (*Updater) WithMerge

func (updater *Updater) WithMerge() *Updater

WithMerge indicates that the object should be merged with the existing object instead of replacing it

func (*Updater) WithProperties

func (updater *Updater) WithProperties(propertySchema models.PropertySchema) *Updater

WithProperties specifies the property schema of the class about to be updated

func (*Updater) WithTenant added in v4.9.0

func (u *Updater) WithTenant(tenant string) *Updater

WithTenant sets tenant, object should be updated for

func (*Updater) WithVector added in v4.11.0

func (updater *Updater) WithVector(vector []float32) *Updater

WithVector specifies the vector of the object about to be updated

func (*Updater) WithVectors added in v4.13.0

func (updater *Updater) WithVectors(vectors models.Vectors) *Updater

WithVectors specifies target vectors of the object about to be updated

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

Validator builder object to validate a class

func (*Validator) Do

func (validator *Validator) Do(ctx context.Context) error

Do validate the data object specified in the builder Will return an error if the object is not valid or if there is a different error

func (*Validator) WithClassName

func (validator *Validator) WithClassName(className string) *Validator

WithClassName specifies the class of the object about to be validated

func (*Validator) WithID

func (validator *Validator) WithID(uuid string) *Validator

WithID specifies the uuid of the object about to be validated

func (*Validator) WithProperties

func (validator *Validator) WithProperties(propertySchema models.PropertySchema) *Validator

WithProperties specifies the property schema of the class about to be validated

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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