Basic Interface¶
- exception antelope.interfaces.ibasic.BasicRequired¶
Bases:
Exception
Default exception to indicate that the requested method cannot be invoked without an implementation of the basic interface (and none could be found).
- exception antelope.interfaces.ibasic.EntityNotFound¶
Bases:
Exception
An exception of generic usefulness.
- exception antelope.interfaces.ibasic.NoAccessToEntity¶
Bases:
Exception
Used when the actual entity is not accessible, i.e. when a ref cannot dereference itself
- exception antelope.interfaces.ibasic.ItemNotFound¶
Bases:
Exception
not a KeyError
- class antelope.interfaces.ibasic.BasicInterface¶
Bases:
AbstractQuery
BasicInterface core methods.
These are methods for retrieving objects and accessing documentary information about them. The basic interface should provide access to the most authoritative source of information about a data resource.
- validate()¶
This method should return True whenever the implementation is attached to a valid data source that is capable of answering questions. The existence of a basic implementation is necessary and sufficient for a query to be valid.
- Returns:
bool
- get(eid, **kwargs)¶
Basic entity retrieval– should be supported by all implementations :param eid: :param kwargs: :return:
- properties(external_ref, **kwargs)¶
Get an entity’s list of properties :param external_ref: :param kwargs: :return:
- get_item(external_ref, item)¶
access an entity’s properties. This requires de-referencing the query to the true entity. This method is used to access essentially all documentary information about an object. :param external_ref: the entity’s identifier :param item: the desired property :return:
- get_uuid(external_ref)¶
- get_context(term, **kwargs)¶
Return the context matching the specified term :param term: :param kwargs: :return:
- get_reference(external_ref)¶
- synonyms(item, **kwargs)¶
Return a list of synonyms for the object – quantity, flowable, or compartment :param item: :return: list of strings
- is_lcia_engine(**kwargs)¶
A key question in the quantity interface is the way terms are managed. An archive’s Term Manager determines how input terms are interpreted and how characterizations are looked up. There are two main footings:
the terms specified by the source are authentic / canonical and should be reproduced
terms from different data sources refer to the same concept, and the concept should be returned.
A provincial term manager considers the local archive (to which it is attached) to be the source of all truth. It will return flowables and contexts exactly as they are defined in the native data source. In this case, is_lcia_engine() returns False.
if the term manager is an LciaEngine, it uses a standard set of contexts and flowables, and provides routes to add new synonyms for flowables/contexts and to report new flowables or contexts. Ultimately the objective is to manage characterization + knowledge of both elementary and intermediate flows. In this case, is_lcia_engine() returns True.
- Parameters:
kwargs
- Returns:
bool
- bg_lcia(process, query_qty=None, ref_flow=None, **kwargs)¶
Basic interface permits cumulative LCIA scores to be retrieved, but only if values=True
- Parameters:
process
query_qty – if omitted, a catalog may select a default LCIA method
ref_flow
kwargs
- Returns: