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 (type 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. Although the Datasets themselves confer no semantic meaning on your domain model, they allow you to collect concepts (entities) of similar types together making them easier to manage. On the other hand, it is perfectly possible to build your entire knowledge graph in a single Dataset.
1. Create leaf Concept types
Start by creating the leaf nodes – those types that have no links outward to other types. In the Food domain model above, the leaf types are Occasion, Ingredient, Cuisine and Person.
2. Creating relationships
Once the leaf types are defined, you can create their related Concept types. In our example, Recipe has a chef property whose type is Person, so creating a complete Recipe type wouldn't be possible without defining Person first. Of course 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).
In Data Graphs the relationship between two types is created automatically when one type is assigned to the property of another, in this case when Person is assigned to the chef property of Recipe.
3. Define non-relational properties (primitive or datatype properties)
These are properties with standard primitive datatypes (text, date, keyword, boolean 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.