XMLLiteral or not XMLLiteral?

This issue came up before, although I did not find the exact references
in the mail archive. The question is: if I have

<span role="blabla">Something</span>

would the generated RDF be:

<http:///> blabla "Something"^^XMLLiteral.

or

<http:///> blabla "Something".

The current primer document[1] suggest the former, so does the parser of
Elias. On the other hand, the bookmarklets of Ben do the latter.

I have run into this problem lately. I have marked up my home page with
RDFa, and I can then get the RDF data using Elias’ RDFa server (see
[2]). However, when I try to mash this with another source of
information in SPARQL, I run into a problem. In the foaf file[2] my name
is stored as XMLLiteral. In the other RDF file my name is stored as a
string literal. This means that the simple query of the sort

SELECT ?thisIsWhatIWant
WHERE {
  ?something foaf:name ?me.
  ?otherResource contact:fullName ?me.
  ?otherResource something:here ?thisIsWhatIWant.
}

will *not* work, because the SPARQL match (at least in sparql.org) also
looks at the datatype of the literal and they are not identical. I think
this type of problem will come up pretty often.

I see several possibilities on how to treat literals

1. content will be of XMLLiteral (current)
2. content will be string literal (in which case a parser has to strip
off all html tags
3. content is a string literal if there is no html tag included,
XMLLiteral otherwise
4. we find a way to add an extra information on the datatype (which
would have the extra bonus of being able to define something as a float
number, for example). The implementation would still have to strip the
html tags unless the datatype is set of XMLLiteral.

My argument is that #1 is a wrong choice for pratical reasons.

Ivan


[1] http://www.w3.org/2006/07/SWD/RDFa/primer/
[2] http://torrez.us/services/rdfa/http://www.w3.org/People/Ivan/
-- 

Ivan Herman, W3C Semantic Web Activity Lead
URL: http://www.w3.org/People/Ivan/
PGP Key: http://www.cwi.nl/%7Eivan/AboutMe/pgpkey.html
FOAF: http://www.ivan-herman.net/foaf.rdf

Received on Thursday, 2 November 2006 10:40:02 UTC