Difference between revisions of "Prov-XML Identifiers"

From Provenance WG Wiki
Jump to: navigation, search
(xs:ID/xs:IDRef)
(Using xs:ID for prov:id and xs:IDRef for prov:ref)
Line 6: Line 6:
  
 
=== Using xs:ID for prov:id and xs:IDRef for prov:ref ===
 
=== Using xs:ID for prov:id and xs:IDRef for prov:ref ===
 +
 +
==== Contraints ====
  
 
'''Validity constraint: ID'''
 
'''Validity constraint: ID'''
Line 23: Line 25:
 
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.
 
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:
+
==== Advantages ====
# IDs would be required to be unique in a document to for the document to be valid (this could also be a disadvantage)
+
 
 +
# xs:ID recognized by XML tools as an identifier type
 +
# xs:IDRef recognized by XML tools as a reference to an identified element
 +
 
 +
==== Disadvantages ===
  
Disadvantages:
 
 
# ID and IDRef have a base type of NCName
 
# ID and IDRef have a base type of NCName
 
## cannot contain colons, whitespaces, or start with numbers
 
## cannot contain colons, whitespaces, or start with numbers
 
## URIs and qualified names are not valid IDs because both contain colons.
 
## URIs and qualified names are not valid IDs because both contain colons.
 
Notes:
 
# IDs would be required to be unique in a document to for the document to be valid.
 
# IDRefs are references against identified elements within the same document, will not work to reference external records.
 
  
 
=== xs:QName/xs:QName ===
 
=== xs:QName/xs:QName ===
  
 
=== xs:anyURI/xs:anyURI ===
 
=== xs:anyURI/xs:anyURI ===

Revision as of 18:56, 17 January 2013

Discussions on how to represent identifiers (prov:id) in PROV-XML

Options regarding the type of the prov:id and prov:ref xml attributes

Using xs:ID for prov:id and xs:IDRef for prov:ref

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

  1. xs:ID recognized by XML tools as an identifier type
  2. xs:IDRef recognized by XML tools as a reference to an identified element

= Disadvantages

  1. ID and IDRef have a base type of NCName
    1. cannot contain colons, whitespaces, or start with numbers
    2. URIs and qualified names are not valid IDs because both contain colons.

xs:QName/xs:QName

xs:anyURI/xs:anyURI