Skip to content
Back to top
View this page

# prov.constants

`prov.constants` defines the PROV-DM/PROV-O vocabulary as module-level data: one `QualifiedName` constant per record type and per formal attribute (`PROV_ENTITY`, `PROV_ACTIVITY`, `PROV_ATTR_TIME`, …), plus the lookup tables used to translate between them and the Python classes — `PROV_N_MAP` (record type to PROV-N keyword), `PROV_BASE_CLS` (record type to base class), and the various `PROV_ATTRIBUTE*`/`PROV_RECORD*` sets and dicts consulted while parsing and serializing. `prov.model` imports this module with `from prov.constants import *`, so these names are also available as `prov.model.PROV_*`; they are documented here, once, to avoid duplicate entries.

The PROV-DM/PROV-O vocabulary as module-level data.

Defines one `QualifiedName` constant per PROV record type and per formal attribute (`PROV_ENTITY`, `PROV_ACTIVITY`, `PROV_ATTR_TIME`, …), plus the lookup tables used to translate between those constants, PROV-N keywords, and the Python model classes: `PROV_N_MAP` (record type to PROV-N keyword), `PROV_BASE_CLS` (record type to base record type), and the various `PROV_ATTRIBUTE*`/ `PROV_RECORD*` sets and dicts consulted while parsing and serializing.

prov.constants.PROV_N_MAP = {<QualifiedName: prov:Activity>: 'activity', <QualifiedName: prov:Agent>: 'agent', <QualifiedName: prov:Alternate>: 'alternateOf', <QualifiedName: prov:Association>: 'wasAssociatedWith', <QualifiedName: prov:Attribution>: 'wasAttributedTo', <QualifiedName: prov:Bundle>: 'bundle', <QualifiedName: prov:Communication>: 'wasInformedBy', <QualifiedName: prov:Delegation>: 'actedOnBehalfOf', <QualifiedName: prov:Derivation>: 'wasDerivedFrom', <QualifiedName: prov:End>: 'wasEndedBy', <QualifiedName: prov:Entity>: 'entity', <QualifiedName: prov:Generation>: 'wasGeneratedBy', <QualifiedName: prov:Influence>: 'wasInfluencedBy', <QualifiedName: prov:Invalidation>: 'wasInvalidatedBy', <QualifiedName: prov:Membership>: 'hadMember', <QualifiedName: prov:Mention>: 'mentionOf', <QualifiedName: prov:Specialization>: 'specializationOf', <QualifiedName: prov:Start>: 'wasStartedBy', <QualifiedName: prov:Usage>: 'used'}

  Maps each top-level PROV record type QualifiedName to its PROV-N keyword.

prov.constants.ADDITIONAL_N_MAP = {<QualifiedName: prov:Collection>: 'collection', <QualifiedName: prov:EmptyCollection>: 'emptyCollection', <QualifiedName: prov:Organization>: 'organization', <QualifiedName: prov:Person>: 'person', <QualifiedName: prov:Plan>: 'plan', <QualifiedName: prov:PrimarySource>: 'hadPrimarySource', <QualifiedName: prov:Quotation>: 'wasQuotedFrom', <QualifiedName: prov:Revision>: 'wasRevisionOf', <QualifiedName: prov:SoftwareAgent>: 'softwareAgent'}

  Maps PROV-N subtype QualifiedNames (top-level types in e.g. PROV-XML) to their PROV-N keyword; not included in `PROV_N_MAP` itself.

prov.constants.PROV_BASE_CLS = {<QualifiedName: prov:Activity>: <QualifiedName: prov:Activity>, <QualifiedName: prov:Agent>: <QualifiedName: prov:Agent>, <QualifiedName: prov:Alternate>: <QualifiedName: prov:Alternate>, <QualifiedName: prov:Association>: <QualifiedName: prov:Association>, <QualifiedName: prov:Attribution>: <QualifiedName: prov:Attribution>, <QualifiedName: prov:Bundle>: <QualifiedName: prov:Entity>, <QualifiedName: prov:Collection>: <QualifiedName: prov:Entity>, <QualifiedName: prov:Communication>: <QualifiedName: prov:Communication>, <QualifiedName: prov:Delegation>: <QualifiedName: prov:Delegation>, <QualifiedName: prov:Derivation>: <QualifiedName: prov:Derivation>, <QualifiedName: prov:EmptyCollection>: <QualifiedName: prov:Entity>, <QualifiedName: prov:End>: <QualifiedName: prov:End>, <QualifiedName: prov:Entity>: <QualifiedName: prov:Entity>, <QualifiedName: prov:Generation>: <QualifiedName: prov:Generation>, <QualifiedName: prov:Influence>: <QualifiedName: prov:Influence>, <QualifiedName: prov:Invalidation>: <QualifiedName: prov:Invalidation>, <QualifiedName: prov:Membership>: <QualifiedName: prov:Membership>, <QualifiedName: prov:Mention>: <QualifiedName: prov:Mention>, <QualifiedName: prov:Organization>: <QualifiedName: prov:Agent>, <QualifiedName: prov:Person>: <QualifiedName: prov:Agent>, <QualifiedName: prov:Plan>: <QualifiedName: prov:Entity>, <QualifiedName: prov:PrimarySource>: <QualifiedName: prov:Derivation>, <QualifiedName: prov:Quotation>: <QualifiedName: prov:Derivation>, <QualifiedName: prov:Revision>: <QualifiedName: prov:Derivation>, <QualifiedName: prov:SoftwareAgent>: <QualifiedName: prov:Agent>, <QualifiedName: prov:Specialization>: <QualifiedName: prov:Specialization>, <QualifiedName: prov:Start>: <QualifiedName: prov:Start>, <QualifiedName: prov:Usage>: <QualifiedName: prov:Usage>}

  Maps each PROV record/subtype QualifiedName to its base record type QualifiedName (mapping to itself if it has no base type).

prov.constants.PROV_ATTRIBUTE_QNAMES = {<QualifiedName: prov:activity>, <QualifiedName: prov:agent>, <QualifiedName: prov:alternate1>, <QualifiedName: prov:alternate2>, <QualifiedName: prov:bundle>, <QualifiedName: prov:collection>, <QualifiedName: prov:delegate>, <QualifiedName: prov:ender>, <QualifiedName: prov:entity>, <QualifiedName: prov:generalEntity>, <QualifiedName: prov:generatedEntity>, <QualifiedName: prov:generation>, <QualifiedName: prov:influencee>, <QualifiedName: prov:influencer>, <QualifiedName: prov:informant>, <QualifiedName: prov:informed>, <QualifiedName: prov:plan>, <QualifiedName: prov:responsible>, <QualifiedName: prov:specificEntity>, <QualifiedName: prov:starter>, <QualifiedName: prov:trigger>, <QualifiedName: prov:usage>, <QualifiedName: prov:usedEntity>}

  Set of QualifiedName-valued formal attributes of PROV records.

prov.constants.PROV_ATTRIBUTE_LITERALS = {<QualifiedName: prov:endTime>, <QualifiedName: prov:startTime>, <QualifiedName: prov:time>}

  Set of literal-valued (non-QualifiedName) formal attributes of PROV records.

prov.constants.PROV_ATTRIBUTES = {<QualifiedName: prov:activity>, <QualifiedName: prov:agent>, <QualifiedName: prov:alternate1>, <QualifiedName: prov:alternate2>, <QualifiedName: prov:bundle>, <QualifiedName: prov:collection>, <QualifiedName: prov:delegate>, <QualifiedName: prov:endTime>, <QualifiedName: prov:ender>, <QualifiedName: prov:entity>, <QualifiedName: prov:generalEntity>, <QualifiedName: prov:generatedEntity>, <QualifiedName: prov:generation>, <QualifiedName: prov:influencee>, <QualifiedName: prov:influencer>, <QualifiedName: prov:informant>, <QualifiedName: prov:informed>, <QualifiedName: prov:plan>, <QualifiedName: prov:responsible>, <QualifiedName: prov:specificEntity>, <QualifiedName: prov:startTime>, <QualifiedName: prov:starter>, <QualifiedName: prov:time>, <QualifiedName: prov:trigger>, <QualifiedName: prov:usage>, <QualifiedName: prov:usedEntity>}

  All formal attributes of PROV records, QualifiedName- and literal-valued.

prov.constants.PROV_RECORD_ATTRIBUTES = [(<QualifiedName: prov:trigger>, 'prov:trigger'), (<QualifiedName: prov:starter>, 'prov:starter'), (<QualifiedName: prov:generalEntity>, 'prov:generalEntity'), (<QualifiedName: prov:influencer>, 'prov:influencer'), (<QualifiedName: prov:collection>, 'prov:collection'), (<QualifiedName: prov:endTime>, 'prov:endTime'), (<QualifiedName: prov:responsible>, 'prov:responsible'), (<QualifiedName: prov:activity>, 'prov:activity'), (<QualifiedName: prov:influencee>, 'prov:influencee'), (<QualifiedName: prov:time>, 'prov:time'), (<QualifiedName: prov:informant>, 'prov:informant'), (<QualifiedName: prov:specificEntity>, 'prov:specificEntity'), (<QualifiedName: prov:startTime>, 'prov:startTime'), (<QualifiedName: prov:bundle>, 'prov:bundle'), (<QualifiedName: prov:generation>, 'prov:generation'), (<QualifiedName: prov:informed>, 'prov:informed'), (<QualifiedName: prov:plan>, 'prov:plan'), (<QualifiedName: prov:delegate>, 'prov:delegate'), (<QualifiedName: prov:usedEntity>, 'prov:usedEntity'), (<QualifiedName: prov:alternate2>, 'prov:alternate2'), (<QualifiedName: prov:entity>, 'prov:entity'), (<QualifiedName: prov:usage>, 'prov:usage'), (<QualifiedName: prov:agent>, 'prov:agent'), (<QualifiedName: prov:generatedEntity>, 'prov:generatedEntity'), (<QualifiedName: prov:alternate1>, 'prov:alternate1'), (<QualifiedName: prov:ender>, 'prov:ender')]

  `(QualifiedName, str)` pairs for every entry in `PROV_ATTRIBUTES`.

prov.constants.PROV_RECORD_IDS_MAP = {'actedOnBehalfOf': <QualifiedName: prov:Delegation>, 'activity': <QualifiedName: prov:Activity>, 'agent': <QualifiedName: prov:Agent>, 'alternateOf': <QualifiedName: prov:Alternate>, 'bundle': <QualifiedName: prov:Bundle>, 'entity': <QualifiedName: prov:Entity>, 'hadMember': <QualifiedName: prov:Membership>, 'mentionOf': <QualifiedName: prov:Mention>, 'specializationOf': <QualifiedName: prov:Specialization>, 'used': <QualifiedName: prov:Usage>, 'wasAssociatedWith': <QualifiedName: prov:Association>, 'wasAttributedTo': <QualifiedName: prov:Attribution>, 'wasDerivedFrom': <QualifiedName: prov:Derivation>, 'wasEndedBy': <QualifiedName: prov:End>, 'wasGeneratedBy': <QualifiedName: prov:Generation>, 'wasInfluencedBy': <QualifiedName: prov:Influence>, 'wasInformedBy': <QualifiedName: prov:Communication>, 'wasInvalidatedBy': <QualifiedName: prov:Invalidation>, 'wasStartedBy': <QualifiedName: prov:Start>}

  maps each PROV-N keyword back to its record type QualifiedName.

  Type:

    Inverse of `PROV_N_MAP`

prov.constants.PROV_ID_ATTRIBUTES_MAP = {<QualifiedName: prov:activity>: 'prov:activity', <QualifiedName: prov:agent>: 'prov:agent', <QualifiedName: prov:alternate1>: 'prov:alternate1', <QualifiedName: prov:alternate2>: 'prov:alternate2', <QualifiedName: prov:bundle>: 'prov:bundle', <QualifiedName: prov:collection>: 'prov:collection', <QualifiedName: prov:delegate>: 'prov:delegate', <QualifiedName: prov:endTime>: 'prov:endTime', <QualifiedName: prov:ender>: 'prov:ender', <QualifiedName: prov:entity>: 'prov:entity', <QualifiedName: prov:generalEntity>: 'prov:generalEntity', <QualifiedName: prov:generatedEntity>: 'prov:generatedEntity', <QualifiedName: prov:generation>: 'prov:generation', <QualifiedName: prov:influencee>: 'prov:influencee', <QualifiedName: prov:influencer>: 'prov:influencer', <QualifiedName: prov:informant>: 'prov:informant', <QualifiedName: prov:informed>: 'prov:informed', <QualifiedName: prov:plan>: 'prov:plan', <QualifiedName: prov:responsible>: 'prov:responsible', <QualifiedName: prov:specificEntity>: 'prov:specificEntity', <QualifiedName: prov:startTime>: 'prov:startTime', <QualifiedName: prov:starter>: 'prov:starter', <QualifiedName: prov:time>: 'prov:time', <QualifiedName: prov:trigger>: 'prov:trigger', <QualifiedName: prov:usage>: 'prov:usage', <QualifiedName: prov:usedEntity>: 'prov:usedEntity'}

  Maps each formal attribute QualifiedName to its string form.

prov.constants.PROV_ATTRIBUTES_ID_MAP = {'prov:activity': <QualifiedName: prov:activity>, 'prov:agent': <QualifiedName: prov:agent>, 'prov:alternate1': <QualifiedName: prov:alternate1>, 'prov:alternate2': <QualifiedName: prov:alternate2>, 'prov:bundle': <QualifiedName: prov:bundle>, 'prov:collection': <QualifiedName: prov:collection>, 'prov:delegate': <QualifiedName: prov:delegate>, 'prov:endTime': <QualifiedName: prov:endTime>, 'prov:ender': <QualifiedName: prov:ender>, 'prov:entity': <QualifiedName: prov:entity>, 'prov:generalEntity': <QualifiedName: prov:generalEntity>, 'prov:generatedEntity': <QualifiedName: prov:generatedEntity>, 'prov:generation': <QualifiedName: prov:generation>, 'prov:influencee': <QualifiedName: prov:influencee>, 'prov:influencer': <QualifiedName: prov:influencer>, 'prov:informant': <QualifiedName: prov:informant>, 'prov:informed': <QualifiedName: prov:informed>, 'prov:plan': <QualifiedName: prov:plan>, 'prov:responsible': <QualifiedName: prov:responsible>, 'prov:specificEntity': <QualifiedName: prov:specificEntity>, 'prov:startTime': <QualifiedName: prov:startTime>, 'prov:starter': <QualifiedName: prov:starter>, 'prov:time': <QualifiedName: prov:time>, 'prov:trigger': <QualifiedName: prov:trigger>, 'prov:usage': <QualifiedName: prov:usage>, 'prov:usedEntity': <QualifiedName: prov:usedEntity>}

  maps each attribute’s string form back to its QualifiedName.

  Type:

    Inverse of `PROV_ID_ATTRIBUTES_MAP`