Proposal: Representing reified relationships as Entity Types #277
FactEngineCommunity
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Proposal: Representing reified relationships as Entity Types
Consider this business fact:
Initially this may be modelled as a relationship among
Part,Bin, andWarehouse. The business may then need to record:The original relationship now needs to be addressed as an object in its own right. We might call that object
StockedItem.This is relationship reification: treating an instance of a relationship as an entity so that it can have its own properties, participate in other relationships, and be referenced independently.
The pattern appears in many modelling approaches:
This proposal leads with the generally applicable idea of reification. Objectification is included as secondary terminology for interoperability with modelling systems that use it.
Another example
A cinema system may begin with:
Once the showing needs a ticket price, capacity, screen, booking collection, or cancellation status, the relationship is naturally reified as
Session:In both examples, the reified relationship has two aspects:
The apparent Ossie representation gap
Ossie can already represent most of this:
StockedItemcan be anEntityType;Part,Bin, andWarehouse;StockedItem.has_quantity; andverbalizescan preserve natural-language readings.What appears to be missing is a machine-readable statement that these elements form one reification:
StockedItemrepresents the fact involvingPart,Bin, andWarehouse;StockedItem; andWithout that statement, a consumer sees an ordinary Entity Type with several relationships. It cannot reliably distinguish a reified relationship from any other Entity Type with a compound identifier.
Candidate YAML
One possible representation is an optional
objectifiesmember on the reifyingEntityType:The name
objectifiesis retained here because it describes the relationship between the Entity Type and the underlying fact.reifiesmay be more familiar across modelling communities, so the keyword itself is open for discussion.The important design point is that the additional information belongs to the Entity Type that represents the reified relationship.
How to interpret it
Each
objectifies.rolesentry identifies:PartStockedItem.partBinStockedItem.binWarehouseStockedItem.warehouseThe order is significant. The references make the correspondence explicit instead of asking consumers to infer it from names or document order.
The readings under
objectifies.verbalizesdescribe the reified relationship as a whole. Readings onStockedItem.part,StockedItem.bin, andStockedItem.warehousecontinue to describe the individual binary relationships.Why attach this to
EntityType?The reifying Entity Type is the natural home because:
This avoids introducing:
ConceptType;Part,Bin, orWarehouseas the primary owner of the reified relationship.Advantages
Accessible across modelling paradigms
The representation describes a general semantic pattern, not a feature belonging to one modelling method. It can be mapped to associative tables, junction entities, graph nodes, association classes, and objectified Fact Types.
Lossless interchange
A converter can preserve the distinction between an ordinary Entity Type with several relationships and an Entity Type that represents instances of a particular relationship. It can also reconstruct participant order, readings, and correspondence to the linking relationships.
Small conceptual addition
EntityTypeandValueTyperemain the only concept types. Existing relationships, role ordering, qualified relationship names, multiplicities, and verbalizations are reused.Existing Entity Type behaviour remains intact
StockedItemcan still have descriptions, supertypes, constraints, derivations, mappings, and ordinary relationships. Reification adds meaning without replacing its Entity Type behaviour.Explicit rather than convention-based
Consumers do not need to guess that several similarly named relationships form a reification. This reduces ambiguity and makes validation possible.
Impact on the existing ontology section
Existing documents and producers
Existing ontology documents would be unchanged.
objectifieswould be optional and absent for ordinary Entity Types. Producers that do not support reification could continue producing current Ossie YAML.Existing consumers
Consumers processing documents that do not use the new member would require no behavioural change.
Consumers of a document that does use it could support the reification fully, preserve the Entity Type and relationships while warning that the added semantics are unsupported, or retain the new data without interpreting it.
The current JSON Schema uses
additionalProperties: false. An older validator would therefore reject the new member. If adopted, the addition should be introduced through a new ontology specification version rather than described as compatible with validators for the current version.JSON Schema and validation
The structural schema change would be limited to:
EntityType;A semantic validator should also confirm that each referenced concept and relationship exists, that each relationship belongs to the reifying Entity Type, and that it links to the stated participant concept.
Ontology mappings
No new top-level mapping section appears necessary. The Entity Type and its relationships can continue using Ossie's existing object and link mappings.
One point needs community guidance: whether the relationships listed under
objectifies.rolesautomatically identify the reifying Entity Type, or whether they should also appear inidentify_by. It would be preferable to avoid two conflicting sources of truth.Physical implementations
The proposal does not prescribe storage. Implementations could map the same concept to a junction table, a table with a surrogate key, a graph node and connecting edges, an association class, an event, a document, or another suitable structure.
The purpose is to preserve the conceptual meaning across those implementations.
Alternatives considered
Using only
identify_bycan identify aStockedItembyPart,Bin, andWarehouse, but it does not say that the Entity Type represents their relationship or preserve the readings of that relationship.Inferring reification from naming conventions would be fragile and could misclassify ordinary entities with compound identifiers.
Adding a new
ConceptTypeor a separate top-level relationship-type collection would make the distinction explicit, but would have a much broader effect on the existing ontology model and its consumers.The optional Entity Type member appears to capture the missing meaning while retaining Ossie's present hierarchy.
Questions for the community
EntityTypethe appropriate home for this information?objectifiesorreifiesthe clearer keyword for the wider Ossie audience?identify_byalso be required?If this direction is useful, I would be happy to refine the syntax and contribute a focused specification change, JSON Schema update, worked example, and validation tests.
References
All reactions