Processor Graph Vocabulary

From RDFa Working Group Wiki
Jump to: navigation, search

RDFa Processor Graph Vocabulary

(Status: under discussion in view of a Last Call comment, 2011 February.

The prefix rdfapg for <http://www.w3.org/ns/rdfa_processing_graph#> should also be added to the list of prefixes in section 2)

Processor Graph Terms

(This should be added as section 7.6.2. )

To ensure interoperability, a core hierarchy of classes is defined for the content of the processor graph. Separate errors or warningss are resources (typically blank nodes) of a specific type, with additional properties giving more details on the error condition or the warning. This specification defines only the top level classes for the error and warning conditions explicitly defined in Section 7.6. Other, implementation-specific subclasses may be defined by the RDFa Processor. These classes are: rdfapg:Error, rdfapg:Warning, and rdfapg:Info (see the RDFa Processing Graph Vocabulary for the detailed specification). Furthermore, a single property is defined on those classes, namely rdfapg:context, that provides an extra context for the error, e.g., http response, an XPath information, or simply the URI to the RDFa resource. Usage of this property is optional, and more than one triple can be used with this predicate on the same subject. Finally, error and warning instances are required to use the dc:description and dc:date properties. dc:description should provide a short, human readable implementation dependent description of the error. dc:date should give the time when the error was found and it is advised to be as precise as possible to allow to detect, for example, possible network errors.

Examples

The following example shows the triples that should be minimally present in the processor graph as a result of an error (the content of the literal for the dc:description predicate is implementation dependent):

@prefix rdfapg: <http://www.w3.org/ns/rdfa_processing_graph#> .
@prefix xsd:    <http://www.w3.org/2001/XMLSchema#> .
@prefix dc:     <http://purl.org/dc/terms/> .

[]
     a rdfa:ProfileReferenceError ;
     dc:description "The @profile value could not be deferenced" ;
     dc:date "2010-06-30T13:40"^^xsd:dateTime 
     .

A slightly more elaborate example makes use of the rdfapg:context property to provide further information, using the external vocabularies to represent HTTP headers or XPointer information:

@prefix rdfapg: <http://www.w3.org/ns/rdfa_processing_graph#> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
@prefix dc:   <http://purl.org/dc/terms/> .
@prefix ptr:  <http://www.w3.org/2009/pointers#> .
@prefix http: <http://www.w3.org/2006/http#> .

[]
     a rdfapg:ProfileReferenceError ;
     dc:description "The @profile value could not be deferenced" ;
     dc:date "2010-06-30T13:40"^^xsd:dateTime ;
     rdfapg:context <http://www.example.org/profile> ;
     rdfapg:context [
           a ptr:Pointer ;
           # detailed xpointer/xpath information provided here to locate the 
           # DOM node with the @profile attribute
     ] ;
     rdfapg:context [
           a http:Response ;
           # Get the HTTP response headers on the request for the profile file.
     ]
     .

RDFa Schema

(This should not go into the Spec as Appendix C.)

The RDFa Processing Graph vocabulary is used to report errors, warnings, or informational items in the processor graph. Its URI is: "http://www.w3.org/ns/rdfa_processing_graph#".

The Vocabulary includes the following definitions (shown here in Turtle[REF] format)


@prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:   <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:    <http://www.w3.org/2002/07/owl#> .
@prefix rdfapg: <http://www.w3.org/ns/rdfa_processing_graph#> .

rdfapg:PGClass 
  a  rdfs:Class, owl:Class .
 
rdfapg:Error        
  rdfs:subClassOf rdfapg:PGClass
rdfa-pg:Warning  
  rdfs:subClassOf rdfapg:PGClass
rdfa-pg:Info         
  rdfs:subClassOf rdfapg:PGClass

rdfapg:ProfileReferenceError rdfs:subClassOf rdfapg:Error ;
    rdfs:comment "To be used when an RDFa Profile document fails to be retrieved and thus, a portion of the document fails to be processed"  .
 
rdfapg:DocumentError rdfs:subClassOf rdfapg:Error ;
    rdfs:comment "To be used when the document fails to be fully processed as a result of non-conformant host language markup"  .
 
rdfapg:UnresolvedCURIE rdfs:subClassOf rdfapg:Warning ;
    rdfs:comment "To be used when a CURIE prefix fails to be resolved"  .
 
rdfapg:UnresolvedTerm rdfs:subClassOf rdfapg:Warning ;
    rdfs:comment "To be used when a Term fails to be resolved"  .

Furthermore, a single property is defined:

rdfapg:context a owl:objectProperty ;
    rdfs:domain rdfapg:PGClass ;
    rdfs:comment "provides extra context for the error, eg, http response, an XPointer/XPath information, or simply the URI that created the error" .
    

This vocabulary specification is also available in XHTML+RDFa[@@LINK@@], Turtle[@@LINK@@], and RDF/XML[@@LINK@@] formats.