`test_text_fields` validator ignores `dataProperties` and `annotationProperties`
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
Research direction
Start in validator.py at dosdp.validator.test_text_fields and inspect how owl_entities is built from the pattern dictionaries. Confirm the validator's handling of the provided data-property example, then make declared dataProperties and annotationProperties count as valid entities. Done means quoted references to those properties no longer produce the not-found warning.
Written by the indexing model from the issue text.
Description
dosdp.validator.test_text_fields builds the owl_entities set from only classes: and relations:. Any quoted reference to a data property (or annotation property) in a logical axiom is therefore reported as not found, even when the property is correctly declared under dataProperties:.
Context
In validator.py:
owl_entities = set()
if 'classes' in pattern.keys(): owl_entities.update(set(pattern['classes'].keys()))
if 'relations' in pattern.keys(): owl_entities.update(set(pattern['relations'].keys()))
dataProperties and annotationProperties are silently dropped. Hit while adding dpoIncreasedMortality.yaml to drosophila-phenotype-ontology — a pattern that needs a data-property range restriction on RO:0002029 (age-specific mortality rate).
Example
Pattern fragment:
dataProperties:
age_specific_mortality_rate: RO:0002029
data_vars:
rate_min: xsd:short
logical_axioms:
- axiom_type: equivalentTo
text: "'has_part' some (('characteristic_of' some 'population_of_drosophila') and ('age_specific_mortality_rate' some xsd:short[>= %s]))"
vars:
- rate_min
Output:
UserWarning: logical_axioms.[0].text has values ({'age_specific_mortality_rate'}) not found in owl entity dictionaries t ({'population_of_drosophila', 'has_part', 'characteristic_of'})
Validation completed with issues to be fixed.
dosdp-tools generates the expected DataSomeValuesFrom(RO:0002029 ...) axioms without complaint — only the Python validator is wrong.
Expected behaviour
Quoted data-property and annotation-property names declared under dataProperties: / annotationProperties: should be recognised as valid owl entities by test_text_fields.
Suggested approach
Extend the entity dict in test_text_fields:
for key in ('classes', 'relations', 'dataProperties', 'annotationProperties'):
if key in pattern: owl_entities.update(pattern[key].keys())
Workaround
Drop the single quotes around the data-property name in the text expression. Manchester syntax accepts unquoted tokens without special characters, and dosdp-tools resolves them via the dataProperties dict.
- Dominant language
- Python
- Stars
- 49
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
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.
More from INCATools/dead_simple_owl_design_patterns
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
INCATools/dead_simple_owl_design_patterns#87 · 2 comments ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
schema_ext
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
INCATools/dead_simple_owl_design_patterns#67 · 3 comments ·
-
doc
INCATools/dead_simple_owl_design_patterns#66 · 2 comments · 2 assignees ·
All issues in INCATools/dead_simple_owl_design_patterns
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100