Ubergraph Adapter

About

Ubergraph is a SPARQL endpoint serving multiple OBO ontologies, pre-processed with

  • relation-graph

  • information content scores

  • biolink categories

This implementation is a specialization of the sparql interface, tuned for Ubergraph

Note

This is a remote endpoint implementation - as such, throttling is implemented to limit overuse

Interfaces Implemented

This implements most interfaces. It also attempts to implement each in the most performant way, avoiding iterative queries, attempting instead to batch queries into larger SPARQL query

Connecting

Use ubergraph: as a selector.

To restrict queries to a particular ontology, use the ontology ID as a suffix, e.g. ubergraph:uberon

Code

class oaklib.implementations.ubergraph.ubergraph_implementation.UbergraphImplementation(resource: ~oaklib.resource.OntologyResource = None, strict: bool = False, _multilingual: bool = None, autosave: bool = <factory>, exclude_owl_top_and_bottom: bool = <factory>, ontology_metamodel_mapper: ~oaklib.mappers.ontology_metadata_mapper.OntologyMetadataMapper | None = None, _converter: ~curies.api.Converter | None = None, auto_relax_axioms: bool = None, cache_lookups: bool = False, property_cache: ~oaklib.utilities.keyval_cache.KeyValCache = <factory>, _edge_index: ~oaklib.indexes.edge_index.EdgeIndex | None = None, _entailed_edge_index: ~oaklib.indexes.edge_index.EdgeIndex | None = None, _prefix_map: ~typing.Mapping[str, str] | None = None, sparql_wrapper: <module 'SPARQLWrapper' from '/home/runner/.cache/pypoetry/virtualenvs/oaklib-5bvmowLS-py3.9/lib/python3.9/site-packages/SPARQLWrapper/__init__.py'> = None, graph: ~rdflib.graph.Graph = None, _list_of_named_graphs: ~typing.List[str] = None, **_kwargs)[source]

Wraps the Ubergraph sparql endpoint

See: https://github.com/INCATools/ubergraph

This is a specialization of the more generic SparqlImplementation, which has knowledge of some of the specialized patterns found in Ubergraph

An UbergraphImplementation can be initialed by:

>>> from oaklib.implementations.ubergraph.ubergraph_implementation import UbergraphImplementation
>>> adapter = UbergraphImplementation()

or

>>> from oaklib import get_adapter
>>> adapter = get_adapter("ubergraph:")

to use a specific ontology or named graph within ubergraph:

>>> adapter = get_adapter("ubergraph:cl")
class oaklib.implementations.ubergraph.ubergraph_implementation.RelationGraphEnum(value)[source]

triples in UG are organized into different graphs