Skip to content
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

Adds a phyx2ontology.js script for building a synthesized Clade Ontology #58

Merged
merged 38 commits into from
Mar 27, 2019

Conversation

gaurav
Copy link
Member

@gaurav gaurav commented Feb 21, 2019

This PR adds a script that can be used to create a synthesized Clade Ontology from the Phyx files in this repository. It currently generates an OWL 2 DL JSON-LD representation using phyx.js, and then converts it into a OWL 2 EL JSON-LD representation on the fly. I will eventually move this code into phyx.js, but only after JPhyloRef has been updated to be able to test OWL files using OWL 2 EL reasoners.

WIP -- this code is still very quick-and-dirty and will need a bunch of cleanup before it's ready for review. Also, there are still some bugs in the output -- for example, "Tomistominae (alt)" resolves to two nodes on the same phylogeny, which should be impossible -- so these should be fixed before this PR is reviewed.

Should be merged after PR #60 has been merged.

@hlapp
Copy link
Member

hlapp commented Feb 22, 2019

"Tomistominae (alt)" resolves to two nodes on the same phylogeny, which should be impossible -- so these should be fixed before this PR is reviewed.

Ignore this. It's a logic consequence of the model in this concrete case.

This seems to work for one external specifier, but fails for more.
@gaurav gaurav marked this pull request as ready for review March 9, 2019 05:55
@gaurav gaurav requested a review from hlapp March 9, 2019 05:59
@gaurav
Copy link
Member Author

gaurav commented Mar 9, 2019

Just to be clear, this PR is not urgent, and will probably need a detailed review. Feel free to review it whenever you have the time!

Copy link
Member

@hlapp hlapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is large enough that I'm not exactly sure what to specifically look over (and it's too much to review everything). I guess there's nothing that stands out big as an issue.

The one thing I might ask is how are we testing this script, i.e., that the code in this script is performing its actions correctly according to expectations. It seems the tests are all at a downstream level, and don't directly test this script. It seems this script complex enough that to facilitate maintainability, it should come with its own set of tests.

@gaurav
Copy link
Member Author

gaurav commented Mar 26, 2019

Good point! I've added a very basic test that just runs phyx2ontology.js and makes sure that it produces valid JSON output. I think that's good enough for this PR, and then #65 covers adding shape-based testing of the produced JSON-LD output. What do you think?

Copy link
Member

@hlapp hlapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@gaurav gaurav merged commit 02bb88c into master Mar 27, 2019
@gaurav gaurav deleted the model2.0 branch March 27, 2019 19:31
gaurav added a commit to phyloref/phyx.js that referenced this pull request Jul 11, 2019
This PR updates phyx.js to produce Model 2.0 ontologies (closes #4). It updates TaxonomicUnitWrapper, TaxonConceptWrapper, TaxonNameWrapper and SpecimenWrapper to produce equivalent class expressions for taxonomic units. These are used by PhylogenyWrapper to produce OWL restrictions for nodes, which are added to their `rdf:type` in the form `cdao:represents_TU some [taxonomic unit as equivalent class expression]`.

It also completely replaces the code used to generate JSON-LD from a phyloreference in PhylorefWrapper with the model 2.0 code from the Clade Ontology (phyloref/clade-ontology#58). Note that this code needs better automated testing (see phyloref/clade-ontology#67 for an example).

Finally, we previously modeled specifiers as containing one or more taxonomic units. This PR updates the model so that specifiers *are* taxonomic units.

Making these changes has lead to the creation of a new Phyx context file. This allowed us to start changing properties to bring them in line with the new version of the Phyloref ontology (closes #9, #10).

Note that we still use the model 1.0 method for writing down which phyloreferences are expected to resolve to particular node, i.e. by labeling the node with the phyloreference or by using the `testcase:expected_phyloreference_named` property. Implementing that will require updating JPhyloRef to use the model 2.0 method as well, and so I'll do that in a separate PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants