Skip to content

Commit

Permalink
Consolidate property maps
Browse files Browse the repository at this point in the history
- There have been 2 property map TSV files used by robot rename. However, we are now utilizing the --allow-duplicates flag, which allows us to consolidate them into 1 file.
- Delete: one of the property map files
- Rename: the other of the files
- Update: components goals to utilize the new/updated file
- Update: Docs regarding this aspect of adding a new source
  • Loading branch information
joeflack4 committed Apr 28, 2024
1 parent adc2015 commit 62e8491
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 24 deletions.
13 changes: 6 additions & 7 deletions docs/developer/add-new-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,11 @@ When `mondo-ingest-odk.yaml` is edited and `update_repo` is run, a new `componen
`src/ontology/Makefile`. This essentially downloads a copy of the source. But, for it to be used in `mondo-ingest`, it
needs to be modified. This is done by creating a `$(COMPONENTSDIR)/omim.owl` goal in `mondo-ingest.Makefile` which runs
a composite `robot` command. Here are some sections you'll likely want to add that command:
- `rename --mappings config/SOURCE-property-map.sssom.tsv`: You'll notice that there are two other lines on most goals
for `property-map.sssom.tsv` and `property-map-2.sssom.tsv`. These handle some common renamings. However,
if your source has any properties that need to be renamed which are specific to that source, then you should create a
new file for that. While doing this, it might be useful to check any other `SOURCE-property-map.sssom.tsv` files to see
if they share any of the same property renamings. If so, it might be a good idea to move them to
`property-map.sssom.tsv` instead.
- `rename --mappings config/SOURCE-property-map.sssom.tsv`: You'll notice that all components goals have a such a line
using `property-map.sssom.tsv`. This is for some common property renamings. However, if your source has any properties
that need to be renamed which are specific to that source, then you should create a new file for that. While doing this,
it might be useful to check any other `SOURCE-property-map.sssom.tsv` files to see if they share any of the same
property renamings. If so, it might be a good idea to move them to `property-map.sssom.tsv` instead.
- `query --update ../sparql/SPARQL.ru`: There may be more complex modifications that need to be made to the ontology. If
so, this can be done by 1 or more SPARQL queries.
- `remove -T config/properties.txt --select complement --select properties --trim true`: `properties.txt` contains a
Expand All @@ -78,4 +77,4 @@ all of the steps, but with modifications so that you're only running it for the
For example, instead of `make slurp-all` you'd run `make slurp-*`.

There are a few other files that will probably need to be added as well, such as `src/ontology/config/*_exclusions.tsv`.
A full list of such things should be found in [this issue](https://github.com/monarch-initiative/mondo-ingest/issues/2).
A full list of such things should be found in [this issue](https://github.com/monarch-initiative/mondo-ingest/issues/2).
4 changes: 0 additions & 4 deletions src/ontology/config/property-map-1.sssom.tsv

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
subject_id object_id
http://purl.org/dc/elements/1.1/source oboInOwl:source
http://www.w3.org/2004/02/skos/core#prefLabel http://www.w3.org/2000/01/rdf-schema#label
http://www.w3.org/2004/02/skos/core#altLabel oboInOwl:hasExactSynonym
http://www.ebi.ac.uk/efo/definition http://purl.obolibrary.org/obo/IAO_0000115
http://www.ebi.ac.uk/efo/reason_for_obsolescence rdfs:comment
http://www.ebi.ac.uk/efo/alternative_term oboInOwl:hasExactSynonym
Expand Down
20 changes: 7 additions & 13 deletions src/ontology/mondo-ingest.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ $(TMPDIR)/ordo_relevant_signature.txt: component-download-ordo.owl | $(TMPDIR)
# - #60 needs to be fixed at source, but a workaround can probably be implemented in this goal
$(COMPONENTSDIR)/omim.owl: $(TMPDIR)/omim_relevant_signature.txt | component-download-omim.owl
if [ $(COMP) = true ]; then $(ROBOT) remove -i $(TMPDIR)/component-download-omim.owl.owl --select imports \
rename --mappings config/property-map-1.sssom.tsv --allow-missing-entities true \
rename --mappings config/property-map-2.sssom.tsv --allow-missing-entities true \
rename --mappings config/property-map.sssom.tsv --allow-missing-entities true --allow-duplicates true \
remove -T $(TMPDIR)/omim_relevant_signature.txt --select complement --select "classes individuals" --trim false \
remove -T config/remove.txt --axioms equivalent \
query \
Expand All @@ -77,8 +76,7 @@ $(COMPONENTSDIR)/omim.owl: $(TMPDIR)/omim_relevant_signature.txt | component-dow
$(COMPONENTSDIR)/ordo.owl: $(TMPDIR)/ordo_relevant_signature.txt config/properties.txt | component-download-ordo.owl
if [ $(COMP) = true ]; then $(ROBOT) remove -i $(TMPDIR)/component-download-ordo.owl.owl --select imports \
merge \
rename --mappings config/property-map-1.sssom.tsv --allow-missing-entities true \
rename --mappings config/property-map-2.sssom.tsv --allow-missing-entities true \
rename --mappings config/property-map.sssom.tsv --allow-missing-entities true --allow-duplicates true \
query \
--update ../sparql/fix_partof.ru \
--update ../sparql/fix_deprecated.ru \
Expand All @@ -95,8 +93,7 @@ $(COMPONENTSDIR)/ordo.owl: $(TMPDIR)/ordo_relevant_signature.txt config/properti

$(COMPONENTSDIR)/ncit.owl: $(TMPDIR)/ncit_relevant_signature.txt | component-download-ncit.owl
if [ $(SKIP_HUGE) = false ] && [ $(COMP) = true ]; then $(ROBOT) remove -i $(TMPDIR)/component-download-ncit.owl.owl --select imports \
rename --mappings config/property-map-1.sssom.tsv --allow-missing-entities true \
rename --mappings config/property-map-2.sssom.tsv --allow-missing-entities true \
rename --mappings config/property-map.sssom.tsv --allow-missing-entities true --allow-duplicates true \
query --update ../sparql/rm_xref_by_prefix.ru \
remove -T $(TMPDIR)/ncit_relevant_signature.txt --select complement --select "classes individuals" --trim false \
remove -T config/properties.txt --select complement --select properties --trim true \
Expand All @@ -106,8 +103,7 @@ $(COMPONENTSDIR)/ncit.owl: $(TMPDIR)/ncit_relevant_signature.txt | component-dow
# todo: See #1 at top of file
$(COMPONENTSDIR)/doid.owl: $(TMPDIR)/doid_relevant_signature.txt | component-download-doid.owl
if [ $(COMP) = true ]; then $(ROBOT) remove -i $(TMPDIR)/component-download-doid.owl.owl --select imports \
rename --mappings config/property-map-1.sssom.tsv --allow-missing-entities true \
rename --mappings config/property-map-2.sssom.tsv --allow-missing-entities true \
rename --mappings config/property-map.sssom.tsv --allow-missing-entities true --allow-duplicates true \
remove -T $(TMPDIR)/doid_relevant_signature.txt --select complement --select "classes individuals" --trim false \
query \
--update ../sparql/fix_omimps.ru \
Expand All @@ -132,8 +128,7 @@ component-download-icd10cm.owl: | $(TMPDIR)
# todo: See #1 at top of file
$(COMPONENTSDIR)/icd10cm.owl: $(TMPDIR)/icd10cm_relevant_signature.txt | component-download-icd10cm.owl
if [ $(COMP) = true ]; then $(ROBOT) merge -i $(TMPDIR)/component-download-icd10cm.owl.owl \
rename --mappings config/property-map-1.sssom.tsv --allow-missing-entities true \
rename --mappings config/property-map-2.sssom.tsv --allow-missing-entities true \
rename --mappings config/property-map.sssom.tsv --allow-missing-entities true --allow-duplicates true \
remove -T $(TMPDIR)/icd10cm_relevant_signature.txt --select complement --select "classes individuals" --trim false \
remove -T $(TMPDIR)/icd10cm_relevant_signature.txt --select individuals \
query \
Expand All @@ -145,8 +140,7 @@ $(COMPONENTSDIR)/icd10cm.owl: $(TMPDIR)/icd10cm_relevant_signature.txt | compone
# todo: See #1 at top of file
$(COMPONENTSDIR)/icd10who.owl: $(TMPDIR)/icd10who_relevant_signature.txt | component-download-icd10who.owl
if [ $(COMP) = true ] ; then $(ROBOT) remove -i $(TMPDIR)/component-download-icd10who.owl.owl --select imports \
rename --mappings config/property-map-1.sssom.tsv --allow-missing-entities true \
rename --mappings config/property-map-2.sssom.tsv --allow-missing-entities true \
rename --mappings config/property-map.sssom.tsv --allow-missing-entities true --allow-duplicates true \
remove -T $(TMPDIR)/icd10who_relevant_signature.txt --select complement --select "classes individuals" --trim false \
remove -T $(TMPDIR)/icd10who_relevant_signature.txt --select individuals \
query \
Expand All @@ -157,7 +151,7 @@ $(COMPONENTSDIR)/icd10who.owl: $(TMPDIR)/icd10who_relevant_signature.txt | compo

$(COMPONENTSDIR)/icd11foundation.owl: $(TMPDIR)/icd11foundation_relevant_signature.txt | component-download-icd11foundation.owl
if [ $(COMP) = true ] ; then $(ROBOT) remove -i $(TMPDIR)/component-download-icd11foundation.owl.owl --select imports \
rename --mappings config/property-map-1.sssom.tsv --allow-missing-entities true \
rename --mappings config/property-map.sssom.tsv --allow-missing-entities true --allow-duplicates true \
rename --mappings config/icd11foundation-property-map.sssom.tsv \
remove -T $(TMPDIR)/icd11foundation_relevant_signature.txt --select complement --select "classes individuals" --trim false \
remove -T $(TMPDIR)/icd11foundation_relevant_signature.txt --select individuals \
Expand Down

0 comments on commit 62e8491

Please sign in to comment.