weaviate.schema.properties¶
Module used to manipulate schema properties.
-
class
weaviate.schema.properties.
Property
(connection: weaviate.connect.connection.Connection)¶ Bases:
object
Property class used to create object properties.
Initialize a Property class instance.
- Parameters
connection (weaviate.connect.Connection) – Connection object to an active and running weaviate instance.
-
create
(schema_class_name: str, schema_property: dict) → None¶ Create a class property.
- Parameters
schema_class_name (str) – The name of the class in the schema to which the property should be added.
schema_property (dict) – 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.