geneontology / minerva

BSD 3-Clause "New" or "Revised" License
6 stars 8 forks source link

In some cases, minerva exits early exception when performing QC on graphstore #541

Closed kltm closed 6 months ago

kltm commented 6 months ago

Recently, we discovered that minerva will bomb out when trying to QC the entire store. To reproduce:

Errors are like:

08:49:30  2024-05-08 08:49:30,161 INFO  (org.geneontology.minerva.cli.CommandLineInterface:1104) preparing model stats...
08:49:30  java.lang.IllegalStateException: Optional.get() cannot be called on an absent value
08:49:30    at com.google.common.base.Absent.get(Absent.java:47)
08:49:30    at org.geneontology.minerva.model.GoCamModel.<init>(GoCamModel.java:49)
08:49:30    at org.geneontology.minerva.cli.CommandLineInterface.validateGoCams(CommandLineInterface.java:1107)
08:49:30    at org.geneontology.minerva.cli.CommandLineInterface.main(CommandLineInterface.java:406)
08:49:30  2024-05-08 08:49:30,182 INFO  (org.geneontology.minerva.cli.CommandLineInterface:1266) done with validation

Trying to patch some of these up with exception handling didn't really work as it's a more fundamental issue that the models are not always containing the expected identifier. E.g.

2024-05-08 14:42:15,902 INFO  (org.geneontology.minerva.json.InferenceProvider:82) Done with shex validation. model is conformant is: false
java.lang.NullPointerException
    at org.geneontology.minerva.validation.ShexValidationReport.getAsTab(ShexValidationReport.java:69)
    at org.geneontology.minerva.cli.CommandLineInterface.validateGoCams(CommandLineInterface.java:1204)
    at org.geneontology.minerva.cli.CommandLineInterface.main(CommandLineInterface.java:406)
2024-05-08 14:42:16,582 INFO  (org.geneontology.minerva.cli.CommandLineInterface:1269) done with validation

We need to either

balhoff commented 6 months ago

@kltm now I think I see what's happening. The validate-go-cams command does not expect to be checking models in the graphstore. The graphstore is organized differently from the internal Minerva database (where every graph is a GO-CAM source model). The graph store has GO-CAM source models, GO-CAM inferences graphs, GAF-CAM graphs, an ontology graph, etc. Is this a new strategy, or was this being done before?

kltm commented 6 months ago

@balhoff Well, good news / bad news. This was never done before, but we were thinking that it would likely work, as it's the same thing but more. But now that you mention it, we are adding a lot of weird stuff during construction of the "final" graph store that may be problematic.

So, the solutions would then be: 1) have minerva able to identify / skip these "constructions". This would be preferred as graphstore creation takes time, but... 2) we could create a "raw" graphstore that is just the models and no other additions, like noctua expects

While 2 is totally doable, I'd be curious as to the difficulty of 1.

balhoff commented 6 months ago

@kltm implementation of 1 in #542. Add --check-graph-type to your command line.