-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ac4cb3
commit b041d85
Showing
6 changed files
with
216 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# SPARQL query: Extract all ORDO mappings to SSSOM (with SKOS-conversion) | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> | ||
PREFIX obo: <http://purl.obolibrary.org/obo/> | ||
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#> | ||
PREFIX ORDO: <http://www.orpha.net/ORDO/Orphanet_> | ||
PREFIX doid: <http://purl.obolibrary.org/obo/doid#> | ||
|
||
SELECT ?subject_id ?subject_label ?predicate_id ?object_id ?status | ||
WHERE { | ||
?class skos:notation ?subject_id ; | ||
rdfs:label ?subject_label ; | ||
oboInOwl:hasDbXref ?object_id . | ||
FILTER(STRSTARTS(?subject_id, "ORPHA:")) | ||
|
||
OPTIONAL { | ||
?xref_annot owl:annotatedSource ?class ; | ||
owl:annotatedProperty oboInOwl:hasDbXref ; | ||
owl:annotatedTarget ?object_id ; | ||
obo:ECO_0000218 ?xref_eco . | ||
|
||
BIND( | ||
REPLACE( | ||
str(?xref_eco), # convert to string to avoid possible language tag mismatches | ||
".*(E|NTBT|BTNT|W|ND)(.|\\n)*", | ||
"$1" | ||
) AS ?xref_type | ||
) | ||
|
||
VALUES (?xref_type ?predicate_id) { | ||
("E" skos:exactMatch) | ||
("BTNT" skos:narrowMatch) | ||
("NTBT" skos:broadMatch) | ||
("ND" doid:undefinedMatch) | ||
("W" doid:notMatch) | ||
} | ||
} | ||
|
||
OPTIONAL { | ||
?class rdfs:subClassOf* ?inactive . | ||
?inactive rdfs:subClassOf ORDO:C041 ; | ||
rdfs:label ?inactive_label . | ||
} | ||
|
||
# clean up output: F where missing and no language tags | ||
BIND( if( BOUND( ?inactive_label ), ?inactive_label, "active") AS ?status) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# SPARQL query: Extract all ORDO mappings to SSSOM | ||
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> | ||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> | ||
PREFIX obo: <http://purl.obolibrary.org/obo/> | ||
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#> | ||
PREFIX ORPHA: <http://www.orpha.net/ORDO/Orphanet_> | ||
|
||
SELECT ?subject_id ?subject_label ?predicate_id ?predicate_modifier ?object_id ?status | ||
WHERE { | ||
VALUES ?predicate_id { oboInOwl:hasDbXref } | ||
?class skos:notation ?subject_id ; | ||
rdfs:label ?subject_label ; | ||
?predicate_id ?object_id . | ||
FILTER(STRSTARTS(?subject_id, "ORPHA:")) | ||
|
||
OPTIONAL { | ||
?xref_annot owl:annotatedSource ?class ; | ||
owl:annotatedProperty ?predicate_id ; | ||
owl:annotatedTarget ?object_id ; | ||
obo:ECO_0000218 ?xref_eco . | ||
|
||
BIND( | ||
REPLACE( | ||
str(?xref_eco), # convert to string to avoid possible language tag mismatches | ||
".*(E|NTBT|BTNT|W|ND)(.|\\n)*", | ||
"$1" | ||
) AS ?predicate_modifier | ||
) | ||
} | ||
|
||
OPTIONAL { | ||
?class rdfs:subClassOf* ?inactive . | ||
?inactive rdfs:subClassOf ORPHA:C041 ; | ||
rdfs:label ?inactive_label . | ||
} | ||
|
||
# clean up output: F where missing and no language tags | ||
BIND( if( BOUND( ?inactive_label ), ?inactive_label, "active") AS ?status) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.