WorldModelers / Ontologies

Ontologies for the World Modelers system
Creative Commons Attribution 4.0 International
6 stars 11 forks source link

New py scripts #138

Closed zupon closed 3 years ago

zupon commented 3 years ago

This PR adds two new Python scripts that might come in handy for people working on the ontology.

  1. merge_yamls.py takes two yml files as inputs and combines them without creating duplicate entries. This can be helpful if more than one person is working on the ontology and their work needs to be combined easily.
  2. get_leaf_node_examples.py creates a human-readable "cheat sheet" file containing all the leaf nodes of the ontology along with all their examples. This can be helpful if one wants to see if examples already exist without having to search through the metadataful version of the ontology.
kwalcock commented 3 years ago

They sound handy. (Almost) anything to make life easier... It seems like the one for leaf nodes performs a fuzzy parse, which I'd be wary of.

BeckySharp commented 3 years ago

@zupon thanks for working on these!! I love the ideas and your initiative! can you provide an example of what the files generated by the cheatsheet one look like? (screen shot of part of one is fine I think) also -- what happens in the merge one to the duplicate? are the examples merged or is one node simply discarded? I feel like a test may be worthwhile or something... idk if that's overkill?

kwalcock commented 3 years ago

Maybe surprisingly, I think it appropriate that these scripts are in Python because they will be run on ontologists' computers which are more likely to be set up for Python than Scala. Do we have any CLU Lab Python projects that demonstrate a standard testing framework with integration into Travis or Jenkins? I checked the Python-heavy projects in the clulab repo and see nothing. Perhaps it is time to figure out how that should work and implement it in a reference project.

zupon commented 3 years ago

Here's a snippet of what the output of get_leaf_node_examples.py looks like:

name: storm
examples:
- cyclone
- hurricane
- landfall
- storm
name: volcanic_eruption
examples:
- volcanic eruption
- volcano
name: wildfire
examples:
- wild fire
- wildfire
zupon commented 3 years ago

I also just noticed some problems with merge_yamls where it's combining nodes that shouldn't be combined, so that one isn't ready to include just yet.

BeckySharp commented 3 years ago

Maybe surprisingly, I think it appropriate that these scripts are in Python because they will be run on ontologists' computers which are more likely to be set up for Python than Scala. Do we have any CLU Lab Python projects that demonstrate a standard testing framework with integration into Travis or Jenkins? I checked the Python-heavy projects in the clulab repo and see nothing. Perhaps it is time to figure out how that should work and implement it in a reference project.

yeah maybe. and I agree about the python vs scala for the same reasons you mentioned

bgyori commented 3 years ago

I'm happy to take care of setting up testing for Python, I've migrated all testing for our repos to Github Actions and have templates for doing that, see e.g., https://github.com/indralab/indra_world/blob/master/.github/workflows/tests.yml