W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2005

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

From: Dan Connolly <connolly@w3.org>
Date: Fri, 11 Nov 2005 12:53:11 -0600
To: Eric Prud'hommeaux <eric@w3.org>
Cc: public-rdf-dawg@w3.org
Message-Id: <1131735192.12579.171.camel@dirk>

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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:24 GMT