weaviate.schema.properties package
Module used to manipulate schema properties.
- class weaviate.schema.properties.Property(connection: Connection)[source]
Bases:
object
Property class used to create object properties.
Initialize a Property class instance.
Parameters
- connectionweaviate.connect.Connection
Connection object to an active and running weaviate instance.
- create(schema_class_name: str, schema_property: dict) None [source]
Create a class property.
Parameters
- schema_class_namestr
The name of the class in the schema to which the property should be added.
- schema_propertydict
The property that should be added.
Examples
>>> property_age = { ... "dataType": [ ... "int" ... ], ... "description": "The Author's age", ... "name": "age" ... } >>> client.schema.property.create('Author', property_age)
Raises
- TypeError
If ‘schema_class_name’ is of wrong type.
- weaviate.exceptions.UnexpectedStatusCodeException
If weaviate reports a none OK status.
- requests.ConnectionError
If the network connection to weaviate fails.
- weaviate.SchemaValidationException
If the ‘schema_property’ is not valid.
Submodules
weaviate.schema.properties.crud_properties module
Property class definition.
- class weaviate.schema.properties.crud_properties.Property(connection: Connection)[source]
Bases:
object
Property class used to create object properties.
Initialize a Property class instance.
Parameters
- connectionweaviate.connect.Connection
Connection object to an active and running weaviate instance.
- create(schema_class_name: str, schema_property: dict) None [source]
Create a class property.
Parameters
- schema_class_namestr
The name of the class in the schema to which the property should be added.
- schema_propertydict
The property that should be added.
Examples
>>> property_age = { ... "dataType": [ ... "int" ... ], ... "description": "The Author's age", ... "name": "age" ... } >>> client.schema.property.create('Author', property_age)
Raises
- TypeError
If ‘schema_class_name’ is of wrong type.
- weaviate.exceptions.UnexpectedStatusCodeException
If weaviate reports a none OK status.
- requests.ConnectionError
If the network connection to weaviate fails.
- weaviate.SchemaValidationException
If the ‘schema_property’ is not valid.