Understanding how Data Graphs utilises identifiers is critical to understanding how to best setup your Datasets and maintain your data.
Key points
- Every Concept (entity) in Data Graphs has an identifier
- The identifier is unique to the type of Concept, for example all Concepts of type Person must have a unique identifier within the scope of all Person Concepts in your Data Graphs project.
- For a given type, identifiers can be configured to be manual (provided by you, the user) or automatic (generated by Data Graphs).
- When you create a Concept schema in a Dataset you choose whether the IDs are manual or automatic.
- For manually provided identifiers, you can choose to use the generic "id" property (that is present for all Concepts) or use a custom property of the Concept that you choose to be the identifier.
URNs
Internally Data Graphs uses URNs to namespace identifiers by Concept type. A URN is like a URI but is not web resolvable. The URN pattern used in Data Graphs is urn:{project}:{type}:{id}
for example urn:test:Person:1a2b3c4d
. You will see these URNs when viewing Concept data.
In most circumstances you need not worry about using URNs, especially in the Data Graphs app or when importing data – you can just use the identifier on the end part of the URN. But if you are using the API to query data, the URNs are important as they provide the true identity of each concept.
Manual identifiers
If you choose manual identifiers when configuring a Concept type, you will need to provide a unique ID for every Concept of that type you create, either within the user interface or when using the API.
Why might you choose manual IDs? A good example is when you might be importing some external data that already has unique IDs. Or there might be a particular ID pattern you need to use, e.g., the 2 or 3 character ISO-3166 codes for identifying countries: