-
Notifications
You must be signed in to change notification settings - Fork 11
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
Added option: EMMObased = False in ontology.load() #262
Added option: EMMObased = False in ontology.load() #262
Conversation
Loading mapping.ttl from dlite dehydrogenation example does not fail, but not sure if it actually loads: onto = get_ontology('mapping.ttl').load(EMMObased=False) onto.search(label = "*") returns nothing.
@jesper-friis I suggest having an option for loading that is EMMObased=False, with True as default. I am opening this as a draft pull request so we can discuss. |
I like the idea of having an option about whether an ontologi is EMMO-based or not. Maybe we even can generalise it further? What about making an settings data class, that collects all settings in one place? We can then offer two predefine settings selectable via a "style" (do we have a better name) option; a plain default style for ontopy and a emmo-style for emmopy. Users then either modify one of the pre-defined styles for their needs or create their own style. I valid question is whether it is worth the effort. I actually think it might be, both because I think it would easy to implement and because it could simplify the rest of the code by moving logics about default options to a dedicated module. |
That sounds like a good idea, but are there more styles you are thinking about? DEFAULT_LABEL_ANNOTATIONS |
For our current needs, I don't think we need more than the 'plain' and 'emmo' style. But if people from e.g. the OBO community wants to use ontopy, it could be convenient for them to define a 'obo' style. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. I think the possible generalisation discussed in this PR should be a separate issue.
Sure. I meant what more than DEFAULT_ANNOTATION_LABELS and name_policy should be included in the style? |
Sorry for the misunderstanding. Some candidates in Ontology:
In ontograph.py it would be great to factor out the _default_style class attribute. ontodoc.py has also a lot of style-related code that would be great to factor out. I think the new style or settings module should support separate sections for the different modules. |
OK, I have added tests for this simplified solution for now and opene a new issue for the more extensive style preferences |
@CasperWA |
If you think it is okay to skip the tests until then, please do this (put a In other words - one should never merge a PR that doesn't pass the CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
I have some suggested changes, the only one I don't feel strongly about is the variable name change.
Concerning the test, please make a new function for this particular test instead of including it in another test function. The function name must start with test_
but that's it.
Move test for loading rdf and rdfs as non-EMMObased ontlogies to separate ontlogiest
Co-authored-by: Casper Welzel Andersen <[email protected]>
Co-authored-by: Casper Welzel Andersen <[email protected]>
I was not thinking to merge it with a failing test. This is an old test and I expected the github-repo link to be fixed pretty fast as was the case :) My comment was to explain why I asked for a review even though there was an old test failing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename the test_load()
function in the test_load_rdf_rdfs.py
file to test_load_rdfs()
(or similar) and move it to the test_load.py
file. There's no reason to create a new file.
Ah, so you want to have two tests in the same file. I understood that you wanted two separate files. Done now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It all looks good to me now :) Thanks @francescalb !
Description:
Loading ontologies that do not load skos and rdfs-schema needs to be supported.
Type of change:
Checklist:
This checklist can be used as a help for the reviewer.
Comments: