In this repo you can find a set of commonly used semantic schemas like schema.org
Within Weaviate, you can use these schema's to define things or actions.
You can find more info in the Weaviate Repo
Note: The available schemas in Weaviate are based on schema.org and cover already. In case you have a valuable schema that you want to share, feel free to issue a pull request
Weaviate knows two types of schemas:
- Thing schemas
- Action schemas
The Thing schemas are used to define actual things. The Action schemas are used to define actions. These actions will also be made available to the things. For example, to execute a command.
This repo contains examples of ready to use schemas. But you can create your own schema.
Template example:
{
"@context": "http://schema.org", // an example context
"version": "x.x.x", // semver version number of this schema (www.semver.org)
"type": "thing", // thing or action
"name": "schema.org - Thing",
"maintainer": "yourfriends@weaviate.com", // should be email
"classes": [{
"class": "Thing",
"description": "This is a Thing",
"properties": [{
"name": "owner",
"@dataType": ["Person"], // if a cross-reference it has a capital (= Class) otherwise it is a value*
"description": "Owner of the thing.",
"keywords": [{
"name": "Keyword"
"weight": 0.9
}]
}],
"keywords": [{
"name": "Keyword"
"weight": 0.9
}]
}]
}
* Notes:
- The value in the
@dataType
array should contain on of the following values: any uppercase starting word (likePerson
) being a cross-reference,string
,int
,number
,boolean
ordate
. - Every property with a certain name across all schema's should contain either a cross-reference or one of the values. For example, in this example the property
owner
in another class can only contain a data type starting with a capital (likePerson
orCompany
). - Different data types can not be combined in the array
- Weaviate validates the schemas when initializing, giving a detailed error when some of the requirements mentioned above are not met
Note: You can use the existing schemas as templates or examples
Generators are use to create custom schemas. They should be run from the ./generators dir of the repo. Like: $ cd generators && python generate_schema.org.py
. The schema.org generator generate_schema.org.py
needs one argument, the semver version of the schema you want to generate, like: python generate_schema.org.py 1.0.0
.