return type of DATATYPE() [was: names for resources]

Turns out I was answering the wrong question.

I thought the question was: give me a URI for the class of URIs.

Turns out the quesion is: help fill in the return type
column for DATATYPE() in the operator table.
 http://www.w3.org/2001/sw/DataAccess/rq23/#FuncAndOp

What DATATYPE() is an rdfs:Datatype. So use that.
The examples (in 1.531  2005/11/11 18:40:59 ) show 

 WHERE { ?x foaf:name  ?name ; eg:shoeSize  ?size .
         FILTER ( datatype(?size) = xsd:integer ) }

and it's true that

  xsd:integer rdf:type xsd:Datatype

so that works out.


If you want the return type of DATATYPE() to be IRI
(or more standardly: xsd:anyURI), then that's a design
change. The example would have to be:

 WHERE { ?x foaf:name  ?name ; eg:shoeSize  ?size .
         FILTER ( datatype(?size) = "http://....#integer"^^xsd:anyURI ) }

which would work out, since

 "http://....#integer"^^xsd:anyURI rdf:type xsd:anyURI.

i.e. that way, DATATYPE() returns the name/identifier of the
datatype, rather than the datatype itself.


-- 
Dan Connolly, W3C http://www.w3.org/People/Connolly/
D3C2 887B 0F92 6005 C541  0875 0F91 96DE 6E52 C29E

Received on Friday, 11 November 2005 18:53:17 UTC