Skip to content

Commit

Permalink
Merge pull request #865 from ontodev/fix844
Browse files Browse the repository at this point in the history
Report: Equivalent class with no genus check
  • Loading branch information
jamesaoverton authored Aug 13, 2021
2 parents 5873ddb + 4fb0010 commit 2ed2001
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- Add links to query documentation for default rules in [`report`] [#879]
- Ability to restrict [`report`] to base ontology [#872]
- Add check for equivalent class with no genus to [`report`] [#865]

### Changed
- Split equivalent class check [#856]
Expand Down Expand Up @@ -267,6 +268,7 @@ First official release of ROBOT!
[#882]: https://github.com/ontodev/robot/pull/882
[#874]: https://github.com/ontodev/robot/pull/874
[#872]: https://github.com/ontodev/robot/pull/872
[#865]: https://github.com/ontodev/robot/pull/865
[#864]: https://github.com/ontodev/robot/pull/864
[#858]: https://github.com/ontodev/robot/pull/858
[#856]: https://github.com/ontodev/robot/pull/856
Expand Down
20 changes: 20 additions & 0 deletions docs/report_queries/equivalent_class_axiom_no_genus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Equivalent Class Axiom with no Genus

**Problem:** An equivalent class axiom of the kind C = R some A is nearly always an indication of a problem. It basically means that anything that is R related to an A is equal to the class. While this is sometimes legit, most often this is accidental.

**Solution:** Add a genus to the class expression like: C = B and R some A.

```
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT DISTINCT ?entity ?property ?value WHERE {
?entity owl:equivalentClass ?ec .
?entity owl:equivalentClass [ rdf:type owl:Restriction ;
owl:someValuesFrom ?y ;
owl:onProperty ?property ] .
FILTER (!isBlank(?entity))
FILTER (!isBlank(?y))
}
ORDER BY ?entity
```
1 change: 1 addition & 0 deletions docs/report_queries/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ See [`report`](../report) for more details.
| [duplicate label synonym](duplicate_label_synonym) | WARN
| [duplicate label](duplicate_label) | ERROR
| [duplicate scoped synonym](duplicate_scoped_synonym) | WARN
| [equivalent class axiom no genus](equivalent_class_axiom_no_genus) | WARN
| [equivalent pair](equivalent_pair) | WARN
| [invalid xref](invalid_xref) | WARN
| [label formatting](label_formatting) | ERROR
Expand Down
1 change: 1 addition & 0 deletions robot-core/src/main/resources/report_profile.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WARN duplicate_label_synonym
ERROR duplicate_label
WARN duplicate_scoped_synonym
WARN equivalent_pair
WARN equivalent_class_axiom_no_genus
WARN invalid_xref
ERROR label_formatting
ERROR label_whitespace
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# # Equivalent Class Axiom with no Genus
#
# **Problem:** An equivalent class axiom of the kind C = R some A is nearly always an indication of a problem. It basically means that anything that is R related to an A is equal to the class. While this is sometimes legit, most often this is accidental.
#
# **Solution:** Add a genus to the class expression like: C = B and R some A.

PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT DISTINCT ?entity ?property ?value WHERE {
?entity owl:equivalentClass ?ec .
?entity owl:equivalentClass [ rdf:type owl:Restriction ;
owl:someValuesFrom ?y ;
owl:onProperty ?property ] .
FILTER (!isBlank(?entity))
FILTER (!isBlank(?y))
}
ORDER BY ?entity

0 comments on commit 2ed2001

Please sign in to comment.