Editors' working copy can change at any time.

Editors' working copy can change at any time.

Introduction

Provenance is defined as a record that describes the people, institutions, entities, and activities, involved in producing, influencing, or delivering a piece of data or a thing in the world. Two companion specifications respectively define PROV-DM, a data model for provenance, allowing such descriptions to be expressed [[PROV-DM]] and a set of constraints that provenance descriptions are expectively to satisfy [[PROV-DM-CONSTRAINTS]].

In this context, PROV-ASN was introduced as a notation to write instances of the data model, as close to its abstract syntax as possible. PROV-ASN is primarily aimed at human consumption. PROV-ASN allows serializations of PROV-DM instances to be written in a technology independent manner. So far, PROV-ASN has been used in the following ways:

PROV-ASN was designed to be as close as possible to PROV-DM without the syntactic bias and modelling constraints that concrete technologies bring with them, e.g., XML's choice between attribute and element, RDF's reliance on triples, or JSON's usage of dictionaries.

The purpose of this document is solely to define the syntax of PROV-ASN. For each construct of PROV-DM, a corresponding ASN expression is introduced, by way of a production in the PROV-ASN grammar presented in this document.

This specification is one of several specifications, referred to as the PROV family of specifications, defining the various aspects that are necessary to achieve the vision of inter-operable exchange of provenance:

Structure of this Document

TODO

PROV-DM Namespace

The PROV-DM namespace is http://www.w3.org/ns/prov-dm/ (TBC).

All the elements, relations, reserved names and attributes introduced in this specification belong to the PROV-DM namespace.

There is a desire to use a single namespace that all specifications of the PROV family can share to refer to common provenance terms. This is ISSUE-224.

Conventions

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [[!RFC2119]].

Grammar Notation

This specification includes a grammar for PROV-ASN expressed using the Extended Backus-Naur Form (EBNF) notation.

Each production rule (or production, for short) in the grammar defines one non-terminal symbol, in the form:

E ::= expression

Within the expression on the right-hand side of a rule, the following expressions are used to match strings of one or more characters:

PROV-DM Core

Instances of the PROV-DM data model are expressed in PROV-ASN by a text conformant with the toplevel production expression of the grammar. These expressions are grouped in two categories: elementExpression (see section Element) and relationExpression (see section Relation).

expression ::= elementExpression | relationExpression

elementExpression ::= entityExpression | activityExpression | agentExpression | noteExpression

relationExpression ::= generationExpression | usageExpression | derivationExpression | activityAssociationExpression | responsibilityExpression | startExpression | endExpression | alternateExpression | specializationExpression | annotationExpression

Element

PROV-DM elements can be entities, activities, agents, or notes. This section defines a production for the textual representation of each of these element types.

Entity

An entity's text matches the entityExpression production.

entityExpression ::= entity ( identifier optional-attribute-values )

optional-attribute-values ::= , [ attribute-values ]
attribute-values ::= attribute-value | attribute-value , attribute-values
attribute-value ::= attribute = Literal
entity(tr:WD-prov-dm-20111215)
entity(tr:WD-prov-dm-20111215, [ prov:type="document" ])
entity(tr:WD-prov-dm-20111215, [ prov:type="document", ex:version=2 ])

Activity

An activity's text matches the activityExpression production.

activityExpression ::= activity ( identifier , time , time optional-attribute-values )
activity(ex:edit1,,)
activity(ex:edit1,,,[prov:type="edit"])
activity(ex:a0, 2011-11-16T16:00:00,,[prov:type="createFile"])
activity(ex:a0, 2011-11-16T16:00:00, 2011-11-16T16:00:01, [prov:type="createFile"])

Agent

An agent's text matches the agentExpression production.

agentExpression ::= agent ( identifier optional-attribute-values )
agent(ag4)
agent(ag4, [ prov:type="prov:Human" %% xsd:QName, ex:name="David" ])

Note

A note's text matches the noteExpression production.

noteExpression ::= note ( identifier , attribute-values )
note(ann1,[ex:color="blue", ex:screenX=20, ex:screenY=30])

Relation

PROV-DM relations can be generation, usage, derivation, activity association, responsibility chain, activity start, activity end, alternate, specialization, or annotations. This section defines a production for the textual representation of each of these relation types.

Generation

A generation's text matches the generationExpression production.

generationExpression ::= wasGeneratedBy ( identifier , eIdentifier , aIdentifier , time optional-attribute-values )
wasGeneratedBy(tr:WD-prov-dm-20111215, ex:edit1)
wasGeneratedBy(tr:WD-prov-dm-20111215, ex:edit1, 2011-11-16T16:00:00)
wasGeneratedBy(ex:g1, tr:WD-prov-dm-20111215, ex:edit1)
wasGeneratedBy(e2, a1, [ex:fct="save"])     

Usage

A usage's text matches the usageExpression production.

usageExpression ::= used ( identifier , aIdentifier , eIdentifier , time optional-attribute-values )
used(ex:pub2, ar3:0111)
used(ex:pub2, ar3:0111, 2011-11-16T16:00:00)
used(ex:u1, ex:pub2, ar3:0111)
used(a1,e1,[ex:fct="load"])

Activity Association

An activity association's text matches the activityAssociationExpression productions of the grammar defined in this specification document.

activityAssociationExpression ::= wasAssociatedWith ( identifier, aIdentifier, agIdentifier ,eIdentifier optional-attribute-values )
wasAssociatedWith(ex:pub2, w3:Consortium)
wasAssociatedWith(ex:pub2, w3:Consortium  @ pr:rec-advance)
wasAssociatedWith(ex:pub2, w3:Consortium  @ pr:rec-advance, [prov:role="funder"])

Activity Start and End

Activity start and end texts match the startExpression and endExpression productions of the grammar defined in this specification document.

startExpression ::= wasStartedBy ( identifier, aIdentifier, agIdentifier optional-attribute-values )
endExpression ::= wasEndedBy ( identifier, aIdentifier, agIdentifier optional-attribute-values )

Responsibility Chain

responsibilityExpression ::= actedOnBehalfOf ( identifier, agIdentifier , agIdentifier , aIdentifier optional-attribute-values )
actedOnBehalfOf(ag1,ag2)
actedOnBehalfOf(ag1,ag2,a)
actedOnBehalfOf(ag1,ag2,[prov:type="delegation"])
actedOnBehalfOf(ag2,ag3,a,[prov:type="contract"])

Derivation

A derivation record's text matches the derivationExpression production.

derivationExpression ::= wasDerivedFrom ( identifier, eIdentifier , eIdentifier , aIdentifier , gIdentifier , uIdentifier optional-attribute-values )
| wasDerivedFrom ( identifier, eIdentifier , eIdentifier , time optional-attribute-values )

The first clause of the alternative, where the activity, generation and usage record identifiers are present formalizes a derivation record is precise-1. The second clause of the alternative, with optional time formalizes imprecise records. The distinction between imprecise-1 and imprecise-n is made by the attribute prov:steps.

wasDerivedFrom(tr:WD-prov-dm-20111215, tr:WD-prov-dm-20111018)
wasDerivedFrom(tr:WD-prov-dm-20111215, tr:WD-prov-dm-20111018)
wasDerivedFrom(e2, e1, a, g2, u1)

Alternate and Specialization

An alternate relation's text matches the alternateExpression production.

alternateExpression ::= alternateOf ( eIdentifier , eIdentifier )
alternateOf(tr:WD-prov-dm-20111215,ex:alternate-20111215)

A specialization relation's text matches the specializationExpressionproduction.

specializationExpression ::= specializationOf ( eIdentifier , eIdentifier )
specializationOf(tr:WD-prov-dm-20111215,tr:prov-dm)

Annotation

A note's text matches the noteExpression production.

annotationExpression ::= hasAnnotation ( identifier , nIdentifier optional-attribute-values )
hasAnnotation(tr:WD-prov-dm-20111215,ex2:n1)

Further Expressions

This section defines further expressions of PROV-ASN.

Namespace Declaration

namespaceDeclarations ::= | defaultNamespaceDeclaration | namespaceDeclaration namespaceDeclaration
namespaceDeclaration ::= prefix prefix IRI
defaultNamespaceDeclaration ::= default IRI

In PROV-ASN, the prefix prov is reserved and denotes the PROV namespace.

Identifier

identifier ::= qualifiedName
eIdentifier ::= identifier (intended to denote an entity)
aIdentifier ::= identifier (intended to denote an activity)
agIdentifier ::= identifier (intended to denote an agent)
gIdentifier::= identifier (intended to denote a generation)
uIdentifier::= identifier (intended to denote a usage)
nIdentifier::= identifier (intended to denote a note)
accIdentifier::= identifier (intended to denote an account)

qualifiedName  ::= prefixedName | unprefixedName
prefixedName  ::= prefix : localPart
unprefixedName  ::= localPart
prefix  ::= a name without colon compatible with the NC_NAME production [[!XML-NAMES]]
localPart  ::= a name without colon compatible with the NC_NAME production [[!XML-NAMES]]
Note that XML NC_NAME don't allow local identifiers to start with a number. Instead, should we use the productions used in SPARQL or TURTLE?

Attribute

An attribute's text matches the attribute production.

attribute ::= qualifiedName

The reserved attributes in the PROV namespace are the following.

  1. prov:label
  2. prov:location
  3. prov:role
  4. prov:steps
  5. prov:type

Literal

A Literal's text matches the Literal production.

Literal  ::= typedLiteral | convenienceNotation
typedLiteral ::= quotedString %% datatype
datatype ::= qualifiedName
convenienceNotation  ::= stringLiteral | intLiteral
stringLiteral ::= quotedString
quotedString ::= a finite sequence of characters in which " (U+22) and \ (U+5C) occur only in pairs of the form \" (U+5C, U+22) and \\ (U+5C, U+5C), enclosed in a pair of " (U+22) characters
intLiteral ::= a finite-length sequence of decimal digits (#x30-#x39) with an optional leading negative sign (-)

The non terminals stringLiteral and intLiteral are syntactic sugar for quoted strings with datatype xsd:string and xsd:int, respectively.

In particular, a PROV-DM Literal may be an IRI-typed string (with datatype xsd:anyURI); such IRI has no specific interpretation in the context of PROV-DM.

Reserved Type Values

The reserved type values in the PROV namespace are the following.

  1. prov:AccountEntity
  2. prov:ComputingSystem
  3. prov:Human
  4. prov:Organization
  5. prov:Plan
  6. prov:Collection
  7. prov:EmptyCollection

Time Values

Time instants are defined according to xsd:dateTime [[!XMLSCHEMA-2]].

Common Relations

TO ADD

Expression Container

An expression container is a house-keeping construct of PROV-ASN capable of packaging up PROV-ASN expressions and namespace declarations. An expression container forms a self-contained package of provenance descriptions for the purpose of exchanging them. An expression container may be used to package up PROV-ASN expressions in response to a request for the provenance of something ([[PROV-AQ]]).

Given its status of house keeping construct for the purpose of exchanging provenance expressions, an expression container is not defined as a PROV-ASN expression (production expression).

An expression container, written container decls exprs endContainer in PROV-ASN, contains:

An expression container's text matches the expressionContainer production.

expressionContainer ::= container namespaceDeclarations expression endContainer

The following container contains expressions related to the provenance of entity e2.

container

  prefix ex: http://example.org/,

  entity(e2, [ prov:type="File", ex:path="/shared/crime.txt", ex:creator="Alice", 
             ex:content="There was a lot of crime in London last month."])
  activity(a1, 2011-11-16T16:05:00,,[prov:type="edit"])
  wasGeneratedBy(e2, a1, [ex:fct="save"])     
  wasAssociatedWith(a1, ag2, [prov:role="author"])
  agent(ag2, [ prov:type="prov:Person" %% xsd:QName, ex:name="Bob" ])

endContainer

This container could for instance be returned as the result of a query to a provenance store for the provenance of entity e2 [[PROV-AQ]].

Clarify what records are. This is ISSUE-208.

Account

PROV-DM has introduced a notion of account by which a set of provenance descriptions can be bundled up and named. PROV-DM assumes the existence of mechanisms to implement accounts, but such mechanisms remain outside its scope. It is suggested that specific serializations may offer solutions to name bundles of descriptions.

Given that the primary motivation for PROV-ASN is to provide a notation aimed at human consumption, it is therefore appropriate to introduce a notation for accounts, which would include an account name and a bundle of expressions.

An account, written account(id, exprs) in PROV-ASN, contains:

In PROV-ASN, an account's text matches the accountExpression production of the grammar.

accountExpression ::= account ( identifier , expression )

It is also useful to package up one or more account expressions in an expression container, for interchange purpose. Hence, expressionContainer is revised as follows.

expressionContainer ::= container namespaceDeclarations expression endContainer
| container namespaceDeclarations accountExpression endContainer

The following container

container
  prefix ex: http://example.org/,

  account(ex:acc1,...)
  account(ex:acc2,...)
endContainer

illustrates how two accounts with identifiers ex:acc1 and ex:acc2 can be returned in a PROV-ASN serialization of the provenance of something.

The following container

container
  prefix ex: http://example.org/,
  ...

  account(ex:acc1,
      entity(tr:WD-prov-dm-20111018, [ prov:type="pr:RecsWD" %% xsd:QName ])
      entity(tr:WD-prov-dm-20111215, [ prov:type="pr:RecsWD" %% xsd:QName ])
      ...
      wasAssociatedWith(ex:pub2, w3:Consortium  @ pr:rec-advance))

  account(ex:acc2,
      entity(ex:acc1, [prov:type="prov:AccountEntity" %% xsd:QName ])
      wasAttributedTo(ex1:acc1,w3:Consortium))

endContainer

illustrates a first account, with identifier ex:acc1, containing expressions describing the provenance of the technical report tr:WD-prov-dm-20111215, and a second account ex:acc2, describing the provenance of the first. In account ex:acc2, ex:acc1 is the identifier of an entity of type prov:AccountEntity.