Abstract

Web content, including XML and HTML documents on the web, have a strong structure that allows identifying parts of the document in many ways. When wanting to point to a part of a Document, it is useful to be able to make it robust in the face of changes, this is very useful in the context of Evaluation and Report Language (EARL), where the report of many errors would still be valid as other errors are repaired. This document will contain a framework for representing pointers in Resource Description Framework (RDF), and a number of pointers themselves.

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

This an Editor's Draft [W3C First Public Working Draft] of the HTTP Vocabulary in RDF document. It was published on 1 December 2006 by the Evaluation and Repair Tools Working Group (ERT WG). This document is expected to be published as a W3C Working Group Note after review and refinement, potentially upon the next publication.

The working group encourages feedback about the approach, as well as about the completeness and maturity of this document by developers and researchers who have interest in a representation of the HTTP vocabulary in RDF format. Feedback from the W3C Quality Assurance Interest Group (QA IG), the W3C Semantic Web Interest Group (SWIG), and the W3C Mobile Web Best Practices Working Group (BPWG) is particularly welcome. Please send comments on this document to the public mailing list of the working group public-wai-ert@w3.org. The archives of the working group mailing list are publicly available.

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.

This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. The group does not expect this document to become a W3C Recommendation. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.


Table of Contents

  1. Introduction
  2. 2.1. Pointer Class
  3. 2.2. PointerCollection Class
  4. 2.3. LineCharLengthPointer Class
  5. 2.4. LineCharLengthPointer Class
  6. 2.5. CharSnippetPointer Class
  7. 2.6. ByteSnippetPointer Class

Appendices

  1. Schema in RDF/XML
  2. References

1. Introduction

This document introduces an RDF vocabulary to enable elements within a document, particularly HTML and XML documents to be pointed to. The document introduces an RDF class and properties, these can be used to point to parts of a document in many ways, using either line and character of the source, or byte offsets, or more complicated pointers defined elsewhere such as XPointer, or CSS Selectors.

1.1. Namespace

The RDF representation of the Pointer vocabulary defined by this document uses the namespace http://www.w3.org/WAI/ER/EARL/pointers#

1.2. Use Cases

The following (non-exhaustive) list of use cases aims to highlight some of the different usages of this vocabulary:

Reporting Test Failure Locations
When Web resources are tested, for example for accessibility or other quality assurance testing, it is important to identify where in the document failures occur, to enable fixing. RDF reporting languages like [EARL] can use this vocabulary to record the locations within the document.
Identifying Interesting parts of large documents.
Web resources are often long documents, and the interesting part is only a small part of it, being able to point to fragments of the document allows you to more specifically identify the relevant interesting part of the document.
Web Content Templates
When editing Web Resources, templates are often used to be filled out by a different author to the template, the RDF vocabulary can be used to assist in this process by labelling the elements and fragments that need to be filled out with different content.

Pointers

This section defines RDF the generic Pointer and PointerCollection classes.

2.1. Pointer Class

The Pointer class represents a pointer to some part of the document or web resource, it is a generic class, generally subClassed to be more specific.

2.2. PointerCollection Class

The PointerCollection class is a collection of pointers, all pointing to the same thing in the document, within the limits of the individual pointers.

The PointerCollection has many properties, in this document we define the following, but others appropriate to specific uses could be used:

2.3. LineCharLengthPointer Class

Line/character and optionally the length of a region within the Test Subject.

It has the following properties:

2.4. XPathPointer Class

A Pointer representing an XPath location into a document

It has the following properties:

2.4.1. Namespace Class

A Namespace used in the XPath expression

It has the following properties:

2.5. CharSnippetPointer Class

A Pointer representing a character snippet and a location within it from the original document.

It has the following properties:

2.6. ByteSnippetPointer Class

A Base64 encoded snippet from the original resource, and an offset within that, like the CharSnippetPointer Class but useful for byte based content, rather than character based..

It has the following properties:

Appendix A: Pointer Schema in RDF/XML

<rdf:RDF
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:owl="http://www.w3.org/2002/07/owl#">

<!--// GENERIC POINTER CLASS //-->
<rdfs:Class rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#Pointer">
  <rdfs:label xml:lang="en">Pointer</rdfs:label>
  <rdfs:comment xml:lang="en">A pointer to a location within the Test Subject</rdfs:comment>
</rdfs:Class>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#instance">
  <rdfs:label xml:lang="en">Instance Location</rdfs:label>
  <rdfs:comment xml:lang="en">An individual place where a result occurs within the Test Subject</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#TestResult"/>
  <rdfs:range rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#PointerCollection"/>
</rdf:Property>
 
<!--// POINTER COLLECTION //-->
<rdfs:Class rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#PointerCollection">
  <rdfs:label xml:lang="en">Pointer Collection</rdfs:label>
  <rdfs:comment xml:lang="en">A collection of pointers, all pointing to the same thing</rdfs:comment>
  <rdfs:subClassOf rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#Pointer"/>
  <!--// @@@ EDITORS' NOTE: Min/Max cardinality restrictions can be applied here //-->
</rdfs:Class>
 

<!--// SIMPLE POINTERS //-->
<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#xpointer">
  <rdfs:label xml:lang="en">XPointer</rdfs:label>
  <rdfs:comment xml:lang="en">XPointer expression pointing into the Test Subject</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#PointerCollection"/>
  <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</rdf:Property>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#htmlpointer">
  <rdfs:label xml:lang="en">HTML Pointer</rdfs:label>
  <rdfs:comment xml:lang="en">HTML Pointer expression pointing into the Test Subject</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#PointerCollection"/>
  <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</rdf:Property>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#selectorpointer">
  <rdfs:label xml:lang="en">CSS Selector Pointer</rdfs:label>
  <rdfs:comment xml:lang="en">CSS Selector pointing into the part of the document</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#PointerCollection"/>
  <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</rdf:Property>


<!--// LINE/CHAR/LENGTH POINTERS //-->
<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#linecharlength">
  <rdfs:label xml:lang="en">Line Char Length</rdfs:label>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#PointerCollection"/>
  <rdfs:range rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#LineCharLengthPointer"/>
</rdf:Property>

<rdfs:Class rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#LineCharLengthPointer">
  <rdfs:label xml:lang="en">Line Char Length Pointer</rdfs:label>
  <rdfs:comment xml:lang="en">Line/character and optionally the length of a region within the Document</rdfs:comment>
  <rdfs:subClassOf rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#Pointer"/>
  <rdfs:subClassOf rdf:parseType="Collection">
    <owl:Restriction>
      <owl:onProperty rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#line"/>
      <!--// @@@ EDITORS' NOTE: Min/Max cardinality restrictions have been commented out until a decision is made
      <owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:minCardinality>
      <owl:maxCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:maxCardinality>
      //-->
    </owl:Restriction>
    <owl:Restriction>
      <owl:onProperty rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#char"/>
      <!--// @@@ EDITORS' NOTE: Min/Max cardinality restrictions have been commented out until a decision is made
      <owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:minCardinality>
      <owl:maxCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:maxCardinality>
      //-->
    </owl:Restriction>
    <owl:Restriction>
      <owl:onProperty rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#length"/>
      <!--// @@@ EDITORS' NOTE: Min/Max cardinality restrictions have been commented out until a decision is made
      <owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">0</owl:minCardinality>
      <owl:maxCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:maxCardinality>
      //-->
    </owl:Restriction>
  </rdfs:subClassOf>
</rdfs:Class>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#line">
  <rdfs:label xml:lang="en">Line</rdfs:label>
  <rdfs:comment xml:lang="en">Line number within the Test Subject</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#LineCharLength"/>
  <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
</rdf:Property>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#char">
  <rdfs:label xml:lang="en">Char</rdfs:label>
  <rdfs:comment xml:lang="en">Char or column number within the Test Subject</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#LineCharLength"/>
  <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
</rdf:Property>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#length">
  <rdfs:label xml:lang="en">Length</rdfs:label>
  <rdfs:comment xml:lang="en">Length of a region within the Test Subject</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#LineCharLength"/>
  <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
</rdf:Property>


<!--// XPath POINTERS //-->
<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#xpath">
  <rdfs:label xml:lang="en">XPath</rdfs:label>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#PointerCollection"/>
  <rdfs:range rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#LineCharLengthPointer"/>
</rdf:Property>

<rdfs:Class rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#XPathPointer">
  <rdfs:label xml:lang="en">XPath Pointer</rdfs:label>
  <rdfs:comment xml:lang="en">XPath expression (including namespace) pointing into the Test Subject</rdfs:comment>
  <rdfs:subClassOf rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#Pointer"/>
  <rdfs:subClassOf rdf:parseType="Collection">
    <owl:Restriction>
      <owl:onProperty rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#expression"/>
      <!--// @@@ EDITORS' NOTE: Min/Max cardinality restrictions have been commented out until a decision is made
      <owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:minCardinality>
      <owl:maxCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:maxCardinality>
      //-->
    </owl:Restriction>
    <owl:Restriction>
      <owl:onProperty rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#namespace"/>
      <!--// @@@ EDITORS' NOTE: Min/Max cardinality restrictions have been commented out until a decision is made
      <owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">0</owl:minCardinality>
      //-->
    </owl:Restriction>
  </rdfs:subClassOf>
</rdfs:Class>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#expression">
  <rdfs:label xml:lang="en">Pointer Expression</rdfs:label>
  <rdfs:comment xml:lang="en">String based pointer expression such as HTML Pointer, XPointer, or XPath</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#Pointer"/>
  <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</rdf:Property>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#namespace">
  <rdfs:label xml:lang="en">XPath Namespace</rdfs:label>
  <rdfs:comment xml:lang="en">A namespace used in a particular XPath expression</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#XPath"/>
  <rdfs:range rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#Namespace"/>
</rdf:Property>

<rdfs:Class rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#Namespace">
  <rdfs:label xml:lang="en">Namespace</rdfs:label>
  <rdfs:comment xml:lang="en">Prefix and namespace URI for an XPath expression</rdfs:comment>
  <rdfs:subClassOf rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#Pointer"/>
  <rdfs:subClassOf rdf:parseType="Collection">
    <owl:Restriction>
      <owl:onProperty rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#prefix"/>
      <!--// @@@ EDITORS' NOTE: Min/Max cardinality restrictions have been commented out until a decision is made
      <owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:minCardinality>
      <owl:maxCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:maxCardinality>
      //-->
    </owl:Restriction>
    <owl:Restriction>
      <owl:onProperty rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#namespaceURI"/>
      <!--// @@@ EDITORS' NOTE: Min/Max cardinality restrictions have been commented out until a decision is made
      <owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:minCardinality>
      <owl:maxCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:maxCardinality>
      //-->
    </owl:Restriction>
  </rdfs:subClassOf>
</rdfs:Class>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#prefix">
  <rdfs:label xml:lang="en">Namespace Prefix</rdfs:label>
  <rdfs:comment xml:lang="en">A namespace prefix</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#Namespace"/>
  <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</rdf:Property>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#namespaceURI">
  <rdfs:label xml:lang="en">Namespace URI</rdfs:label>
  <rdfs:comment xml:lang="en">A namespace URI</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#Namespace"/>
  <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</rdf:Property>


<!--// SNIPPET POINTERS //-->
<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#charsnippet">
  <rdfs:label xml:lang="en">Char Snippet</rdfs:label>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#PointerCollection"/>
  <rdfs:range rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#CharSnippetPointer"/>
</rdf:Property>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#bytesnippet">
  <rdfs:label xml:lang="en">Byte Snippet</rdfs:label>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#PointerCollection"/>
  <rdfs:range rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#ByteSnippetPointer"/>
</rdf:Property>

<rdfs:Class rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#CharSnippetPointer">
  <rdfs:label xml:lang="en">Char Snippet Pointer</rdfs:label>
  <rdfs:comment xml:lang="en">Character based part of the Test Subject</rdfs:comment>
  <rdfs:subClassOf rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#Pointer"/>
  <rdfs:subClassOf rdf:parseType="Collection">
    <owl:Restriction>
      <owl:onProperty rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#charContent"/>
      <!--// @@@ EDITORS' NOTE: Min/Max cardinality restrictions have been commented out until a decision is made
      <owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">0</owl:minCardinality>
      <owl:maxCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:maxCardinality>
      //-->
    </owl:Restriction>
    <owl:Restriction>
      <owl:onProperty rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#charOffset"/>
      <!--// @@@ EDITORS' NOTE: Min/Max cardinality restrictions have been commented out until a decision is made
      <owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">0</owl:minCardinality>
      <owl:maxCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:maxCardinality>
      //-->
    </owl:Restriction>
  </rdfs:subClassOf>
</rdfs:Class>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#charContent">
  <rdfs:label xml:lang="en">Char Content</rdfs:label>
  <rdfs:comment xml:lang="en">Character content that is part of the Test Subject</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#charSnippet"/>
  <!--// @@@ EDITORS' NOTE: range here could be a string or a parsed XML document... //-->
</rdf:Property>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#charOffset">
  <rdfs:label xml:lang="en">Char Offset</rdfs:label>
  <rdfs:comment xml:lang="en">Number of characters into the Char Content</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#charSnippet"/>
  <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
</rdf:Property>

<rdfs:Class rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#ByteSnippetPointer">
  <rdfs:label xml:lang="en">Byte Snippet Pointer</rdfs:label>
  <rdfs:comment xml:lang="en">Byte based part of the Test Subject (encoded in Base64)</rdfs:comment>
  <rdfs:subClassOf rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#Pointer"/>
  <rdfs:subClassOf rdf:parseType="Collection">
    <owl:Restriction>
      <owl:onProperty rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#byteContent"/>
      <!--// @@@ EDITORS' NOTE: Min/Max cardinality restrictions have been commented out until a decision is made
      <owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">0</owl:minCardinality>
      <owl:maxCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:maxCardinality>
      //-->
    </owl:Restriction>
    <owl:Restriction>
      <owl:onProperty rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#byteOffset"/>
      <!--// @@@ EDITORS' NOTE: Min/Max cardinality restrictions have been commented out until a decision is made
      <owl:minCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">0</owl:minCardinality>
      <owl:maxCardinality rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:maxCardinality>
      //-->
    </owl:Restriction>
  </rdfs:subClassOf>
</rdfs:Class>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#byteContent">
  <rdfs:label xml:lang="en">Byte Content</rdfs:label>
  <rdfs:comment xml:lang="en">Byte content that is part of the Test Subject (encoded in Base64)</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#byteSnippet"/>
  <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
</rdf:Property>

<rdf:Property rdf:about="http://www.w3.org/WAI/ER/EARL/pointers#byteOffset">
  <rdfs:label xml:lang="en">Byte Offset</rdfs:label>
  <rdfs:comment xml:lang="en">Number of bytes into the Byte Content</rdfs:comment>
  <rdfs:domain rdf:resource="http://www.w3.org/WAI/ER/EARL/pointers#byteSnippet"/>
  <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/>
</rdf:Property>


</rdf:RDF> 

Appendix B: References