-
Notifications
You must be signed in to change notification settings - Fork 12
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
OBOgraphs fails hard in the presence of complex property expression #93
Comments
@julesjacobsen can you take care of this? |
What is the expected behaviour for the test to pass? |
Imo the unsupported construct should be ignored (logger.warning) and serialisation resumed without it. (Non draconian error handling) |
OK, but instead of ignoring it in the output and logging an error, would this make sense: ---
graphs:
- id: "http://purl.obolibrary.org/obo/fail-expression.owl"
domainRangeAxioms:
- predicateId: "http://purl.obolibrary.org/obo/COB_0000087"
allValuesFromEdges:
- sub: "http://purl.obolibrary.org/obo/OBI_0000260"
pred: "inverseOf"
obj: "http://purl.obolibrary.org/obo/COB_0000087" |
no, this would translate to OBI_0000260 subClassOf inverseOf only COB_0000087 This should fall into a general bucket where we can provide a generic translation, see #94 |
ahh, so these go into the In this case the untranslated axioms would be:
There are a lot of guards to check that the entity is named (here is one of them), so should anything failing this be added to the e.g. else if (supc instanceof OWLObjectAllValuesFrom) {
OWLObjectAllValuesFrom avf = (OWLObjectAllValuesFrom) supc;
OWLObjectPropertyExpression property = avf.getProperty();
if (property instanceof OWLObjectProperty) {
DomainRangeAxiom.Builder b = getDRBuilder(property, domainRangeBuilderMap);
if (avf.getFiller().isNamed()) {
Edge e = getEdge(subj,
//TODO CHECK!!!
b.build().getPredicateId(),
getClassId(avf.getFiller().asOWLClass()),
nullIfEmpty(meta));
b.addAllValuesFromEdge(e);
} else {
// this wasn't present before
untranslatedAxioms.add(sca);
}
} else if (property instanceof OWLObjectInverseOf) {
// This is new but might be incorrect OWLObjectAllValuesFrom can either be a OWLObjectProperty or a OWLObjectInverseOf.
// OWLObjectInverseOf wasn't handled before which is leading to the error
OWLObjectInverseOf iop = (OWLObjectInverseOf) property;
if (avf.getFiller().isNamed() && iop.isNamed()) {
String pid = getPropertyId(iop.getInverse().asOWLObjectProperty());
DomainRangeAxiom.Builder b = getDRBuilder(iop.getInverse(), domainRangeBuilderMap);
Edge edge = getEdge(subj, INVERSE_OF, pid, meta);
b.addAllValuesFromEdge(edge);
} else {
// this wasn't present before
untranslatedAxioms.add(sca);
}
}
} |
Needs @cmungall but |
At present, in my working branch, the output is like so ---
graphs:
- id: "http://purl.obolibrary.org/obo/fail-expression.owl"
nodes:
- id: "http://purl.obolibrary.org/obo/OBI_0000260"
type: "CLASS" with the following being logged to the console
|
I love it! |
Change for geneontology#90 - ensure all declared nodes (CLASS, INDIVIDUAL, PROPERTY) are added even if unlabelled. Change for geneontology#93 - log untranslated axioms to WARN Update examples/ with changes Enable obographs-cli to convert ttl to json and yaml
Change for #65 - add PropertyType to PROPERTY Nodes Change for #90 - ensure all declared nodes (CLASS, INDIVIDUAL, PROPERTY) are added even if unlabelled. Change for #93 - log untranslated axioms to WARN Update examples/ with changes Update schema/ with changes Enable obographs-cli to convert ttl to json and yaml Update for #103 - remove Guava dependency from core Update Junit to Jupiter 5.0.3 Update version to 0.3.1
Minimal test:
This fails because of:
The rare case where we use property expressions instead of properties.
The text was updated successfully, but these errors were encountered: