Re: RDF/XML Syntax Question: Label on an RDF Object being a literal

On 28 Feb 2010, at 18:04, Svante Schubert wrote:

> I got a question on RDF/XML syntax.
> I would like to put an rdfs:label on an RDF object being a literal.
> In RDF I read that rdfs:label takes as input an rdfs:Resource
> and found that the literal (rdfs:Literal ) is a subclass an rdfs:Resource
> Therefore it should be possible to do so.

Hi Svante,

This is a rather tricky question, but I think the simplest answer is: you can't do that. A literal can't be an object

( The more accurate answer is that a literal can be an object, but you can't write that directly in rdf syntax. For example:

  _:date owl:sameAs "1980-09-02"^^xsd:date . _:date ex:readableLabel "2. September 1980" )

> Why do I like to do it? Imagine I got in ODF a table
> <table:table-cell office:value-type="date" office:date-value="1980-09-02">
> <text:p>2. September 1980</text:p>
> </table:table-cell>

You could use rdf:value:

  _:date rdf:value "1980-09-02" ; ex:readableValue "2. September 1980" .

You might want to add in a type, to indicate that _:date is a date:

  _:date a ex:DateValue ; rdf:value "1980-09-02" ; ex:readableValue "2. September 1980" .

> Similar I desire an adequate solution for RDFa, where

office:value-type="date" office:date-value="1980-09-02">
<text:p xhtml:property="ex:readableValue">2. September 1980</text:p>

This would produce the rdf above.

Hope this helps. I'm sure there are better alternatives.


Received on Sunday, 28 February 2010 22:20:05 UTC