Once defined, an interface can be implemented by any object type that conforms to the interface definition. This means that object types must contain the interface's shared properties (or local properties that map onto and satisfy the interface shared properties) and possess links that satisfy all required link type constraints defined on the interface.
Implementing an interface with an object type indicates that that object type is a concrete instance of the interface within the Ontology. This declaration facilitates additional functionality on the object type, namely:
In short, implementing an interface allows application consumers to interact with any and all implementing objects through the interface definition. This allows application code to be written using the interface as an API layer instead of requiring the application to support every implementing object type individually. Additionally, by using the interface as an application API layer, new object types can be added to the application by having them implement the application interface without requiring code changes to explicitly support the new object type.
Follow the steps below to implement an interface with an object type.
First, navigate to the object type in Ontology Manager and open the Interfaces tab. Select + Implement new interface in the top right corner of the page.
In the dialog that appears, select the interface to implement.
Alternatively, navigate to the interface overview page and select + New in the Implementations section.
Then, select the object type to implement the interface.
To implement an interface, an object type must contain the interface's shared properties or declare a mapping of existing object properties onto the interface shared properties. Shared properties that are present on both the interface and object type will be automatically mapped. Any shared properties that are not on the object type will require you to manually input a mapping to satisfy the interface definition.
If any required link type constraints are declared on the interface, you must select a link type on the object type that satisfies each required link type constraint. You can also optionally provide a link mapping for any non-required link type constraints. You can choose an existing link type or create a new one to satisfy each constraint.
Select Save to make the changes to your Ontology.
Follow the steps below to implement an interface on an object type output in Pipeline Builder.
Select the object type output that you would like to implement an interface, then select the Edit option.
Select Implement interface.
Then, select the interface to implement and choose Implement and go to mapping.
To implement an interface, an object type must contain the interface's shared properties or declare a mapping of existing object properties onto the interface shared properties. Shared properties that are present on both the interface and object type will be automatically mapped. Any shared properties that are not on the object type will require you to manually input a mapping to satisfy the interface definition.
You can view the interfaces implemented by this object type output from the output type configuration panel.
Pipeline Builder does not currently support link type constraint mapping when implementing an interface. If your interface contains required link type constrains, you must implement the interface through Ontology Manager.