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

Making retrieval of axiom annotations for synonyms faster #767

Open
matentzn opened this issue May 16, 2024 · 0 comments
Open

Making retrieval of axiom annotations for synonyms faster #767

matentzn opened this issue May 16, 2024 · 0 comments

Comments

@matentzn
Copy link
Contributor

matentzn commented May 16, 2024

I learned now that I can use some blazing fast built-in method for obtaining basic metadata for terms. However, some typical use cases are not covered, including synonym provenance.

For example:

for entity, spv in adapter.synonym_property_values(mondo_terms):
            xrefs = "|".join(spv.xrefs)
            synonym_type = spv.synonymType
            synonym = spv.val
            predicate = spv.pred
            data_subsets.append({
                "id": entity,
                "synonym": synonym,
                "synonym_type": synonym_type,
                "xrefs": xrefs,
                "predicate": predicate,
                "group": mondo_group
            })

takes an enormous amount of time, similar to

runoak -i sqlite:tmp/mondo_paper.db aliases MONDO:0000001 --obo-model

While not using the obo-model (and therefore not getting xrefs etc) is instant. I think this is not just about synonyms - one of the main arguments for oak is that it is faster than SPARQL/OWL because it is using an SQL backend, and this should be true for axiom annotations in general, not just the primary annotations.

EDIT: This SPARQL query takes less than 5 seconds to run, for example, and its a pretty standard for my work. Its unclear how I can replicate this in OAK.

SELECT ?entity ?label ?synonym ?xref ?st1 ?st2 WHERE {
  ?entity rdfs:label ?label .
  ?ax owl:annotatedSource ?entity ;
         owl:annotatedProperty oboInOwl:hasExactSynonym ;
         owl:annotatedTarget ?synonym ;
         oboInOwl:hasDbXref ?xref .
  OPTIONAL {
  	?ax oboInOwl:hasSynonymType ?st1 .
  }
  OPTIONAL {
  	?ax oboInOwl:hasSynonymType ?st2 .
    FILTER(?st1!=?st2)
  }
  FILTER (isIRI(?entity) && STRSTARTS(str(?entity), "http://purl.obolibrary.org/obo/MONDO_"))
}
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