Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
joeflack4 committed Jun 8, 2022
2 parents bdb091a + 38f16f7 commit b17e797
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/ontology/mondo-ingest.Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -160,11 +160,9 @@ mappings: sssom $(ALL_MAPPINGS)
# Documentation for this commands in this section is in: `docs/developer/ordo.md`

report-mapping-annotations:
# python3 -m pip install -r $(RELEASEDIR)/requirements.txt
python3 $(SCRIPTSDIR)/ordo_mapping_annotations/report_mapping_annotations.py

update-jinja-sparql-queries:
# python3 -m pip install -r $(RELEASEDIR)/requirements.txt
python3 $(SCRIPTSDIR)/ordo_mapping_annotations/create_sparql__ordo_replace_annotation_based_mappings.py
python3 $(SCRIPTSDIR)/ordo_mapping_annotations/create_sparql__ordo_mapping_annotations_violation.py

Expand Down Expand Up @@ -213,3 +211,26 @@ deploy-mondo-ingest:
@test $(GHVERSION)
ls -alt $(DEPLOY_ASSETS_MONDO_INGEST)
gh release create $(GHVERSION) --notes "TBD." --title "$(GHVERSION)" --draft $(DEPLOY_ASSETS_MONDO_INGEST)

tmp/mondo-ingest.owl:
wget https://github.com/monarch-initiative/mondo-ingest/releases/latest/download/mondo-ingest.owl -O $@

tmp/mondo.owl:
wget http://purl.obolibrary.org/obo/mondo.owl -O $@

tmp/mondo.sssom.tsv:
wget http://purl.obolibrary.org/obo/mondo/mappings/mondo.sssom.tsv -O $@

tmp/mondo.sssom.ttl: tmp/mondo.sssom.tsv
sssom convert $< -O rdf -o $@

# Merge Mondo, precise mappings and mondo-ingest into one coherent whole for the purpose of querying.

tmp/merged.owl: tmp/mondo.owl tmp/mondo-ingest.owl tmp/mondo.sssom.ttl
$(ROBOT) merge -i tmp/mondo.owl -i tmp/mondo-ingest.owl -i tmp/mondo.sssom.ttl -o $@

$(REPORTDIR)/mondo_ordo_unsupported_subclass.tsv: ../sparql/mondo-ordo-unsupported-subclass.sparql
$(ROBOT) query -i tmp/merged.owl --query $< $@

.PHONY: mondo-ordo-subclass
mondo-ordo-subclass: $(REPORTDIR)/mondo_ordo_unsupported_subclass.tsv
34 changes: 34 additions & 0 deletions src/sparql/mondo-ordo-unsupported-subclass.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix IAO: <http://purl.obolibrary.org/obo/IAO_>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix oboInOwl: <http://www.geneontology.org/formats/oboInOwl#>
prefix def: <http://purl.obolibrary.org/obo/IAO_0000115>
prefix owl: <http://www.w3.org/2002/07/owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT distinct ?sub_o1 ?sub_o2 ?super_o1 ?super_o2 ?sub #?source

WHERE
{
?sub_o1 rdfs:subClassOf* <http://purl.obolibrary.org/obo/MONDO_0000001> ;
rdfs:subClassOf ?super_o1 .
?sub_o2 a owl:Class ;
rdfs:subClassOf* <http://www.orpha.net/ORDO/Orphanet_377788> ;
rdfs:subClassOf ?super_o2 .
?sub_o1 skos:exactMatch ?sub_o2 .
?super_o1 skos:exactMatch ?super_o2 .
?xref_anno a owl:Axiom ;
owl:annotatedSource ?sub_o1 ;
owl:annotatedProperty rdfs:subClassOf ;
owl:annotatedTarget ?super_o1 ;
oboInOwl:source ?source .

FILTER(STRSTARTS(str(?source), "Orphanet:"))

FILTER NOT EXISTS {
?sub_o2 rdfs:subClassOf ?super_o2 .
}
# FILTER(regex(str(?sub),"Orpha"))
FILTER( !isBlank(?sub_o1) && !isBlank(?sub_o2) && !isBlank(?super_o1) && !isBlank(?super_o2))
} LIMIT 20

0 comments on commit b17e797

Please sign in to comment.