ontology-development-kit
ontology-development-kit copied to clipboard
Robot template processing within ODK
Dear All,
I am very new to ODK and have used robot for some time. I was able to create a new ontology with ODK, but I wonder if I could create my ontology in ODK using a robot template?.
Some robot parameters are mentioned in the yaml file that was autogenerated, but I wonder if there could be an illustrative example somewhere, where they explain how to generate the ontology with robot and ODK?. I read the documentation (https://ontology-development-kit.readthedocs.io/en/latest/) and did not find anything similar.
Any recommendation is welcomed.
Luis Ramos
@luisenriqueramos1977 Thank you so much for your issue. I do not know how it slipped through my inbox.
Native ROBOT template support is being implemented as we speak, but not ready yet for prime time #314
In the meantime, you can build a custom ROBOT template pipeline by:
- Adding a component in the config
- Defining the component as a robot template process in yourontology.Makefile
I can help you with that if you like, its easy enough to set up (share your Github repo and I can make a PR).
Hi @matentzn,
thanks so much for your disposition to help.
I created a sample project repository, that you can use to add the component, and then I use it as a seed for my work:
https://github.com/luisenriqueramos1977/testontoodk
I hope we can set it up properly, and thanks in advance.
Best regards
Luis Ramos
Hi @matentzn and @luisenriqueramos1977, sorry ot tag along here, but I want to do the same in https://github.com/NFDI4Chem/VibrationSpectroscopyOntology and I don't know how to best set up the component part as mentioned in https://github.com/INCATools/ontology-development-kit/issues/613#issuecomment-1206202300. @matentzn can you point me to an ontology that uses this in theri yaml & makefile already to learn from?
Until the new feature is released, you can:
- create a component
- create a custom goal for that component which involves a
robot template
pipeline, depending on a template tsv file. - Import component URL to edit.
Here is an example: https://gitlab.c-path.org/c-pathontology/critical-path-ontology/-/blob/main/src/ontology/Makefile#L408
I've managed to get it working in https://github.com/NFDI4Chem/VibrationSpectroscopyOntology/pull/10 but somehow the QC pipeline fails due to the component owl build from the TSV, which I cannot explain. Running sh run.sh make test
runs through locally but doesn't contain the component build part, as does the QC in the GH actions of the PR. Loading the component owl into the edit.owl works also as expected locally. I'm out of ideas where to look for other than trying to merge the component owl into the edit owl. If you have the time to have a look @matentzn that would be great. If not, no worries ;)
@luisenriqueramos1977 I got it working, so if you need help with that you can look at the VISPRO repo as an example or can ask me as well.
Hi @matentzn , dear, I have not been able to solve the issue. Please, could you tell me how I create a component in the config?, in the config folder there are 3 files.
context.json table-template-config.yaml top_level_classes.txt.
Where should I create the component?, and how?. Where do I find documentation on how to create such a component?.
Luis Ramos
Hi @luisenriqueramos1977
- you need to have your template in
scr/templates
like this one: https://github.com/NFDI4Chem/VibrationSpectroscopyOntology/blob/main/src/templates/vispro_terms.tsv - you need to specify your template pipeline by directing to YOUR TSV template like this: https://github.com/NFDI4Chem/VibrationSpectroscopyOntology/blob/main/src/ontology/vispro-odk.yaml#L134-L140
- run
sh run.sh make update_repo
twice! --> this will update your automated Makefile (which should never be edited manually), providing you the commands/recipies you'll need in step 5, e.g. https://github.com/NFDI4Chem/VibrationSpectroscopyOntology/blob/main/src/ontology/Makefile#L349-L370. - In your ontology.Makefile (the place where you can add customized code to deviate from the standard) add code for how you want the OWL module (specified in your congig.yml) to be build using ROBOT, e.g. like this here: https://github.com/NFDI4Chem/VibrationSpectroscopyOntology/blob/main/src/ontology/vispro.Makefile#L6-L19
- now, assuming that the
OTHER_SRC
variable in the Makefile was set correctly toCOMPONENTSDIR)/[your_component].owl
by step 3, you can callsh run.sh make all_components
which should generate your component owl within the component folder. - To load the newly generated component into your edit.owl you need to copy the import statement from the
catalog-v001.xml
in the target folder, as indicated by the update_repo script shell output of step 3. and also add an import statement to your component in your edit.owl
Dear @StroemPhi thanks for your answer.
I followed the indicated steps to 3, as you indicated. I found the command sh run.sh make update_repo, and run it at ontology folder level, which created another target folder. But, no ontology with my robot template terms was created, or updated. The robot template is properly developed because is the one I use to create my ontology, so the problem should not be there.
The step 4, is before or after step 3?.
So, I do not know what I am doing wrong.
@luisenriqueramos1977 I updated my previous post in the hope of being more clear now.
@luisenriqueramos1977 did you get it to work?
Hi @StroemPhi , unfortunalley I have not been able to solve the issue.
When I run the step 3, a new folder is created as indicated here: https://github.com/INCATools/ontology-development-kit/issues/669 After that, I do not know if that is normal, or not, or if I have to do the next indicated steps in the new folder. Anyway, I followed the new steps in the current folder, but at the end, when I run the command: sh run.sh make all_components the system indicates me: sh run.sh make all_components . At the end, nothing is done on the digitrubber_terms.owl file.
Luis
Yes the target folder is normal and you can remove it by running sh run.sh make clean
which is all documented within the Makefile. I'm sorry but helping you without a link to the repo to see where you are, is really hard. Did step 3 really update your Makefile to have the ´all_components` recipe? Did you add your ROBOT code in you ontology.makefile? If I can't see what you did, I cannot really help. Since we're both TIB and if this is in our TIB GitLab because you are not allowed to have it public send me the link via email.
Here is the repository: https://github.com/luisenriqueramos1977/digitrubber
Step 3 did nothing. In the make file it is only what I added as indicated in step 4.
I do not have access to our (tib) gitlab
Luis.
@luisenriqueramos1977 see the above PR, which fixes all. Step 3 did, what it should have, which is create the commands in the autogenerate Makefile. Step 5 did't do as expected, because step 3 already created the component.owl as a stub, which I forgot it would do. Thus the proper command should have been sh run.sh make recreate-components
or you could just have deleted this stub, like I did in the PR. But the main problem that was there, was the wron prefix in your TSV template, which needs to be obo.
Glad I could help. Next time, please make sure to read/inspect the available docs/comments in the sourcefiles before, as some of the questions could have been answered thereby.
Thanks so much my dear @StroemPhi. Job done!. Hope this learning step helps others!.
Luis
Hi guys, I am trying to update a version of the ontology using an updated version of my robot template.
Following the commands:
- sh run.sh make update_repo (2 times)
- sh run.sh make all_components
- sh run.sh make recreate-components.
The file digitrubber_terms.owl is updated with the new terms brought from digitrubber_terms.tsv, but the file DIGIT-RUBBER-edit.owl is not updated. Actually this last file has nothing.
What should I do being wrong?
Luis Ramos
@luisenriqueramos1977 as far as I know you don't need to run sh run.sh make all_components
again, as the component is already created, you only need to run sh run.sh make recreate-components
. But this should not be your problem. If digitrubber_terms.owl
is updated properly, all seems to be as expected, because this is what the recreate command does. Did you reload DIGIT-RUBBER-edit.owl
, which Protégé should have asked for after recreating the component and if the edit owl was still open in Protégé.
HI @StroemPhi , very thanked again for your quick answer. My installation does not response to the command: sh run.sh make recreate-components, I reloaded the ontology, closed and open, but did not work.
I do not understand very well this:
To load the newly generated component into your edit.owl you need to copy the import statement from the catalog-v001.xml in the target folder, as indicated by the update_repo script shell output of step 3. and also add an import statement to your component in your edit.owl
You say: you need to copy the import statement from the catalog-v001.xml in the target folder, I do not understand that, how do I copy an import to a folder?, should I create a file in that folder?.
I simply imported the _term ontology mentioned in catalog-v001.xml, into the _edit.owl file, is that the procedure?.
Thanks in advance.
Luis
please let's move this discussion to your digit rubber repo, as I think this would otherwise clutter this issue thread, which is resolved afaik.
Thank you all for the vibrant discussion here, seems the issue is moved elsewhere. Please confirm and close this one!
Yes can be closed here, if you don't need it as reference anymore.
Thank you all for the vibrant discussion here, seems the issue is moved elsewhere. Please confirm and close this one!
I do not agree to close it, because I have not been able to satisfactory solve the issues following the given steps, so I am not sure if that is the solution.
The stepsn outlined here worked as expected in my example and also in yours according to this PR. So from the ODK side this is resolved to me. What we need to do now, is help you getting familiar with this ODK workflow. Hence, I made https://github.com/luisenriqueramos1977/digitrubber/issues/2 to move this issue, which to me would be a better place, to not lose track. Not?
@StroemPhi , as you might remember, thanks to your support we run the application, but after that, I have not been able to reproduce it. We tried to follow the procedure from a windows PC, and it was necessary to create a "config" folder and add two files. @matentzn mentioned the folder, but he did not say the folder was not present there, the files were just in digitrubeer, I copied and pasted them in the folder config, that I had to create, but the question is what is the content of such files?, where is that documented?. I will discuss this case a separate issue, and separated of digitrubber. Thanks so much for your support.
Hi,
@matentzn @StroemPhi I also tried to link the ROBOT flat template with the ODK, I followed the steps mentioned by @StroemPhi, and everything seems to work fine, components ontology gets updated as expected, myontology.owl updated correctly but myontology-edit.owl did not reflect the updates. Is it a normal behavior or some kind of bug? I am also using Windows environment. Thank you guys, for such an illustrative discussion, there was no proper documentation about this implementation as far as searched. please ping me, if more information is required regarding the issue.
Hi @Crispae, did you do the edits of step 6? If you provide a link to your repo, it would be easier to help. :)
Hi @StroemPhi thank's for quick response. https://github.com/Crispae/pkonto, here is the repo
I don't really get what you mean. To me it looks all the way it should be. You generate the component from the TSV, which is then being imported into the myontology-edit.owl file. And when creating a release (myontology.owl) the coponent.owl is being merged with the -edit.owl. So all as it should be. What am I missing in your question?
Sorry, if it was not clear. myontology-edit.owl doesn't have the classes mentioned in the TSV file, link to the file https://github.com/Crispae/pkonto/blob/main/src/ontology/pko-edit.owl.
Is it normal, to have like this ?