iovka / shex-java

Validation of Shape Expression Schemas
GNU Lesser General Public License v3.0
10 stars 6 forks source link

failure explanations ? #14

Open goodb opened 4 years ago

goodb commented 4 years ago

On the readme, I see this:

validation.addFailureReportsCollector(new FailureAnalyzerSimple());

but I can't find that anywhere in the code. Does it exist? I'd love to try it out.

I have implemented my own hack for explaining why a given shape did not match a given node, but I'm sure that something native to the library is going to perform better.

tholiebig commented 4 years ago

+1 for this I can't find this either. Explanations are needed to provide a reasonable report. @goodb will you share your code to help others out?

goodb commented 4 years ago

@tholiebig caveat emptor - this is all very application specific and I was learning as I was going with it... But, always happy to share anyway: https://github.com/geneontology/minerva/blob/dev/minerva-core/src/main/java/org/geneontology/minerva/validation/ShexValidator.java and very welcome to improvements at any level..

ericprud commented 4 years ago

If y'all want to take a stab and standardizing error reporting, you'll find a receptive audience in the ShEX CG. I implemented one in ShEx.js which ties the report back to the abstract(ish) syntax, but:

  1. captures either OneOfs or ShapeOrs (or both) as an array rather than a typed, structured object.
  2. is hilariously detailed.
  3. doesn't minimize the cross product of possibilities arising from disjunction.
goodb commented 4 years ago

@ericprud is there like an issue thread or something to follow for this topic? I'm interested and may be able to contribute something in the future but can't really do much now. Not really even keeping up with normal job these days...

iovka commented 4 years ago

validation.addFailureReportsCollector(new FailureAnalyzerSimple());

This documentation corresponds to an old version. Failure analysis has been externalized since: the validator provides validation information to a registered MatchingCollector, which can generate failure reports. Currently however there is no implementation of a MatchingCollector that could be useful for you. I'm planning to write a simple one as example (when I find enough time to do it).

ericprud commented 4 years ago

@ericprud is there like an issue thread or something to follow for this topic? I'm interested and may be able to contribute something in the future but can't really do much now. Not really even keeping up with normal job these days...

https://github.com/shexSpec/shex/issues?q=is%3Aissue+is%3Aopen+error suggests there is no such issue. I know that Harold and maybe Labra were interested in the past.

justinwb commented 3 years ago

Currently however there is no implementation of a MatchingCollector that could be useful for you. I'm planning to write a simple one as example (when I find enough time to do it).

Checking in on this - @iovka has there been any recent progress in creating an example along these lines?