If your data has more complex relationships than simple lists or collections, it is useful to design a domain model as it will help your define your Datasets.
Designing a domain model
You can create a domain model on paper or with a drawing tool such as LucidChart, Visio or OmniGraffle. It should define all your Concepts (types/classes) and the relationships between them (their properties).
In the following Food domain model, the blue ovals represent your Concept types and the arrows the relationships between them; their properties. The white rectangle signifies a primitive datatype. So a Recipe, for example, has a chef property of type Person, a forDish property (Dish) and a steps property (Text - a primitive datatype).
Build your datasets
With a well defined domain model you are in a position to create your Concept types and their relationships. You can do this in one or more Datasets depending on how you prefer to organise and manage your data. While the Datasets themselves confer no semantic meaning on your domain model, they do allow you to collect concepts (entities) of similar types together which might make it easier for to manage them. Of course, you could build your entire knowledge graph in a single Dataset.
1. Create leaf concept types
Start by creating those types that have no links outward to other types (the leaf nodes). In the Food domain model above, these are Occasion, Ingredient, Cuisine and Person. Then create the concept types that have relationships to other types (that you have already created).
2. Creating relationships
Relationships are automatically created when you define a type that has another type as a property. In our example, Recipe has a chef property whose type is Person. This is why creating the Person type before the Recipe type makes sense. You can still come back and edit a type later to add a property if you did not create the dependant type first (the Person in this example).
3. Define non-relational properties (primitive or datatype properties)
These are properties with standard primitive datatypes (text, dates, keywords, booleans etc). You can find definitions of these primitives here. In this case, the steps property is of type Text.
4. Review the domain
Once you have created all your types and their properties, you can see a visualisation of the domain model in Data Graphs here in the app and check to see if it aligns with your own domain model.
5. Import your data
You can import your data in 3 ways:
- Create Concepts manually from the Add New Concepts page using the Data Graphs UI
- Upload CSVs from the Import Data page in a Dataset
- Create Concepts via the Data Graphs API - either individually or in bulk.
For more information see Importing data.