feat: Add support for ObjectHasValue constraints in OWL import engine #173
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add support for ObjectHasValue constraints in OWL import engine
Summary
This PR adds support for
ObjectHasValue
constraints in the OWL import engine, which was previously missing and causing conversion errors.Problem
When converting OWL ontologies that contain
ObjectHasValue
constraints (e.g.,SubClassOf(:SomeClass ObjectHasValue(:hasState :SomeState))
), the schema-automator would log errors like:This resulted in loss of important semantic constraints during OWL-to-LinkML conversion.
Solution
Added support for
ObjectHasValue
constraints by:elif isinstance(a.superClassExpression, ObjectHasValue)
branch in the SubClassOf processing logicslot_usage.equals_string
pattern, similar to existingDataHasValue
handlingTechnical Details
The implementation follows the same pattern as the existing
DataHasValue
handler:Before/After Comparison
Before (with errors):
After (constraints preserved):
Testing
tests/test_importers/test_owl_object_has_value.py
slot_usage.equals_string
Impact
This enhancement makes schema-automator more robust for converting complex OWL ontologies that use ObjectHasValue constraints, which are common in scientific domain ontologies.