-
Notifications
You must be signed in to change notification settings - Fork 4
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
Additional EFO xref context from axioms #19
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,28 @@ | ||||||||||||||||||||||||||||||||||||||
PREFIX mondo: <http://purl.obolibrary.org/obo/mondo#> | ||||||||||||||||||||||||||||||||||||||
PREFIX efo: <http://www.ebi.ac.uk/efo/> | ||||||||||||||||||||||||||||||||||||||
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
SELECT ?efo_id ?xref_id ?mapping_property_id ?efo_uri ?xref_uri ?mapping_property_uri | ||||||||||||||||||||||||||||||||||||||
WHERE { | ||||||||||||||||||||||||||||||||||||||
VALUES ?mapping_property_uri {mondo:closeMatch mondo:exactMatch skos:mappingRelation skos:closeMatch skos:exactMatch skos:broadMatch skos:narrowMatch skos:relatedMatch} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
?efo_uri rdf:type owl:Class . | ||||||||||||||||||||||||||||||||||||||
?efo_uri ?mapping_property_uri ?xref_uri | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
BIND( REPLACE( STR(?efo_uri), "^http.+/([^:]+)_(.+)$", "$1:$2" ) AS ?efo_id ) | ||||||||||||||||||||||||||||||||||||||
BIND( REPLACE( STR(?xref_uri), "^http.+/([^:]+)_(.+)$", "$1:$2" ) AS ?xref_id_dirty ) | ||||||||||||||||||||||||||||||||||||||
BIND( | ||||||||||||||||||||||||||||||||||||||
COALESCE( | ||||||||||||||||||||||||||||||||||||||
IF( STRSTARTS( ?xref_id_dirty, "http://identifiers.org" ), REPLACE( ?xref_id_dirty, "^http.*/(.+)/(.+)$", "$1:$2" ), ?error ), | ||||||||||||||||||||||||||||||||||||||
IF( STRSTARTS( ?xref_id_dirty, "http://linkedlifedata.com/resource/umls/id" ), REPLACE( ?xref_id_dirty, "^http.*/(.+)$", "UMLS:$1" ), ?error ), | ||||||||||||||||||||||||||||||||||||||
IF( STRSTARTS( ?xref_id_dirty, "http://purl.bioontology.org/ontology/ICD10CM" ), REPLACE( ?xref_id_dirty, "^http.*/(.+)$", "ICD10CM:$1" ), ?error ), | ||||||||||||||||||||||||||||||||||||||
IF( STRSTARTS( ?xref_id_dirty, "https://icd.who.int/browse10/2019/en#" ), REPLACE( ?xref_id_dirty, "^http.*/(.+)$", "ICD10:$1" ), ?error ), | ||||||||||||||||||||||||||||||||||||||
IF( STRSTARTS( ?xref_id_dirty, "https://omim.org/entry" ), REPLACE( ?xref_id_dirty, "^http.*/(.+)$", "OMIM:$1" ), ?error ), | ||||||||||||||||||||||||||||||||||||||
IF( STRSTARTS( ?xref_id_dirty, "https://omim.org/phenotypicSeries" ), REPLACE( ?xref_id_dirty, "^http.*/PS(.+)$", "OMIMPS:$1" ), ?error ), | ||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All these special cases are a bit annoying to maintain, but great work figuring them out. Was it just an iterative process of figuring out which URIs are not handled? One option would be to save the URI to CURIE conversion for post-processing in python with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, this was an iterative process
Thanks for the tip, this would be better if we can do it like that. I used
There is also a missing uri_prefix There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes. It's nice that curies handles that. For orphanet, we can replace
Ideal is you call |
||||||||||||||||||||||||||||||||||||||
?xref_id_dirty | ||||||||||||||||||||||||||||||||||||||
) AS ?xref_id | ||||||||||||||||||||||||||||||||||||||
) | ||||||||||||||||||||||||||||||||||||||
BIND( REPLACE( STR(?mapping_property_uri), "^http://purl\\.obolibrary\\.org/obo/mondo#(.+)$", "mondo:$1" ) AS ?mapping_property_id ) | ||||||||||||||||||||||||||||||||||||||
BIND( REPLACE( STR(?mapping_property_id), "^http://www\\.w3\\.org/2004/02/skos/core#(.+)$", "skos:$1" ) AS ?mapping_property_id ) | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you reply to this comment with the head of the output table? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's rename to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok |
Original file line number | Diff line number | Diff line change | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,17 @@ | ||||||||||||||||||||
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | ||||||||||||||||||||
PREFIX owl: <http://www.w3.org/2002/07/owl#> | ||||||||||||||||||||
PREFIX oboInOwl: <http://www.geneontology.org/formats/oboInOwl#> | ||||||||||||||||||||
|
||||||||||||||||||||
SELECT ?efo_id ?xref ?axiom_source | ||||||||||||||||||||
WHERE { | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if there are cases of xrefs that don't have any axioms, i.e. things matched by nxontology-data/nxontology_data/efo/queries/xrefs.rq Lines 28 to 29 in c7b1429
We could do this match first and then make the axiom match OPTIONAL. Or we could decide this query is only for getting xref sources and we don't care about anything without a source. Questions:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There are cases like that, for example
I think that this query should be only for getting xref sources |
||||||||||||||||||||
?axiom rdf:type owl:Axiom. | ||||||||||||||||||||
?axiom owl:annotatedSource ?source. | ||||||||||||||||||||
?axiom owl:annotatedProperty oboInOwl:hasDbXref. | ||||||||||||||||||||
?axiom owl:annotatedTarget ?xref. | ||||||||||||||||||||
|
||||||||||||||||||||
OPTIONAL { ?axiom oboInOwl:source ?axiom_source }. | ||||||||||||||||||||
|
||||||||||||||||||||
BIND( REPLACE( STR(?source), "^http.+/([^:]+)_(.+)$", "$1:$2" ) AS ?efo_id ) | ||||||||||||||||||||
} | ||||||||||||||||||||
|
||||||||||||||||||||
GROUP BY ?efo_id ?xref ?axiom_source | ||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you reply to this comment with the head of the output table? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be nice to add ORDER BY here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can save the tables as output and/or we can include in the nxontology. We'll have to decide how we want to represent this information as node data in networkx. Doing so is tricky because we have to decide to what extent users will want access to rawer forms versus a more consolidated but opinionated format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dhimmel How about saving the table in the output for now, so that users can access this data? We could create a follow up issue to discuss how we can represent this information as node data in networkx.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.