Skip to content

Fix no-genus report query failing on inverse properties - #1300

Open
matentzn wants to merge 1 commit into
masterfrom
fix-1299-inverse-no-genus
Open

matentzn wants to merge 1 commit into
masterfrom
fix-1299-inverse-no-genus

Conversation

@matentzn

Copy link
Copy Markdown
Contributor

equivalent_class_axiom_no_genus bound ?property to the literal "blank node" for inverse property expressions, which the report renderer then tried to turn into an IRI ("iri cannot be null"). The query now renders the inverse as inverse(), and the renderer keeps literal property bindings as plain strings. Failed queries now raise QUERY FAILED ERROR instead of the misleading MISSING ENTITY BINDING.

Fixes #1299

  • 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

equivalent_class_axiom_no_genus bound ?property to the literal "blank node"
for inverse property expressions, which the report renderer then tried to
turn into an IRI ("iri cannot be null"). The query now renders the inverse
as inverse(<IRI>), and the renderer keeps literal property bindings as plain
strings. Failed queries now raise QUERY FAILED ERROR instead of the
misleading MISSING ENTITY BINDING.

Fixes #1299
BIND (if(isIRI(?property1), ?property1, "blank node" ) as ?property)
OPTIONAL { ?property1 owl:inverseOf ?inverse . FILTER (isIRI(?inverse)) }
BIND (if(isIRI(?property1), ?property1,
if(bound(?inverse), concat("inverse(", str(?inverse), ")"), "blank node")) as ?property)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is only possible because of the fix to the report operation that handles the case where "property" is a literal rather than an entity.

// add details to Violation
String property = getQueryResultOrNull(qs, "property");
if (property != null) {
if (property != null && qs.get("property").isLiteral()) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is the key change

@allenbaron

Copy link
Copy Markdown
Contributor

I'm only very loosely familiar with Java, but I downloaded, built, and ran this version against the prior issue I mentioned in #1299 (comment), which bound a string to the ?property, and my current workaround, which bind an IRI to ?property. Both now work without issue.

For a bit more coverage, I plugged this into the Human Disease Ontology make CI/build and tried out the test (reason, report, & verify) and import (extract, remove, & annotate) procedures. Both seemed to work fine. I will note, though, that there aren't any actual errors at the moment since I just created a release yesterday.

@matentzn

Copy link
Copy Markdown
Contributor Author

@allenbaron thanks for your effort!

This branch has not been deployed

No deployments
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.

report: equivalent_class_axiom_no_genus still fails for inverse object property expressions in 1.9.11

2 participants