Abstract

PROV-DM, the PROV data model, is a data model for provenance that describes
the entities, people and activities involved in
producing a piece of data or thing.
PROV-DM is structured in six components, dealing with:
(1) entities and activities, and the time at which they were created, used, or ended;
(2) agents bearing responsibility for entities that were generated and activities that happened;
(3) derivations of entities from entities;
(4) properties to link entities that refer to the same thing;
(5) collections forming a logical structure for its members;
(6) a simple annotation mechanism.

To provide examples of the PROV data model, the PROV notation (PROV-N) is introduced: aimed at human consumption, PROV-N allows serializations of PROV
instances to be created in a compact manner. PROV-N facilitates the
mapping of the PROV data model to concrete syntax, and is used as the basis for a
formal semantics of PROV. The purpose of this document is to define the PROV-N notation.

Status of This Document

This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.

PROV Family of Specifications

This document is part of the PROV family of specifications, a set of specifications defining various aspects that are necessary to achieve the vision of inter-operable
interchange of provenance information in heterogeneous environments such as the Web. The specifications are:

PROV-DM, the PROV data model for provenance;

PROV-CONSTRAINTS, a set of constraints applying to the PROV data model;

PROV-O, the PROV ontology, an OWL-RL ontology allowing the mapping of PROV to RDF;

PROV-AQ, the mechanisms for accessing and querying provenance;

PROV-PRIMER, a primer for the PROV data model;

PROV-SEM, a formal semantics for the PROV data model;

PROV-XML, an XML schema for the PROV data model.

How to read the PROV Family of Specifications

The primer is the entry point to PROV offering an introduction to the provenance model.

The Linked Data and Semantic Web community should focus on PROV-O defining PROV classes and properties specified in an OWL-RL ontology. For further details, PROV-DM and PROV-CONSTRAINTS specify the constraints applicable to the data model, and its interpretation. PROV-SEM provides a mathematical semantics.

The XML community should focus on PROV-XML defining an XML schema for PROV. Further details can also be found in PROV-DM, PROV-CONSTRAINTS, and PROV-SEM.

Developers seeking to retrieve or publish provenance should focus on PROV-AQ.

Readers seeking to implement other PROV serializations
should focus on PROV-DM and PROV-CONSTRAINTS. PROV-O, PROV-N, PROV-XML offer examples of mapping to RDF, text, and XML, respectively.

First Public Working Draft

This is the first public release of the PROV-N
document. Following feedback, the Working Group has decided to
reorganize the PROV-DM document substantially, separating the data model,
from its constraints, and the notation used to illustrate it. The
PROV-N release is synchronized with the release of the PROV-DM, PROV-O,
PROV-PRIMER, and PROV-CONSTRAINTS documents.

Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.

1. 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 provenance descriptions to be expressed [PROV-DM] and a set of constraints that provenance descriptions are expected to satisfy [PROV-CONSTRAINTS].

1.1 Purpose of this Document and target audience

A key goal of PROV is the specification of a machine-processable data model for provenance. However, communicating provenance between humans is also important when teaching, illustrating, formalizing, and discussing provenance-related issues.
With these two requirements in mind, this document introduces PROV-N, a syntax notation designed to write instances of the PROV data model according to the following design principles:

Technology independence. PROV-N provides a simple syntax that can be mapped to several technologies.

Human readability. PROV-N follows a functional syntax style that is meant to be easily human-readable so it can be used in illustrative examples, such as those presented in the PROV documents suite;

Formality. PROV-N is defined through a formal grammar amenable to be used with parser generators.

PROV-N has several known uses:

It is the notation used in the examples found in [PROV-DM], as well as in the definition of PROV constraints [PROV-CONSTRAINTS];

It is a source language for the encoding of PROV data model instances into a variety of target languages, including amongst others RDF [PROV-RDF] and XML [PROV-XML];

It provides the basis for a formal semantics of the PROV data model [PROV-SEM], in which an interpretation is given to each element of the PROV-N language.

This document introduces the PROV-N grammar along with examples of its usage.

Its target audience is twofold:

Developers of provenance management applications, as well as implementors of new PROV data model encodings, and thus in particular of PROV-N parsers. These readers may be interested in the entire structure of the grammar, starting from the top level nonterminal container.

Readers of the [PROV-DM] and of [PROV-CONSTRAINTS] documents, who are interested in the details of the formal language underpinning the notation used in the examples and in the definition of the constraints. Those readers may find the expression nonterminal a useful entry point into the grammar.

1.2 Structure of this Document

This document defines a grammar using the Extended Backus-Naur Form (EBNF) notation. Its productions correspond to PROV data model types and relations.

All other namespace prefixes are used in examples only. In particular, URIs starting with "http://example.com" represent some application-dependent URI [URI]

2. General grammar considerations

2.1 Functional-style Syntax

PROV-N adopts a functional-style syntax consisting of a predicate name and an ordered list of terms.
All PROV data model relations involve two primary elements, the subject and the object, in this order. Furthermore, some expressions also admit additional elements that further characterize it.

The following expression should be read as "e2 was derived from e1". Here e2 is the subject, and e1 is the object.

wasDerivedFrom(e2, e1)

In the following expressions, the optional activity a along with the generation and usage identifiers, and timestamps have been added to further qualify the derivation:

2.2 EBNF Grammar

The grammar is specified using the Extended Backus-Naur Form (EBNF) notation.

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

E ::= term

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

E: matches term satisfying rule for symbol E.

abc: matches the literal string inside the single quotes.

term: optional term, matches term or nothing.

term: matches one or more occurrences of term.

term: matches zero or more occurrences of term.

term | term: matches one of the two terms.

The grammar is centered on nonterminals for various types of expression. The main production is introduced here below as it reflects the rationale for the design of the entire grammar. Note that parser developers may use the top level container nonterminal as a starting point instead.

A PROV-N document consists of a collection of expressions, wrapped in an expression container with some namespace declarations, such that the text for an element matches the corresponding expression production of the grammar.

2.3 Optional terms in expressions

Some terms in an expression may be optional. For example:

wasDerivedFrom(e2, e1, a, g2, u1)
wasDerivedFrom(e2, e1)

In a derivation expression, the activity, generation, and usage are optional terms. They are specified in the first derivation, but not in the second.

activity(a2, 2011-11-16T16:00:00, 2011-11-16T16:00:01)
activity(a1)

The start and end times for Activity a1 are optional. They are specified in the first expression, but not in the second.

The general rule for optionals is that, if none of the optionals are used in the expression, then they are simply omitted, resulting in a simpler expression as in the examples above.

However, it may be the case that only some of the optional terms are omitted. Because the position of the terms in the expression matters, an additional marker must be used to indicate that a particular term is not available. The symbol - is used for this purpose.

In the first expression below, all optionals are specified. However in the second, only the last one is specified, forcing the use of the marker for the missing terms. In the last, no marker is necessary because all remaining optionals after a are missing.

Note that the more succinct form is just shorthand for a complete expression with all the markers specified:

activity(a1)
activity(a1, -, -)

2.4 Identifiers and attributes

Most expressions defined in the grammar include the use of two terms: an identifier for the predicate, and a set of attribute-value pairs, delimited by square brackets. Both are optional (unless specified otherwise). By convention, the identifier is the first term in any expression, and the set of attribute-value pairs is the last.

Consistent with the convention on optional terms, the '-' marker can be used when the identifier is not available. Additionally, the grammar rules are defined in such a way that the optional identifier can be omitted altogether with no ambiguity arising.

Derivation has an optional identifier. In the first expression, the identifier is not available. It is explicit in the second, and marked by a - in the third.

3. PROV-N Productions per Component

This section introduces grammar productions for each expression, followed by small examples illustrating the use of expressions in PROV-N. Strings conforming to the grammar are valid expressions in the PROV-N language.

3.1.2 Activity

Here ex:a10 is the optional activity identifier, 2011-11-16T16:00:00 and 2011-11-16T16:00:01 are the optional start and end times for the activity, and [prov:type="createFile"] are optional attributes.

The remaining examples show cases where some of the optionals are omitted.

Here ex:g1 is the optional generation identifier, tr:WD-prov-dm-20111215 is the identifier of the entity being generated,
ex:edit1 is the optional identifier of the generating activity, 2011-11-16T16:00:00 is the optional generation time, and [ex:fct="save"] are optional attributes.

The remaining examples show cases where some of the optionals are omitted.

Even though the production generationExpression allows for expressions wasGeneratedBy(e2, -, -) and wasGeneratedBy(-, e2, -, -), these expressions are not valid in PROV-N, since
at least one of activity, time, or attributesmust be present.

3.1.4 Usage

Here ex:u1 is the optional usage identifier, ex:act2 is the identifier of the using activity,
ar3:0111 is the identifier of the entity being used,
2011-11-16T16:00:00 is the optional usage time, and [ex:fct="load"] are optional attributes.

The remaining examples show cases where some of the optionals are omitted.

3.1.5 Start

Here s is the optional start identifier, ex:act2 is the identifier of the starting activity,
ar3:0111 is the identifier of the entity that triggered the activity start,
2011-11-16T16:00:00 is the optional usage time, and [ex:param="a"] are optional attributes.

The remaining examples show cases where some of the optionals are omitted.

Note: Even though the production startExpression allows for expressions wasStartedBy(e2, -, -) and wasStartedBy(-, e2, -, -), these expressions are not valid in PROV-N,
since
at least one of trigger, time, or attributesmust be present.

3.1.6 End

Here s is the optional start identifier, ex:act2 is the identifier of the ending activity,
ex:trigger is the identifier of the entity that triggered the activity end,
2011-11-16T16:00:00 is the optional usage time, and [ex:param="a"] are optional attributes.

The remaining examples show cases where some of the optionals are omitted.

Note:Even though the production endExpression allows for expressions wasEndedBy(e2, -, -) and wasEndedBy(-, e2, -, -), these expressions are not valid in PROV-N,
since
at least one of trigger, time, and attributesmust be present.

Here ex:i1 is the optional invalidation identifier, tr:WD-prov-dm-20111215 is the identifier of the entity being invalidated,
ex:edit1 is the optional identifier of the invalidating activity, 2011-11-16T16:00:00 is the optional invalidation time, and [ex:fct="save"] are optional attributes.

The remaining examples show cases where some of the optionals are omitted.

Even though the production invalidationExpression allows for expressions wasInvalidatedBy(e2, -, -) and wasInvalidatedBy(-, e2, -, -), these expressions are not valid in PROV-N, since
at least one of activity, time, or attributesmust be present.

3.1.8 Communication

Here ex:inf1 is the optional communication identifier, ex:a1 is the identifier of the informed activity,
ex:a2 is the identifier of the informant activity,
and [ex:param1="a", ex:param2="b"] are optional attributes.

The remaining examples show cases where some of the optionals are omitted.

3.1.9 Start by Activity

Here s is the optional start-by-activity identifier, ex:a1 is the identifier of the starting activity,
ex:a2 is the identifier of the activity that started ex:a1,
and [ex:param1="a", ex:param2="b"] are optional attributes.

The remaining examples show cases where some of the optionals are omitted.

3.2.2 Attribution

Here id is the optional attribution identifier, e is an entity identifier,
ag is the identifier of the agent to whom the entity is abscribed,
and [ex:license="cc:attributionURL" %% "xsd:QName"] are optional attributes.

The remaining examples show cases where some of the optionals are omitted.

Here ex:agas is the optional attribution identifier,
ex:a1 is an activity identifier,
ex:ag1 is the optional identifier of the agent associated to the activity,
ex:e1 is the optional identifier of the plan used by the agent in the context of the activity,
and [ex:param1="a", ex:param2="b"] are optional attributes.

The remaining examples show cases where some of the optionals are omitted.

Note:The production associationExpression allows for expressions wasAssociatedWith(a, -, -) and wasAssociatiedWith(-, a, -, -). However, these expressions are not valid in PROV-N,
because at least one of agent or planmust be present.

3.2.4 Responsibility

Here act1 is the optional attribution identifier,
ag1 is the identifier for the subordinate agent,
ag2 is the identifier of the responsible agent,
a is the optional identifier of the activity for which the responsibility link holds,
and [prov:type="contract"] are optional attributes.

The remaining examples show cases where some of the optionals are omitted.

Here
d is the optional derivation identifier,
e2 is the identifier for the entity being derived,
e1 is the identifier of the entity from which e2 is derived,
a is the optional identifier of the activity which used/generated the entities,
g2 is the optional identifier of the generation,
u1 is the optional identifier of the usage,
and [prov:comment="a righteous derivation"] are optional attributes.

The remaining examples show cases where some of the optionals are omitted.

Here
rev1 is the optional revision identifier,
tr:WD-prov-dm-20111215 is the identifier of the revised entity,
tr:WD-prov-dm-20111018 is the identifier of the original entity,
w3:Consortium is the optional identifier of the agent involved in the revision,
and [prov:comment="??"] ) are optional attributes.

The remaining examples show cases where some of the optionals are omitted.

Here
quoteId1 is the optional revision identifier,
ex:blockQuote is the identifier of the entity that represents the quote (the partial copy)
ex:blog is the identifier of the original entity being quoted,
ex:Luc is the optional identifier of the agent who performs the quoting,
ex:Paul is the optional identifier of the agent to whom the original entity is attributed,
and [] is the (empty) optional set of attributes.

The remaining examples show cases where some of the optionals are omitted.

3.3.4 Original Source

Here
src1 is the optional original source identifier,
ex:e1 is the identifier of the derived entity,
ex:e2 is the identifier of the original source entity,
and [ex:param="a"] is the optional set of attributes.

The remaining examples show cases where some of the optionals are omitted.

Here
id is the optional insertion identifier,
c1 is the identifier for the collection after the insertion,
c is the identifier for the collection before the insertion,
{("k1", v1), ("k2", v2)} is the set of key-value pairs that have been inserted in
c,
and [] is the optional (empty) set of attributes.

The remaining examples show cases where some of the optionals are omitted.

3.5.2 Removal

Here
id is the optional removal identifier,
c1 is the identifier for the collection after the removal,
c is the identifier for the collection before the removal,
{("k1", v1), ("k2", v2)} is the set of key-value pairs that have been removed from
c,
and [] is the optional (empty) set of attributes.

The remaining examples show cases where some of the optionals are omitted.

3.5.3 Membership

Here
mid is the optional membership identifier,
c is the identifier for the collection whose membership is stated,
{("k4", v4), ("k5", v5)} is the set of key-value pairs that are members of
c,
and [] is the optional (empty) set of attributes.

The remaining examples show cases where some of the optionals are omitted.

3.7.2 Identifier

A qualified name is a name subject to namespace interpretation. It consists of a namespace, denoted by an optional prefix, and a local name.
The PROV data model stipulates that a qualified name can be mapped into an IRI
by concatenating the IRI associated with the prefix and the local part.

A qualified name's prefix is optional. If a prefix occurs in a
qualified name, it refers to a namespace declared in a namespace declaration. In the absence of prefix, the qualified name
refers to the default namespace.

identifier ::= qualifiedNameeIdentifier ::= 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)cIdentifier::= identifier(intended to denote a collection)

qualifiedName ::=
prefix:localPart | :localPartprefix ::= a name without colon compatible with the NC_NAME production [XML-NAMES]localPart ::= a name compatible with the
reference production [RDFA-CORE]

A PROV qualified name has a more permissive syntax then XML's QName [XML-NAMES] since it allows any syntax for its local part provided that the concatenation with the namespace results in a valid IRI [IRI].

3.7.4.2 Time Values

The third argument in the following usage expression is a time instance, namely 4pm on 2011-11-16.

used(ex:act2, ar3:0111, 2011-11-16T16:00:00)

4. Expression Container

An expression container is a house-keeping construct of PROV-N capable of packaging up PROV-N 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-N 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-N expression (production expression).

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].

5. Account

The PROV data model has introduced a notion of account by which a set of provenance descriptions can be bundled up and named. The PROV data model 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-N 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-N, contains:

id: an identifier that identifies this account;

expressions: a set exprs of expressions;

In PROV-N, 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.

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:Account.

6. Media Type

The media type of PROV-N is text/prov-n. The content encoding of PROV-N content is UTF-8.