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

uri switch, backend refactor, and 3.0 #120

Merged
merged 72 commits into from
Oct 16, 2017
Merged

uri switch, backend refactor, and 3.0 #120

merged 72 commits into from
Oct 16, 2017

Conversation

tgbugs
Copy link
Contributor

@tgbugs tgbugs commented Oct 14, 2017

This pull request includes 3 major changes for the 3.0 release of NIFSTD.

  1. All NIFSTD native identifiers have been switched to use the uri.neuinfo.org resolver. This closes transition iris to http://uri.neuinfo.org/nif/nifstd/ #59.
  2. Major reworking of the import chain (see import chain update #115 for reference), including importing most external ontologies from their canonical iris.
  3. All backend ObjectProperties have been switched to use BFO2/RO/IAO. This closes importing bfo 1.1 and 2.0 at the same time #39.

The current state of the ontology produces reasoning errors because of obophenotype/uberon#1370. These will persist until that issue is resolved or I complete our load time patching infrastructure.

The old backend is not completely gone since we still import an old version of pr that uses the old BFO1.1 backend. The new pr is huge and switching requires further review/planning since it cannot be dropped directly into the ontology as is and thus did not make the cut for updating the 3.0 release. ero.owl was removed from the import chain pending a review of its classes.

This pull request also starts the process of moving documentation into the repository from the GitHub wiki to reduce dependence on external systems.

Note that this pull request also moves the scigraph/ folder and associated loading and curie mapping (which defines the qnames used by the ontology) to pyontutils/scigraph.

Result of running `ontload uri-switch NIF-Ontology` (in ttl/)
from pyontutils at commit 53f5e7a41b8500fe4639d860f1d2419fe5048492.

All the changes are documented in ttl/generated/NIF-NIFSTD-mapping.ttl
using owl:sameAs to map from the new uri to the old iri.

Almost all changes are the result of placing the fragment portion of
the old http://ontology.neuinfo.org/NIF/ identifiers in the new
resolver namespace http://uri.neuinfo.org/nif/nifstd/.

Changes not following this patter are as follows.
1. All sao- fragments have been converted to sao fragments, unifying the
SAO namespace.
2. All 'readable' identifiers in the ontology have been placed in the
new NIFRID -> http://uri.neuinfo.org/nif/nifstd/readable/ namespace.
Almost all of these were in the backend, and/or were predicates that
were used in a select few files.
3. All 'stolen' identifiers where a fragment from another ontology was
placed in some nifstd namespace have been placed direcly under NIFSTD.
4. The following identifiers (aside from sao- mentioned above) had their
fragments modified.
    NIFGA:FMAID_7191 -> NIFSTD:FMA_7191
    NIFRES:Class_2   -> NLX:293
    NIFSUB:nlx_sub_1008001 -> NLXSUB:1008001
    NIFNCBISLIM:nif_organ_110519   -> NLXORG:110519
    BIRNANN:_birnlex_limbo_class   -> NIFRID:birnlexLimboClass
    BIRNANN:_birnlex_retired_class -> NIFRID:birnlexRetiredClass
    http://ontology.neuinfo.org/NIF/Backend/DC_Term        -> NIFRID:dctermsClass
    http://ontology.neuinfo.org/NIF/Backend/SKOS_Entity    -> NIFRID:skosClass
    http://ontology.neuinfo.org/NIF/Backend/_backend_class -> NIFRID:BackendClass
A superset of these can be obtained using the following python commands
run from inside the ttl/generated directory.
```
import rdflib
g = rdflib.Graph().parse('NIF-NIFSTD-mapping.ttl', format='turtle')
[(g.namespace_manager.qname(old), g.namespace_manager.qname(new))
 for new, old in g.subject_objects(rdflib.OWL.sameAs)
 if 'sao-' not in old
 and new.rsplit('/', 1)[-1] != old.rsplit('#', 1)[-1]]
```
For the exact changes see uri_replacements and uri_reps_nonstandard in
ontload.py or have a peek at ttl/generated/NIF-NIFSTD-mapping.ttl

Please see ontload.py starting at line 386 through 648 for the details
of the implementation.
https://github.com/tgbugs/pyontutils/blob/53f5e7a41b8500fe4639d860f1d2419fe5048492/pyontutils/ontload.py#L386
Result of the execution of qnamefix.py (in ttl/) from pyontutils commit
53f5e7a41b8500fe4639d860f1d2419fe5048492.

This commit completes the uri switch to NIFSTD. The only remaining
iris that *could* be prefixed using the old prefixes are in annotation
properties and have special cases. Below are the two oneliners I used to
verify that the switch has gone according to plan.

review of all prefixes
`grep -r "@Prefix" | grep -v NIF-NIFSTD | grep -v Binary | \
 cut -d':' -f2- | sort -u`

review of remaining unprefixed urls
`grep "<http.\+>" *.ttl */*.ttl */*/*.ttl | grep -v 'NIF-NIFSTD' | \
 grep -v '\.ttl>' | grep -v '\.owl>' | grep -v "@Prefix" | \
 cut -d'<' -f2 | cut -d'>' -f1 | sort -u`

This commit also completes the ontology side of
#59. However we still
need to make sure that all the new uris in NIF-NIFSTD-mapping.ttl work
with the resolver and ultimately resolve to an interlex record (which
will come down the road as soon as we can switch off the old neurolex).
This commit removes the last (known) modifications to the external
ontologies. ero.owl and pr.owl have had all cases of
_birnlex_retired_class removed. Made owl:DeprecatedClass sco
NIFRID:birnlexRetiredClass in BIRNANN instead of ero-bridge. This does
suggest that we should refactor to use owl:DeprecatedClass and maybe
just add a local label.
This commit generally completes the managment of deprecated classes
coming from external ontologies. uberon-dead was added to the import
chain, but so-dead was not since I need to rework the chemical/molecule
import chain first. The last change we need to make for deads is to
transition NIFRID:birnlexRetiredClass to owl:DeprecatedClass.
Moved triples around without moving the location of their deepest point
in the import chain. All higher imports are converted to annotations.

Synthetic enzymes and degredation enzymes are NOT disjoint, this is
trivial if you consider that someday we will made degredation enzymes
from scratch. Probably should deprecate synthetic enzyme entirely since
it is a role.
Major rearrangement of the import chain for the chemical and molecular
ontology files.

All of chebi-bridge has been converted to annotations to reflect the
fact that the classes are defined in the imported file in question
(uberon-bridge still needs to be converted).

Annotations have been lifted to the point in the import chain where
the classes they are annotating are all already imported.

All chem/mol ontologies are now imported via chemical-bridge and then
through molecule-bridge. The design here attempts to minimize the number
of duplicate owl:Class redefinitions and attempts to point people in the
right direction to find where the original classes are defined. This
should help increase the modularity of our ontologies and allow us to
swap parts and execute updates with fewer issues. It should also
simplify signaling about where annotations should be placed. If you want
an annotation on external ontology but it in the bridge file that
directly imports it as an annotation.
It appears that intention with which these ObjectProperties were
originally used was to convey the idea that an object was the sum of its
parts. HIP was used on unions (and one intersection by mistake) to assert
that the class of the union was part of the whole. Of course this
modelling doesn't make sense because there was not obvious way to infer
that the members of the union were themselves part of the parent class.
I have converted all these cases to has_proper_part (consistent with
usage in the rest of nif) and added the members of the union to an
owl:disjointUnion which seems to have been the original intention based
on some of the editorial notes about the usage of HIP.

@cmungall some of these cases reveal a conflict with Uberon modelling
(for example UBERON:0003002). I will file a bug.
Moving the scigraph config to pyontutils to decouple config from data.
See pyontutils commit d0320b9d0a3e373e1da1d8c41aa3ef081d9e9f7d.
tgbugs/pyontutils@d0320b9
…cular function which clearly states that it should be sco to process, which ro does correctly
…zed in the version of owlapi used by ttl-convert
tgbugs added 23 commits October 10, 2017 18:15
…d process documentation, as well as dev-reasoner.patch
updated deads, and dev-reasoner.patch

Reviewing the changes from our old local version of pato to new latest
version (2012-06-19 -> 2017-07-10) showed that we wanted most of these
changes an there is nothing actively preventing the upgrade.
…kend-refactor` at 2ba7543d57ffaa4e8f61a912475921f108d8aeae
… also converted nif_backend classes to pure annotations since they are already defined by the imports
Following a review of doid.owl we now import it via its canonical iri.
Removed local copy of doid.owl.
Added symp-dead and trans-dead that are imported via doid, they are
imported via doid-bridge (deads from parts of the import chain we do not
control should be imported at the first point we can).
Assoc updates to catalog-extras, catalog-v001.xml, and dev-reasoner.path.
Previous was BFO1SNAP:DependentContinuant. Now is direct to owl:Thing
since units as they are defined here don't have being.
Now using BFO:0000146 2d continuant fiat boundary.
Not including this as a general 1.1->2 translation since there is not
a consistent mapping depending on whether the usage of the boundary
was to refer to a material entity or to some immaterial part.
Given that the subclasses below this are not used anywhere else,
we can make this call without too much trouble.
… of uberon-bridge that were missed when updating the import chain
Also added (and testing) the new versionIRI workflow.
Not rolling out en mass quite yet, but soon.
@tgbugs
Copy link
Contributor Author

tgbugs commented Oct 16, 2017

Managed to sneek a few more things like versionIRIs and the doid import review in for this. This is about is ready as it is going to get.

@tgbugs tgbugs merged commit 95b59f9 into master Oct 16, 2017
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.

transition iris to http://uri.neuinfo.org/nif/nifstd/ importing bfo 1.1 and 2.0 at the same time
1 participant