We recommend creating and configuring a new link type with the guided helper outlined below. However, if you exit the helper before completing the object creation process, you can manually complete the process by specifying the link type, keys, and API names for the new link type.
Navigate to Ontology Manager. To access the link type creation helper, choose one of the following methods:
Select New from the top right corner, then select Link type.
In the left sidebar, select Link types under Resources. Then, select New link type in the top right corner of the Link types page.
Navigate to an object type you want to link, then select Create new link type from within the link type graph on the object type’s Overview page.
The new link type helper will guide you through the following steps:
In the first step of the Create a new link type dialog, select the relationship type for the link.
Choose the relationship type for defining links between your two objects:
In the examples below, assume that there are two object types that are related to each other through a cardinality: an Aircraft
object type and a Flight
object type. Cardinality types include:
* *One-to-one cardinality:* This indicates that one `Aircraft` should be linked to a single `Flight`. The one-to-one cardinality serves as an indicator of the intended relationship, but the one-to-one cardinality is not enforced.
* *One-to-many cardinality:* This indicates that one `Aircraft` can be linked to many `Flights`.
* *Many-to-one cardinality:* This indicates that many `Aircraft` can be linked to one `Flight`.
* *Many-to-many cardinality:* This indicates that one `Aircraft` can be linked to many `Flights`, and one `Flight` can be linked to many `Aircraft`.
3. Select Next to proceed to the next step.
In a one-to-one or many-to-one cardinality link type, you will define the foreign key property and primary key properties for the link. The foreign key property of one object type must refer to the primary key property of the other object type.
For example, the Tail Number
property is the primary key on the Aircraft
object type. The Flight Tail Number
property on the Flight
object type is the foreign key. Links will be created between Aircraft
and Flight
object types when the Tail Number
of the Aircraft
matches a Flight Tail Number
of a Flight
.
In the Link resources step, choose the object types for your link.
Select the primary key object type from the dropdown menu on the right (Aircraft
in our example).
Select the foreign key object type from the dropdown menu on the left (Flight
in our example). The creation dialog will detect and automatically select a foreign key if the following conditions are met:
Choose the properties that will form the link:
Flight Tail Number
for the Flight
object types).Tail Number
for the Aircraft
object type).Select Next to continue.
In a many-to-many cardinality, select a datasource that includes all combinations of links between the primary key of the first object type (Aircraft
in our example) and the second object type (Flight
in our example).
A many-to-many cardinality, which requires a backing datasource, is required to enable users to edit or write back to the link type.
Flight
).Aircraft
).Before creating the object-backed link, ensure that the prerequisite object and links have been created.
Aircraft
object type describes the link from Flight
to Aircraft
. You could choose the display name Assigned Aircraft
since one Flight
has one Assigned Aircraft
.Aircraft
side of the link type is assignedAircraft
, then calling Flight.assignedAircraft.get()
will return the Aircraft
objects linked to those Flight
objects.In the final step, choose a project to save this link type to. Then, Submit. After completing these steps, your new link type will be created, but not yet saved.
Back in Ontology Manager, select Save in the upper right corner to make the change to your ontology.
Object-backed link types expand on many-to-one cardinality link types, providing first class support for object types as a link type storage solution. Object-backed link types allow for the inclusion of additional metadata on the link and support restricted views.
For object-backed links, in addition to the Aircraft
and Flight
objects, assume an additional object type for the Flight Manifest
. With an object-backed link, you can have the Flight Manifest
object type that links the Aircraft
and Flight
objects. Unlike a foreign key or data-set backed link, this Flight Manifest
object can contain additional properties such as Pilot
and First Mate
to provide additional metadata on the link.
Before you can create an object-backed link type, you must first do the following:
For the Aircraft
, Flight
, and Flight Manifest
example from above, you need to create the following resources:
Aircraft
object typeFlight
object typeFlight Manifest
object typeAircraft
object type and the Flight Manifest
object typeFlight
object type and the Flight Manifest
object typeOnce these have been created, you can create the object-backed link type.
Existing links can be converted to object-backed link types. Before modifying existing links, the prerequisites for object-backed link types must be fulfilled.
To modify the link type of an existing link:
Currently, object-backed link types can be viewed in Object Explorer, Vertex, and Workshop. Select a link to view the link's backing object properties. Note that in Vertex, the link title will display the link's backing object title instead.
Phonograph2:DatasetAndBranchAlreadyRegistered
If you receive the error Phonograph2:DatasetAndBranchAlreadyRegistered
, the datasource backing the link type you are trying to save is already backing a different link type in the Ontology and cannot be used again.