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

Add --strict flag #788

Merged
merged 12 commits into from
Jan 20, 2021
Merged

Add --strict flag #788

merged 12 commits into from
Jan 20, 2021

Conversation

beckyjackson
Copy link
Contributor

@beckyjackson beckyjackson commented Dec 9, 2020

Resolves #785

  • docs/ have been added/updated
  • tests have been added/updated
  • mvn verify says all tests pass
  • mvn site says all JavaDocs correct
  • CHANGELOG.md has been updated

First pass at adding a --strict global flag that causes ROBOT to fail on unparsed triples. By default, unparsed triples will now be parsed as errors. I also added a hint about RDF reification if rdfs:Statement is found as an object.

The --strict flag also turns on strict parsing with OWLAPI, but I couldn't find any documentation about what that means. If anybody (@ontodev/robot-team) knows where I can find those details (or has a brief summary) that would be great!

Additionally, are there other examples of issues that cause unparsed triples? I'd like to make sure the documentation does a good job of explaining how to fix the issue.

@beckyjackson
Copy link
Contributor Author

beckyjackson commented Dec 9, 2020

Error message for undeclared predicates:

UNPARSED TRIPLES ERROR input ontology contains 1 triple(s) that could not be parsed:
 - <urn:robot:reificationExample:Bb65616dcX2Dde2dX2D405aX2Da1aaX2Ddfbb25f03995> <urn:robot:reificationExample:propertyOne> :propertyOne.

Hint: you have undeclared predicates - try adding 'rdf:type' declarations to the following:
 - urn:robot:reificationExample:propertyOne

Error message for RDF reification:

UNPARSED TRIPLES ERROR input ontology contains 4 triple(s) that could not be parsed:
 - <urn:robot:reificationExample:Bb65616dcX2Dde2dX2D405aX2Da1aaX2Ddfbb25f03995> <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> <urn:robot:reificationExample:indicatedBy>.
 - <urn:robot:reificationExample:Bb65616dcX2Dde2dX2D405aX2Da1aaX2Ddfbb25f03995> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement>.
 - <urn:robot:reificationExample:Bb65616dcX2Dde2dX2D405aX2Da1aaX2Ddfbb25f03995> <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> <urn:robot:reificationExample:Bar>.
 - <urn:robot:reificationExample:Bb65616dcX2Dde2dX2D405aX2Da1aaX2Ddfbb25f03995> <http://www.w3.org/1999/02/22-rdf-syntax-ns#subject> <urn:robot:reificationExample:Foo>.

Hint: you may be using RDF reification - try replacing 'rdf:Statement' with 'owl:Axiom'

One other type of error is these gen IDs... These are in our unit tests:

_:genid2147484004 <http://www.w3.org/2002/07/owl#annotatedTarget> test 3 comment.
_:genid2147484004 <http://www.w3.org/2002/07/owl#annotatedSource> _:genid-nodeid-4.
_:genid2147484004 <http://www.w3.org/2002/07/owl#annotatedProperty> <http://www.w3.org/2000/01/rdf-schema#comment>.

These are for third-level nested annotation axioms:
image

... and the TTL looks like this:

[ rdf:type owl:Annotation ;
   owl:annotatedSource _:genid4 ;
   owl:annotatedProperty rdfs:comment ;
   owl:annotatedTarget "test 3 comment"@en ;
   rdfs:comment "test 3 comment comment"^^xsd:string
 ] .

Even though it says they're unparsed, running robot convert keeps these. I'm not totally sure what to do about these ones. The error is fixed if you change owl:Annotation to owl:Axiom but that's just how OWLAPI renders these. Honestly, I don't think anybody uses annotations this deep though... (hopefully)

@balhoff
Copy link
Contributor

balhoff commented Dec 9, 2020

@beckyjackson:

Even though it says they're unparsed, running robot convert keeps these. I'm not totally sure what to do about these ones.

@ignazio1977 made this comment in owlcs/owlapi#988:

Main problem is that the leftover triples are not very reliable - often I see info messages of that sort that seem incorrect, so some investigation might be required first.

Maybe this is a good test case to resolve that! (third-level nested annotation axioms)

@ignazio1977
Copy link
Contributor

Maybe this is a good test case to resolve that! (third-level nested annotation axioms)

Indeed. There are unit tests for those in OWLAPI, I remember seeing plenty of info messages when debugging them.

@beckyjackson beckyjackson marked this pull request as ready for review January 5, 2021 16:25
@beckyjackson beckyjackson changed the title WIP: Add --strict flag Add --strict flag Jan 5, 2021
@jamesaoverton jamesaoverton self-requested a review January 5, 2021 17:55
@jamesaoverton
Copy link
Member

I looked through the docs and the code and I'm happy with it, but can we please have some sort of test? (Probably a unit test in this case.)

Copy link
Member

@jamesaoverton jamesaoverton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great but please add some sort of unit test.

Copy link
Member

@jamesaoverton jamesaoverton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Please merge when you're ready.

@jamesaoverton jamesaoverton added this to the v1.8.0 milestone Jan 20, 2021
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 this pull request may close these issues.

"Unparsed triple" errors for models with reification and annotation properties
4 participants