Skip to content

Commit

Permalink
Merge pull request #1187 from ontodev/issue1108-characteristicsmissin…
Browse files Browse the repository at this point in the history
…gfrombase

Extend RelatedObjectsHelper.getAxiomSubjects() to missing property axiom types
  • Loading branch information
jamesaoverton authored May 1, 2024
2 parents e76c16e + 663a25f commit 8452b42
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Handle IRIs that are not entities in export [#1168]
- Fix integration tests [#1181]
- Invalid Xrefs test has been fixed to recognise invalid CURIEs correctly [#1127]
- Fix issue with correctly determining base entities [#1108]

## [1.9.5] - 2023-09-20

Expand Down Expand Up @@ -399,7 +400,9 @@ First official release of ROBOT!
[#1152]: https://github.com/ontodev/robot/issues/1152
[#1148]: https://github.com/ontodev/robot/pull/1148
[#1135]: https://github.com/ontodev/robot/pull/1135
[#1127]: https://github.com/ontodev/robot/pull/1127
[#1119]: https://github.com/ontodev/robot/pull/1119
[#1108]: https://github.com/ontodev/robot/pull/1108
[#1104]: https://github.com/ontodev/robot/pull/1104
[#1100]: https://github.com/ontodev/robot/pull/1100
[#1091]: https://github.com/ontodev/robot/issues/1091
Expand Down
9 changes: 9 additions & 0 deletions docs/examples/template-base-filter.owl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
<obo:IAO_0000115 rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Weight of a mouse or rat in kilograms (kg).</obo:IAO_0000115>
<obo:IAO_0000117 rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Rebecca C Jackson</obo:IAO_0000117>
<rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">weight in kilograms</rdfs:label>
<rdfs:domain>
<owl:Class>
<owl:unionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://example.com/B6C3F1"/>
<rdf:Description rdf:about="http://example.com/F344N"/>
</owl:unionOf>
</owl:Class>
</rdfs:domain>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#decimal"/>
</owl:DatatypeProperty>
<owl:Axiom>
<owl:annotatedSource rdf:resource="http://example.com/propery-1"/>
Expand Down
9 changes: 9 additions & 0 deletions docs/examples/template-base.owl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@
<obo:IAO_0000115 rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Weight of a mouse or rat in kilograms (kg).</obo:IAO_0000115>
<obo:IAO_0000117 rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Rebecca C Jackson</obo:IAO_0000117>
<rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">weight in kilograms</rdfs:label>
<rdfs:domain>
<owl:Class>
<owl:unionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://example.com/B6C3F1"/>
<rdf:Description rdf:about="http://example.com/F344N"/>
</owl:unionOf>
</owl:Class>
</rdfs:domain>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#decimal"/>
</owl:DatatypeProperty>
<owl:Axiom>
<owl:annotatedSource rdf:resource="http://example.com/propery-1"/>
Expand Down
11 changes: 10 additions & 1 deletion docs/examples/template-drop-axiom-filter.owl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@
<obo:IAO_0000115 rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Weight of a mouse or rat in kilograms (kg).</obo:IAO_0000115>
<obo:IAO_0000117 rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Rebecca C Jackson</obo:IAO_0000117>
<rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">weight in kilograms</rdfs:label>
<rdfs:domain>
<owl:Class>
<owl:unionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://example.com/B6C3F1"/>
<rdf:Description rdf:about="http://example.com/F344N"/>
</owl:unionOf>
</owl:Class>
</rdfs:domain>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#decimal"/>
</owl:DatatypeProperty>


Expand Down Expand Up @@ -126,5 +135,5 @@



<!-- Generated by the OWL API (version 4.5.6) https://github.com/owlcs/owlapi -->
<!-- Generated by the OWL API (version 4.5.26) https://github.com/owlcs/owlapi -->

9 changes: 9 additions & 0 deletions docs/examples/template-drop-axiom-remove.owl
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@
<obo:IAO_0000115 rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Weight of a mouse or rat in kilograms (kg).</obo:IAO_0000115>
<obo:IAO_0000117 rdf:datatype="http://www.w3.org/2001/XMLSchema#string">Rebecca C Jackson</obo:IAO_0000117>
<rdfs:label rdf:datatype="http://www.w3.org/2001/XMLSchema#string">weight in kilograms</rdfs:label>
<rdfs:domain>
<owl:Class>
<owl:unionOf rdf:parseType="Collection">
<rdf:Description rdf:about="http://example.com/B6C3F1"/>
<rdf:Description rdf:about="http://example.com/F344N"/>
</owl:unionOf>
</owl:Class>
</rdfs:domain>
<rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#decimal"/>
</owl:DatatypeProperty>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1417,6 +1417,14 @@ private static Set<IRI> getAxiomSubjects(OWLAxiom axiom) {
} else {
iris.addAll(getIRIsFromEntities(subject.getSignature()));
}
} else if (axiom instanceof OWLSubAnnotationPropertyOfAxiom) {
OWLSubAnnotationPropertyOfAxiom spAxiom = (OWLSubAnnotationPropertyOfAxiom) axiom;
OWLAnnotationProperty subject = spAxiom.getSubProperty();
if (!subject.isAnonymous()) {
return Sets.newHashSet(subject.asOWLAnnotationProperty().getIRI());
} else {
iris.addAll(getIRIsFromEntities(subject.getSignature()));
}
} else if (axiom instanceof OWLEquivalentDataPropertiesAxiom) {
OWLEquivalentDataPropertiesAxiom eqAxiom = (OWLEquivalentDataPropertiesAxiom) axiom;
for (OWLSubDataPropertyOfAxiom spAxiom : eqAxiom.asSubDataPropertyOfAxioms()) {
Expand Down Expand Up @@ -1492,6 +1500,54 @@ private static Set<IRI> getAxiomSubjects(OWLAxiom axiom) {
for (OWLObjectPropertyExpression expr : spcAxiom.getPropertyChain()) {
iris.addAll(getIRIsFromEntities(expr.getSignature()));
}
} else if (axiom instanceof OWLObjectPropertyCharacteristicAxiom) {
OWLObjectPropertyCharacteristicAxiom chAxiom = (OWLObjectPropertyCharacteristicAxiom) axiom;
OWLObjectPropertyExpression subject = chAxiom.getProperty();
if (!subject.isAnonymous()) {
return Sets.newHashSet(subject.asOWLObjectProperty().getIRI());
} else {
iris.addAll(getIRIsFromEntities(subject.getSignature()));
}
} else if (axiom instanceof OWLObjectPropertyDomainAxiom) {
OWLObjectPropertyDomainAxiom domainAxiom = (OWLObjectPropertyDomainAxiom) axiom;
OWLObjectPropertyExpression subject = domainAxiom.getProperty();
if (!subject.isAnonymous()) {
return Sets.newHashSet(subject.asOWLObjectProperty().getIRI());
} else {
iris.addAll(getIRIsFromEntities(subject.getSignature()));
}
} else if (axiom instanceof OWLObjectPropertyRangeAxiom) {
OWLObjectPropertyRangeAxiom rangeAxiom = (OWLObjectPropertyRangeAxiom) axiom;
OWLObjectPropertyExpression subject = rangeAxiom.getProperty();
if (!subject.isAnonymous()) {
return Sets.newHashSet(subject.asOWLObjectProperty().getIRI());
} else {
iris.addAll(getIRIsFromEntities(subject.getSignature()));
}
} else if (axiom instanceof OWLDataPropertyDomainAxiom) {
OWLDataPropertyDomainAxiom domainAxiom = (OWLDataPropertyDomainAxiom) axiom;
OWLDataPropertyExpression subject = domainAxiom.getProperty();
if (!subject.isAnonymous()) {
return Sets.newHashSet(subject.asOWLDataProperty().getIRI());
} else {
iris.addAll(getIRIsFromEntities(subject.getSignature()));
}
} else if (axiom instanceof OWLDataPropertyRangeAxiom) {
OWLDataPropertyRangeAxiom rangeAxiom = (OWLDataPropertyRangeAxiom) axiom;
OWLDataPropertyExpression subject = rangeAxiom.getProperty();
if (!subject.isAnonymous()) {
return Sets.newHashSet(subject.asOWLDataProperty().getIRI());
} else {
iris.addAll(getIRIsFromEntities(subject.getSignature()));
}
} else if (axiom instanceof OWLInverseObjectPropertiesAxiom) {
OWLInverseObjectPropertiesAxiom iopAxiom = (OWLInverseObjectPropertiesAxiom) axiom;
OWLObjectPropertyExpression subject = iopAxiom.getFirstProperty();
if (!subject.isAnonymous()) {
return Sets.newHashSet(subject.asOWLObjectProperty().getIRI());
} else {
iris.addAll(getIRIsFromEntities(subject.getSignature()));
}
} else {
logger.warn("Axiom type not supported: " + axiom.getClass().toString());
}
Expand Down

0 comments on commit 8452b42

Please sign in to comment.