Set Up an Entity Store
Extend the built-in Wolfram Knowledgebase with your own “entities”— structured, computable representations of knowledge.
Create a basic entity store
Make an entity store of pets and their birth dates:
Get Fido’s birth date:
Add your entity store to the list of searched entity stores
To make the entities in your entity store behave like built-in entities, register the entity store:
Now the entities in your entity store work just like the built-in ones:
Add entity classes to your store
You may want to define classes that your entities belong to. For example, add classes “Dogs” and “Cats” to the “Pet” entity store:
If you change an entity store, you need to unregister the old store and register the new one in its place:
Find out what classes of pets there are:
Find out what dogs there are:
Add computed properties to your store
An entity’s properties can either be specified in its property list or be computed from those properties. Add an “Age” property that is computed from a pet’s birth date:
Unregister the old store and replace it with the updated one:
Find Felix’s age:
- Properties can be grouped into classes with a "PropertyClass" entry.
Change values in your store
You can change values in an entity store by assigning to an entity property. Here is Fido’s birth date:
Change the birth date:
The birth date has been updated in the entity store:
- You do not have to re-register an entity store when you change the values of entities within it.
Add entities to your store
To add a new entity to an entity store, assign a value to one of its properties:
The new entity has been added to the entity store:
- You do not have to re-register an entity store when you add entities to it.
Add more types to your store
An entity store can have more than one type. If there is more than one, enclose the types in a list:
Unregister the old store and replace it with the updated one:
Make a map showing the location of the big oak:
Notes
- Labels can be any expressions at all, including images or graphics.