owmeta.evidence module¶
- class owmeta.evidence.Evidence(*args, no_type_decl=False, **kwargs)[source]¶
Bases:
DataObjectA representation which provides evidence, for a group of statements.
Attaching evidence to an set of statements is done like this:
>>> from owmeta.connection import Connection >>> from owmeta.evidence import Evidence >>> from owmeta_core.context import Context
Declare contexts:
>>> ACTX = Context(ident="http://example.org/data/some_statements") >>> BCTX = Context(ident="http://example.org/data/some_other_statements") >>> EVCTX = Context(ident="http://example.org/data/some_statements#evidence")
Make statements in
ACTXandBCTXcontexts:>>> ACTX(Connection)(pre_cell="VA11", post_cell="VD12", number=3) >>> BCTX(Connection)(pre_cell="VA11", post_cell="VD12", number=2)
In
EVCTX, state that a that a certain document supports the set of statements inACTX, but refutes the set of statements inBCTX:>>> doc = EVCTX(Document)(author='White et al.', date='1986') >>> EVCTX(Evidence)(reference=doc, supports=ACTX.rdf_object) >>> EVCTX(Evidence)(reference=doc, refutes=BCTX.rdf_object)
Finally, save the contexts:
>>> ACTX.save_context() >>> BCTX.save_context() >>> EVCTX.save_context()
One note about the
referencepredicate: the reference should, ideally, be an unambiguous link to a peer-reviewed piece of scientific literature detailing methods and data analysis that supports the set of statements. However, in gather data from pre-existing sources, going to that level of specificity may be difficult due to deficient query capability at the data source. In such cases, a broader reference, such as aWebsitewith information which guides readers to a peer-reviewed article supporting the statement is sufficient.- defined_augment()[source]¶
This fuction must return False if
identifier_augment()would raise anIdentifierMissingException. Override it when defining a non-standard identifier for subclasses of DataObjects.
- identifier_augment()[source]¶
Override this method to define an identifier in lieu of one explicity set.
One must also override
defined_augment()to return True whenever this method could return a valid identifier.IdentifierMissingExceptionshould be raised if an identifier cannot be generated by this method.- Raises
IdentifierMissingException
- class_context = owmeta_core.context.ClassContext(ident="http://schema.openworm.org/2020/07/sci")¶
- property reference¶
The resource providing evidence supporting/refuting the attached context
- property refutes¶
A context naming a set of statements which are refuted by the attached reference
- property supports¶
A context naming a set of statements which are supported by the attached reference
- owmeta.evidence.evidence_for(qctx, ctx, evctx=None)[source]¶
Returns an iterable of Evidence
- Parameters
- qctx
object an object supported by evidence. If the object is a
Contextwith no identifier, then the query considers statements ‘staged’ (rather than stored) in the context- ctx
Context Context that bounds where we look for statements about
qctx. The contexts for statements found in this context are the actual targets of Evidence.supports statements.- evctx
Context if the Evidence.supports statements should be looked for somewhere other than
ctx, that can be specified in evctx. optional
- qctx