Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecated_class_reference in report fails falsely since ROBOT 1.7.1 #766

Closed
matentzn opened this issue Nov 17, 2020 · 4 comments · Fixed by #767
Closed

deprecated_class_reference in report fails falsely since ROBOT 1.7.1 #766

matentzn opened this issue Nov 17, 2020 · 4 comments · Fixed by #767
Assignees

Comments

@matentzn
Copy link
Contributor

Error thrown:

2020-11-17 15:34:43,856 ERROR org.obolibrary.robot.ReportOperation - Could not complete query 'deprecated_class_reference' - report may be incomplete.
Cause:
iri cannot be null
report#MISSING ENTITY BINDING query 'deprecated_class_reference' must include an '?entity'

Minimum working example:

format-version: 1.2
data-version: edit
ontology: fbbt

[Term]
id: FBbt:01
name: term 1

[Term]
id: FBbt:02
name: term 2
is_obsolete: true

[Term]
id: FBbt:03
name: term 3
intersection_of: develops_from FBbt:01
intersection_of: develops_from FBbt:02

This causes the exception:

intersection_of: develops_from FBbt:02

I don't know what happened recently with that specific query, but this error never happened before ROBOT 1.7.1 (it just happened in a previously working pipeline).

Any idea what could be wrong with that query @jamesaoverton @beckyjackson ? Maybe just some tiny intervention to fix?

@beckyjackson
Copy link
Contributor

beckyjackson commented Nov 17, 2020

The problem here is that the "entity" that gets returned by this query is a blank node. It's a bit more clear in the TTL:

FBbt:03 owl:equivalentClass [ owl:intersectionOf ( [ rdf:type owl:Restriction ;
                                                     owl:onProperty fbbt:develops_from ;
                                                     owl:someValuesFrom FBbt:01 .
                                                   ]
                                                   [ rdf:type owl:Restriction ;
                                                     owl:onProperty fbbt:develops_from ;
                                                     owl:someValuesFrom FBbt:02
                                                   ]
                                                 ) ;
                             rdf:type owl:Class
                           ] ;

The current query returns ?entity ?property ?value like:

:_bnode owl:someValuesFrom FBbt:02

What we want is something like:

FBbt:03 owl:someValuesFrom FBbt:02

I'm not really sure what the property should be here though. All our report lines so far are just subject, predicate, object, but this breaks that pattern unless we make the blank node the subject. In which case, we don't need to rewrite the queries, we just need to update the code to handle blank nodes, but then we get report lines like:

Subject Property Value
d083b58c-27c1-484c-ac78-cbce00dcf52cgenid2 owl:someValuesFrom FBbt:02

I don't know what the better option is. If we go for the first option, we need to write a query that can find the top-level subject no matter how nested the violating class is, which might be tricky?

@beckyjackson
Copy link
Contributor

beckyjackson commented Nov 17, 2020

Alternatively we could replace the ugly bnode ID with just "blank node" for a result that looks like this:

Level Rule Name Subject Property Value
ERROR deprecated_class_reference blank node owl:someValuesFrom FBbt:02

This is a relatively easy fix to make, and we already have the framework for handling it. I just need to add a try/catch statement.

@matentzn
Copy link
Contributor Author

Awesome! I can confirm, In my field test, this works great!

ERROR	deprecated_class_reference	blank node	owl:someValuesFrom	<http://purl.obolibrary.org/obo/FBbt_00050047>
ERROR	deprecated_class_reference	blank node	owl:someValuesFrom	<http://purl.obolibrary.org/obo/FBbt_00050047>
ERROR	deprecated_class_reference	FBbt:00111295	owl:someValuesFrom	<http://purl.obolibrary.org/obo/FBbt_00050047>

If @jamesaoverton is happy with this, I am. BTW, having this travis build of branches is so amazing; I can test all my ontologies with the new jar in a matter of minutes! So, if testing for anything is needed, holla at me from now on!

Thank you for that! Once @jamesaoverton confirms that I can safely use the branch jar in ODK, I will create an ODK patch release.

@jamesaoverton
Copy link
Member

Release 1.7.2 includes this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants