RDF Datatyping Examples -- rdf:type

Here are some encoding examples based on the latest datatyping WD

http://www-nrc.nokia.com/sw/rdf-datatyping.html

as well as the proposed NTriples syntax for typed literals in

http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2002Aug/0184.html

(I use qnames rather than URIrefs in the NTriples for now...)

--

RDF/XML:

   <rdf:Description rdf:about="#Jenny">
      <ex:age>10</ex:age>
   </rdf:Description>

NTriples:

   Jenny ex:age "10" .

--

RDF/XML:

   <rdf:Description rdf:about="#Jenny" xml:lang="en">
      <ex:age>10</ex:age>
   </rdf:Description>

NTriples:

   Jenny ex:age "10"-en .

--

RDF/XML:

   <rdf:Description rdf:about="#Jenny">
      <ex:age rdf:type="&xsd;integer">10</ex:age>
   </rdf:Description>

NTriples:

   Jenny ex:age xsd:integer,"10" .

--

RDF/XML:

   <rdf:Description rdf:about="#Jenny" xml:lang="en">
      <ex:age rdf:type="&xsd;integer">10</ex:age>
   </rdf:Description>

NTriples:

   Jenny ex:age xsd:integer,"10"-en .

--

RDF/XML:

   <rdf:Description rdf:about="#Book">
      <ex:title>10</ex:title>
   </rdf:Description>

NTriples:

   Book ex:title "10" .

--

RDF/XML:

   <rdf:Description rdf:about="#Book" xml:lang="en">
      <ex:title>10</ex:title>
   </rdf:Description>

NTriples:

   Book ex:title "10"-en .

--

RDF/XML:

   <rdf:Description rdf:about="#Book">
      <ex:title rdf:type="&xsd;string">10</ex:title>
   </rdf:Description>

NTriples:

   Book ex:title xsd:string,"10" .

--

RDF/XML:

   <rdf:Description rdf:about="#Book" xml:lang="en">
      <ex:title rdf:type="&xsd;string">10</ex:title>
   </rdf:Description>

NTriples:

   Book ex:title xsd:string,"10"-en .

--

RDF/XML:

   <rdf:Description rdf:about="#Book">
      <ex:title rdf:parseType="Literal"><xhtml:h1>10</xhtml:h1></ex:title>
   </rdf:Description>

NTriples:

   Book ex:title xml"<xhtml:h1>10</xhtml:h1>" .

--

RDF/XML:

   <rdf:Description rdf:about="#Book" xml:lang="en">
      <ex:title rdf:parseType="Literal"><xhtml:h1>10</xhtml:h1></ex:title>
   </rdf:Description>

NTriples:

   Book ex:title xml"<xhtml:h1>10</xhtml:h1>"-en .

--

RDF/XML:

   <rdf:Description rdf:about="#Book">
      <ex:title rdf:parseType="Literal" rdf:type="&xhtml;h1"><xhtml:h1>10</xhtml:h1></ex:title>
   </rdf:Description>

NTriples:

   Book ex:title xhtml:h1,xml"<xhtml:h1>10</xhtml:h1>" .

--

RDF/XML:

   <rdf:Description rdf:about="#Book" xml:lang="en">
      <ex:title rdf:parseType="Literal" rdf:type="&xhtml;h1"><xhtml:h1>10</xhtml:h1></ex:title>
   </rdf:Description>

NTriples:

   Book ex:title xhtml:h1,xml"<xhtml:h1>10</xhtml:h1>"-en .

--
               
Patrick Stickler              Phone: +358 50 483 9453
Senior Research Scientist     Fax:   +358 7180 35409
Nokia Research Center         Email: patrick.stickler@nokia.com
 

Received on Thursday, 22 August 2002 14:52:47 UTC