| 1 |
# PROV-CONSTRAINTS unification corpus |
| 2 |
|
| 3 |
153 PROV-XML documents exercising the W3C PROV-CONSTRAINTS unification and |
| 4 |
key-constraint rules, consumed by `src/prov/tests/test_unification_constraints.py` |
| 5 |
(characterization of `unified()`, roadmap step 30b; the 3.0 reimplementation is |
| 6 |
roadmap step 36b — umbrella issue |
| 7 |
[#253](https://github.com/trungdong/prov/issues/253)). |
| 8 |
|
| 9 |
## Origin |
| 10 |
|
| 11 |
Copied verbatim (retrieved 2026-07-11) from a local checkout of |
| 12 |
[ProvToolbox](https://github.com/lucmoreau/ProvToolbox), the Java reference |
| 13 |
implementation, at: |
| 14 |
|
| 15 |
``` |
| 16 |
modules-validation/prov-validation/src/test/resources/validate/unification/*.xml |
| 17 |
``` |
| 18 |
|
| 19 |
The source directory also carries a paired `.provn` file per case (consumed by |
| 20 |
ProvToolbox's `ValidateTest.java`); only the `.xml` files are vendored here |
| 21 |
because `prov` has no PROV-N parser. These cases derive from the test cases |
| 22 |
assembled by the W3C Provenance Working Group for the PROV-CONSTRAINTS |
| 23 |
implementation report (PROV-CONSTRAINTS is a W3C Recommendation, 2013-04-30, |
| 24 |
<https://www.w3.org/TR/prov-constraints/>), as implemented and maintained in |
| 25 |
ProvToolbox's validation module. |
| 26 |
|
| 27 |
## Licence |
| 28 |
|
| 29 |
ProvToolbox is distributed under an MIT-style licence (`license.txt` in its |
| 30 |
repository root): |
| 31 |
|
| 32 |
> Copyright (c) 2018–2023 King's College London, |
| 33 |
> 2011–2017 University of Southampton |
| 34 |
> |
| 35 |
> Permission is hereby granted, free of charge, to any person obtaining a copy |
| 36 |
> of this software and associated documentation files (the "Software"), to |
| 37 |
> deal in the Software without restriction, including without limitation the |
| 38 |
> rights to use, copy, modify, merge, publish, distribute, sublicense, and/or |
| 39 |
> sell copies of the Software [...] subject to [inclusion of] the above |
| 40 |
> copyright notice and this permission notice [...]. THE SOFTWARE IS PROVIDED |
| 41 |
> "AS IS", WITHOUT WARRANTY OF ANY KIND. |
| 42 |
|
| 43 |
## Naming convention |
| 44 |
|
| 45 |
Files are named `<category>-successN.xml` / `<category>-failN.xml`: |
| 46 |
|
| 47 |
- `*-successN`: a **valid** instance — applying the PROV-CONSTRAINTS |
| 48 |
uniqueness/key constraints (§6.1, Constraints 22–29) normalizes it |
| 49 |
successfully (same-identifier statements merge; compatible partial |
| 50 |
information is combined). |
| 51 |
- `*-failN`: an **invalid** instance — normalization/validation fails, e.g. |
| 52 |
a key-constraint merge fails (non-unifiable formal attributes, placeholder |
| 53 |
`-` vs a concrete value), a uniqueness constraint (24–29) is violated, a |
| 54 |
mandatory argument is the placeholder `-`, or an impossibility constraint |
| 55 |
(e.g. 52) is violated. |
| 56 |
|
| 57 |
`<category>` names the record type or rule family under test (`activity`, |
| 58 |
`generation`, ..., `activity-start`/`activity-end` for Constraints 28/29, |
| 59 |
`attributes-*` for attribute-combination cases, `bundle` for bundle scoping). |
| 60 |
|
| 61 |
## Local quirks |
| 62 |
|
| 63 |
- Each file begins with a `<?org.openprovenance.prov.xml ...?>` processing |
| 64 |
instruction instead of a standard XML declaration; XML parsers accept it. |
| 65 |
- The three `bundle-*.xml` files wrap bundle contents in `<prov:bundle>` |
| 66 |
(ProvToolbox's dialect) where the W3C PROV-XML XSD (vendored under |
| 67 |
`src/prov/tests/schemas/`) defines `<prov:bundleContent>`; `prov` cannot |
| 68 |
parse them (issue [#254](https://github.com/trungdong/prov/issues/254)) and |
| 69 |
the test module skips them as parse failures. |
| 70 |
|
| 71 |
Do not edit the `.xml` files; they are a vendored upstream corpus. |