Skip to content

Allow rdf:version where RDF 1.2 features require an in-scope version announcement #108

@domel

Description

@domel

Problem

The specification says that features introduced in RDF 1.2 require a version announcement on an in-scope node element using rdf:version.

However, the RELAX NG Compact schema currently defines the document wrapper as:

RDF =
  element rdf:RDF {
     xmllang?, xmlbase?, nodeElementList
  }

and node elements as:

nodeElement =
  element * - ( local:* | rdf:RDF | rdf:ID | rdf:about | rdf:parseType |
                rdf:resource | rdf:nodeID | rdf:datatype | rdf:li |
                rdf:aboutEach | rdf:aboutEachPrefix | rdf:bagID ) {
      (idAttr | nodeIdAttr | aboutAttr )?, xmllang?, xmlbase?, propertyAttr*, propertyEltList
  }

Neither production allows versionAttr.

At the same time, many property element productions allow versionAttr?, which makes the handling of rdf:version inconsistent.

Expected behavior

The RELAX NG schema should allow rdf:version in the places required by the RDF/XML 1.2 versioning mechanism.

At minimum, this should include node elements, because the specification refers to an in-scope node element with an rdf:version attribute.

It may also be useful to allow rdf:version on rdf:RDF if the intent is to support version announcements on the document wrapper, as commonly shown in examples.

Suggested fix

Add versionAttr? to the relevant productions, for example:

RDF =
  element rdf:RDF {
     xmllang?, xmlbase?, versionAttr?, nodeElementList
  }

and:

nodeElement =
  element * - (...) {
      (idAttr | nodeIdAttr | aboutAttr )?, xmllang?, xmlbase?, versionAttr?, propertyAttr*, propertyEltList
  }

The exact placement should be aligned with the normative grammar and the intended scoping rules for rdf:version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions