GRDDLProfileForXForms

From W3C Wiki
Revision as of 01:29, 17 August 2006 by Chimezie (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

GRDDL Profile for XForms

RDFS Schema (for reference)

@prefix rf: <http://www.markbaker.ca/2003/rdfforms/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

rf:Container a rdfs:Class;
  rdfs:label "Container";
  rdfs:comment "A class of resource which accepts submitted data".

rf:Indexable a rdfs:Class;
  rdfs:label "Indexable";
  rdfs:comment "A class of resource which can be indexed".

rf:Settable a rdfs:Class;
  rdfs:label "Settable";
  rdfs:comment "A class of resource whose state can be explicitly set".


XSL Template for XForms submission element

Spec ref: submission


<xsl:template match="xf:submission">
  <rdf:Description rdf:about="{@action}" xml:base="..???...">
    <xsl:choose>
      <xsl:when test="translate(@method,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') = 'post'">
        <rdf:type rdf:resource="http://www.markbaker.ca/2003/rdfforms/Container"/>
      </xsl:when>
      <xsl:when test="translate(@method,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') = 'get'">
        <rdf:type rdf:resource="http://www.markbaker.ca/2003/rdfforms/Indexable"/>
      </xsl:when>
      <xsl:when test="translate(@method,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') = 'put'">
        <rdf:type rdf:resource="http://www.markbaker.ca/2003/rdfforms/Settable"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:message terminate="yes">Unsupported HTTP method!</xsl:message>
      </xsl:otherwise>
    </xsl:choose>
    <rf:acceptedMediaType><xsl:value-of select="@mediatype"/><rf:acceptedMediaType>
  </rdf:Description>
</xsl:template>


XSL Template for XForms instance element

Spec ref: instance


<xsl:template match="xf:instance[@src]">
  <rf:Indexable rdf:about="{@src}"/>
</xsl:template>


See also: