Create no-orphaned-subclasses.sparql#459
Conversation
There is probably some trouble with lines 10-11. When it's convenient, could somebody else look at this file, please?
|
You can delete lines 9–11. Also, that query isn't correct. My fault: I wrote it without fully understanding how github does error-checking. If all CCO classes have a parent class, the query shouldn't return any results at all. Unless someone beats me to it, I will provide a correct query in the next few days. |
| ?cls a owl:Class | ||
| FILTER isIRI(?cls) | ||
| FILTER NOT EXISTS { ?cls rdfs:subClassOf ?supercls } | ||
| } |
There was a problem hiding this comment.
Insert before line 21:
FILTER (?cls != <http://purl.obolibrary.org/obo/BFO_0000001>)
| # Author: | ||
| # github.com/swartik | ||
|
|
||
| Severity: |
There was a problem hiding this comment.
Delete lines 10 through 12.
| # Title: | ||
| # No Orphaned Subclasses | ||
| # Constraint Description: | ||
| # All classes must have some parent class. The only result otherwise should be “entity”. |
There was a problem hiding this comment.
Replace line 4 with:
# All CCO classes must have a superclass.
| # Constraint Description: | ||
| # All classes must have some parent class. The only result otherwise should be “entity”. | ||
| # Severity: | ||
| # Warning |
Based on the updates provided by @swartik, thank you. Tell me if there are any remaining edits that need to be made.
|
The present query returns classes that are: This query doesn't restrict the target IRIs to only CCO, nor does it rule out a class being a subclass of some other class (e.g. owl:Thing, skos:altLabel, etc). I think the desired query is that every class in CCO should be a direct or transitive subclass of a BFO class. Here's an example. Let me know what you think. ` Title:No CCO class should fall outside the BFO hierarchyConstraint Description:All CCO classes must have a superclass in BFO.Severity:ErrorPREFIX owl: http://www.w3.org/2002/07/owl# SELECT DISTINCT ?class ?label |
|
The query I proposed addressed a specific bug in a CCO version. The alternative you propose is both more general (it addresses other potential problems) and more precise (it restricts itself to CCO). It will also detect class hierarchy errors in BFO releases, which is good. The software engineer in me likes to isolate literals. I advise adding the prefix declaration: and changing the first filter to: Function |
There is probably some trouble with lines 10-11. When it's convenient, could somebody else look at this file, please?