Prov-XML Identifiers
From Provenance WG Wiki
(Difference between revisions)
(→ID/IDRef) |
(→Discussions on how to represent identifiers (prov:id) in PROV-XML) |
||
| Line 96: | Line 96: | ||
# No uniqueness contraint on prov:id | # No uniqueness contraint on prov:id | ||
# The value of prov:ref is not required to match any existing prov:id | # The value of prov:ref is not required to match any existing prov:id | ||
| + | |||
| + | === References === | ||
| + | * http://www.en8848.com.cn/reilly%20books/xml/schema/ch09_01.htm | ||
| + | * http://www.w3.org/TR/xmlschema-2/ | ||
| + | * http://www.w3.org/TR/2000/WD-xml-2e-20000814 | ||
Revision as of 19:40, 17 January 2013
Discussions on how to represent identifiers (prov:id) in PROV-XML
Contents |
prov:id and prov:ref type options
In the schema prov:id and prov:ref are defined as XML attributes.
ID/IDRef
Use type xs:ID for prov:id and xs:IDRef for prov:ref
<xs:attribute name="id" type="xs:ID"/> <xs:attribute name="ref" type="xs:IDRef"/>
Contraints
- Validity constraint: ID
- Values of type ID must match the Name production. A name must not appear more than once in an XML document as a value of this type; i.e., ID values must uniquely identify the elements which bear them.
- Validity constraint: One ID per Element Type
- No element type may have more than one ID attribute specified.
- Validity constraint: ID Attribute Default
- An ID attribute must have a declared default of #IMPLIED or #REQUIRED.
- Validity constraint: IDREF
- Values of type IDREF must match the Name production, and values of type IDREFS must match Names; each Name must match the value of an ID attribute on some element in the XML document; i.e. IDREF values must match the value of some ID attribute.
Advantages
- ID recognized by XML tools as an identifier type
- There is a uniqueness constraint on prov:id values (scope global to document)
- IDRef recognized by XML tools as a reference to an identified element
- A prov:ref must match the prov:id of some identified element in the document
Disadvantages
- lexical space is the same as the unqualified XML name (known as the xs:NCName datatype)
- ID and IDRef cannot contain colons, whitespaces, or start with numbers
- URIs and qualified names are not valid IDs because both contain colons.
- entity/relation records defined in different bundles in the same document cannot have the same prov:id value
QName
Use type xs:QName for both prov:id and xs:IDRef
<xs:attribute name="id" type="xs:QName"/> <xs:attribute name="ref" type="xs:QName"/>
Contraints
TODO
Advantages
- Closest type to PROV-DM QualifiedName
Disadvantages
- No uniqueness contraint on prov:id
- The value of prov:ref is not required to match any existing prov:id
- Full URIs (e.g. http://example.com/ns/ex#e1) are not valid values for prov:id; you must use a namespace.
anyURI
Use type xs:anyURI for both prov:id and xs:IDRef
<xs:attribute name="id" type="xs:anyURI"/> <xs:attribute name="ref" type="xs:anyURI"/>
Contraints
- TODO
Advantages
- Alignment with PROV-O requirement (from RDF) that identifiers be URIs.
- URIs are valid values for prov:id
Disadvantages
- No uniqueness contraint on prov:id
- The value of prov:ref is not required to match any existing prov:id
