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

Retrieve mappings from Bioportal for Biolink cats #9

Open
caufieldjh opened this issue Feb 28, 2022 · 2 comments
Open

Retrieve mappings from Bioportal for Biolink cats #9

caufieldjh opened this issue Feb 28, 2022 · 2 comments

Comments

@caufieldjh
Copy link
Collaborator

We have many nodes assigned biolink:NamedThing category by default, but these could be assigned other categories if a mapping is available, e.g. UMLS semantic types.

See API call: https://data.bioontology.org/mappings?ontologies=SNOMEDCT,BIOLINK
(but there is a bug limiting this for now)

@caufieldjh
Copy link
Collaborator Author

@caufieldjh
Copy link
Collaborator Author

caufieldjh commented Apr 8, 2022

As per @jvendetti , a SPARQL query for retrieving mappings from one ontology to another would look like:

SELECT DISTINCT ?s1 ?s2  ?source ?o
WHERE {
{
  GRAPH <http://data.bioontology.org/ontologies/MAPPING_TEST1/submissions/11> {
      ?s1 <http://bioportal.bioontology.org/ontologies/umls/cui> ?o .
  }
  GRAPH <http://data.bioontology.org/ontologies/MAPPING_TEST4/submissions/44> {
      ?s2 <http://bioportal.bioontology.org/ontologies/umls/cui> ?o .
  }
  BIND ('CUI' AS ?source)
}

UNION
{
  GRAPH <http://data.bioontology.org/ontologies/MAPPING_TEST1/submissions/11> {
      ?s1 <http://data.bioontology.org/metadata/def/mappingSameURI> ?o .
  }
  GRAPH <http://data.bioontology.org/ontologies/MAPPING_TEST4/submissions/44> {
      ?s2 <http://data.bioontology.org/metadata/def/mappingSameURI> ?o .
  }
  BIND ('SAME_URI' AS ?source)
}

UNION
{
  GRAPH <http://data.bioontology.org/ontologies/MAPPING_TEST1/submissions/11> {
      ?s1 <http://data.bioontology.org/metadata/def/mappingLoom> ?o .
  }
  GRAPH <http://data.bioontology.org/ontologies/MAPPING_TEST4/submissions/44> {
      ?s2 <http://data.bioontology.org/metadata/def/mappingLoom> ?o .
  }
  BIND ('LOOM' AS ?source)
}

UNION
{
  GRAPH <http://data.bioontology.org/ontologies/MAPPING_TEST1/submissions/11> {
      ?s1 <http://data.bioontology.org/metadata/def/mappingRest> ?o .
  }
  GRAPH <http://data.bioontology.org/ontologies/MAPPING_TEST4/submissions/44> {
      ?s2 <http://data.bioontology.org/metadata/def/mappingRest> ?o .
  }
  BIND ('REST' AS ?source)
}

FILTER ((?s1 != ?s2) || (?source = 'SAME_URI'))
} OFFSET 0 LIMIT 5

where ontology IDs and submission IDs are MAPPING_TEST1, 11 and MAPPING_TEST4, 44, respectively.
See also https://github.com/ncbo/ontologies_linked_data/blob/fc90752c9476cdbd06b102577aec2f9110fbce8d/test/models/test_mappings.rb#L175

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

No branches or pull requests

1 participant