databrickslabs / databrickslabs/ontobricks
[FEATURE]: Inherit relationships through the ontology
@benoitcayladbx is already working on this.
Since Jul 1, 2026.
- Dominant language
- Python
- Stars
- 377
- Forks
- 69
- Avg merge
- 7h 42m
- Merged PRs (30d)
- 5
Description
Is there an existing issue for this?
- I have searched the existing issues
Problem Statement
When creating subclasses in the ontology, it's great that the attributes are inherited and can be added in the mappings.
Relationships don't get the same functionality - if there are relationships defined on the parent class, data cannot be mapped to the relationship for the subclass and no relationships are created in the knowledge graph for the subclass.
Proposed Solution
Either:
- Create an explicit mapping for relationships for the subclass when a parent has a defined relationship.
This could result in a combination explosion for mappings, especially for self-referencing relationships. - Load a relationship for the subclass based on the mapping from the parent class.
This would require resolving which subclass the mapping should be applied to when loading.
Area
Mapping (Manual / SparkSQL)
Additional Context
It's possible to assign a mapping for both the parent and subclass entities, and their id's don't have to be the same. This leads to some modeling considerations that might influence how inherited relationships can work:
- If the knowledge graph loads entities at parent and subclass levels and the id's are the same, should both instances be loaded into separate entities or merged together at the subclass level?
- Should the modeler define a relationship between the parent and subclass to inform they are the same, or should the equality of the instances be inferred?
- If equality is inferred, can the query endpoints and AI chat functionality deduce the equality at execution time from the ontology, or would it be better to materialize these equality relationships using inference rules?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.