Repository navigation
Conversation
OntologyCycleDetector built an ObjectIntersectionOf over a class's definitions only to read its class signature. For a class with no definition the operand set is empty: OWLAPI 4 accepted that, OWLAPI 5 throws "operands cannot be null or empty", which crashed every `measure --metrics all` / `all-reasoner` run. Collect the signature directly from the definition expressions instead. Re-enable MeasureOperationTest, which was ignored because of this crash.
A hidden GCI is a class with an equivalent class axiom and a subclass axiom in which it is the subclass. OWLAPI 4's HiddenGCICount checked getSubClassAxiomsForSubClass(cls). OWLAPI 5's version checks EntitySearcher.getSubClasses(cls), i.e. whether the class has *children*, which is a different metric: on uberon_fragment.owl it drops gci_hidden_count from 105 to 43. Port the OWLAPI 4 logic into OntologyMetrics. gci_hidden_count in docs/examples/metrics_all.json stays at 105 (unchanged from OWLAPI 4). This also brings `measure --metrics all` on that file from ~5 min back to a few seconds; the OWLAPI 5 metric scans the ontology per class.
getMostFrequentlyUsedClassInLogicalAxioms looked up counts under
eachClass.toString() ("<IRI>") but stored them under the bare IRI, so
the lookup never matched and each class's count was overwritten by its
last per-axiom frequency instead of accumulated. The reported class was
therefore an artifact of axiom iteration order, which OWLAPI 5 changed.
Use the bare IRI for both lookup and store. On uberon_fragment.owl
most_freq_concept(_incl) changes from UBERON_0007530 (artifact of the
bug) to UBERON_0000922 (embryo), the class with the highest summed
count.
No code change. datatypes_axiom_count counts axioms whose getDatatypesInSignature() contains each datatype. All hits on uberon_fragment.owl are AnnotationAssertion axioms (no logical axiom uses a datatype). OWLAPI 4 omitted the datatype of an annotation assertion's own literal value and only reported datatypes of literals nested in axiom annotations: only 751 of the 3720 assertions involving xsd:string were counted (e.g. 79 of 1616 hasDbXref), and none of the 7 xsd:anyURI rdfs:seeAlso values. OWLAPI 5 reports every literal's datatype. - datatypes_axiom_count(_incl): XSD_STRING 751 -> 3720, new XSD_ANY_URI 7 - namespace_axiom_count(_incl): xsd 751 -> 3727 (3720 + 7)
No value changes. SymmetricObjectProperty (axiom type lists and counts) and rdfs (prefix and namespace maps) move one position because OWLAPI 5 iterates these hash-based collections in a different order. Output is deterministic across runs; CommandLineIT compares JSON byte-for-byte.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
robot measure --metrics allcrashed on the OWLAPI 5 branch (#1295), and once it ran, some metrics came out wrong. This fixes the crash, un-ignoresMeasureOperationTest, and updatesdocs/examples/metrics_all.json. Each value change in that file is in its own commit, with the reason in the message.ObjectIntersectionOf, which the cycle detector built for undefined classes. It now collects the class signature directly.gci_hidden_count. OWLAPI 5'sHiddenGCICountchecks for subclasses instead of superclasses, which gives 43 instead of 105 on the example. I ported the OWLAPI 4 logic, so the value stays at 105. This also brings--metrics allon the example from ~5 min down to ~3 s.most_freq_concept. An existing bug: counts were stored and looked up under different keys, so they were never summed. Fixed; the example now reportsUBERON_0000922instead ofUBERON_0007530, an artifact of axiom order.XSD_STRINGgoes from 751 to 3720,XSD_ANY_URI: 7is new, and thexsdnamespace count goes from 751 to 3727.SymmetricObjectPropertyandrdfsmove one position because OWLAPI 5 iterates sets in a different order. No values change.