W3C home > Mailing lists > Public > public-rif-wg@w3.org > March 2008

Re: [Fwd: Re: [DTB] Datatypes and Built-ins first run to clean up and extend the initial list]

From: Axel Polleres <axel.polleres@deri.org>
Date: Tue, 04 Mar 2008 13:07:43 +0100
Message-ID: <47CD3B8F.7000605@deri.org>
To: Jos de Bruijn <debruijn@inf.unibz.it>
CC: "Public-Rif-Wg (E-mail)" <public-rif-wg@w3.org>

Jos de Bruijn wrote:
> 
> <snip/>
> 
>>> I do not know. If they really mean rdf:resource then they have a 
>>> semantic
>>> problem (I think it does not sit well with RDF semantics). 
>>
>> Well, might be the case, but that's just how people use it. And there 
>> is increasingly RDF data being published on the Web, which encodes 
>> URLs (Locators) as rdf:resource and not as xsd:anyURI.
>>
>>
>>> But in your
>>> example below you seem to be using the xsd:anyURI *data type* -- not an
>>> rdf:resource -- to encode phone numbers. That has no problem. You can
>>> define a builtin that operates on anyURIs.
>>
>> Of course, that alternative version wouldn't have any problem, sure.
>> But what I wanted to say is that *nobody* does it like that.
>> Everybody uses option 1 below and not option 2.
>>
>> Option 1:
>>
>>>> <http://www.polleres.net/foaf.rdf#me>
>>>>     foaf:phone <tel:+35391495723> ;
>>>>     foaf:homepage <http://www.polleres.net/> .
> 
> I am wondering why you would want to extract telephone numbers or even 
> IRIs from identifiers in a rules language. 

I want to translate from FOAF to vCard and vice versa.
Two of the simplest conceivable vocabularies. As the latter (in the RDF 
version I found [1]) encodes telephone numbers as literals, I would need 
that conversion.

> The agent that is actually 
> going to make the phone call or browse the homepage will use the 
> syntactical representation of some query answers.
>
> And then, the IRI which happens to be the identifier of a homepage, for 
> example, is not necessarily its location.

ok, what if I want to know whether the homepage belongs to a certain 
domain? Is that out of scope of built-ins in your understanding?


>> Option 2:
>>
>>>> <http://www.polleres.net/foaf.rdf#me>
>>>>       foaf:phone    "tel:+35391495723"^^xsd:anyURI ;
>>>>       foaf:homepage "http://www.polleres.net/"^^xsd:anyURI .
> 
> these are both incorrect, because an anyURI is neither a telephone 
> number, nor a homepage.
> 
>>
>>
>> But I am unsure whether we can by any means accomodate for that.
>> Anyway, I think that casts are not trivial to define even for typed
>> literals or no? Since the lex-to-val mapping is not injective in 
>> general, how can I define for instance  the cast
>>
>>    xsd:string( "01"^^xsd:integer)
> 
> we should use the definition of XQuery functions; i.e., use the 
> canonical representation of integers.

yes, that's fine and what I thought as well....

>> In our framework, we have to give a fixed interpretation.
>> It says that this function is only defined for certain datatypes as 
>> "input", but in out framework the "input" is always a TERM and for 
>> evaluating I_F(xsd:string( "01"^^xsd:integer) )
>> I need to consider the actual domain value which "01"^^xsd:integer
>> is mapped to and reconvert it to a string. For that example, it is 
>> still easy, because there is a canonical string "1" which we can return.

... for datatypes which have canonical values for their representation
(I think this is fullfilled in general, yes?), it should be fine.

>> Now what about
>>
>>    xsd:string( "http://www.example.org/theNumberOne"^^rif:iri)
>>
>> ??? Now what is the truth value of this? Depends on the current 
>> interpretation, or no? If the curent interpretation maps the iri
>> http://www.example.org/theNumberOne to an element in the value space of
>> e.g. xsd:integer the function should return a value, if it doesn't map
>> http://www.example.org/theNumberOne to an element in a compatible value
>> space for string conversions, the function returns an error. Yes?
> 
> right.

anyway, if this occurs in a rule body, no particular value for

   xsd:string( "http://www.example.org/theNumberOne"^^rif:iri)

would be entailed, neither error nor a particular string? ... even if I 
have a fixed interpretation for the built-in function.

>> I am not sure at the moment whether this is a problem, but it is at 
>> least a bit contrived.
> 
> In what sense?  It seems completely reasonable to me that if you want to 
> do typecasting, but the cast fails, you have an error.

Hmmm, wouldn't that imply that use case to convert from [2] to [1] out 
of scope of RIF then? That would be at the very least "surprising" for 
people who expected something like a usable rules language for e.g. 
describing RDF mappings from RIF, I guess.

If the majority of the group thinks that such rules are out of scope for 
RIF then I see a big problem to our relation with the RDF community. I 
personally do think it should be in scope.


Axel


1. http://www.w3.org/TR/vcard-rdf
2. http://xmlns.com/foaf/spec/

>> best,
>> Axel
>>
>>
>>>> So how do I convince all the rest of the world to change that likewise?
>>>> Even the RDF Primer [2] (Example 6):
>>>> ----------------------------------------------------------------------
>>>>       <rdf:Description rdf:nodeID="abc">
>>>>          <exterms:fullName>Dave Beckett</exterms:fullName>
>>>>          <exterms:homePage rdf:resource="http://purl.org/net/dajobe/"/>
>>>>       </rdf:Description>
>>>> ----------------------------------------------------------------------
>>>>
>>>> or the SPARQL spec [3] (examples in Section 6):
>>>>
>>>> ----------------------------------------------------------------------
>>>>   @prefix foaf:       <http://xmlns.com/foaf/0.1/> .
>>>>   @prefix rdf:        <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
>>>>
>>>>   _:a  rdf:type        foaf:Person .
>>>>   _:a  foaf:name       "Alice" .
>>>>   _:a  foaf:mbox       <mailto:alice@example.com> .
>>>>   _:a  foaf:homepage   <http://work.example.org/alice/> .
>>>> ----------------------------------------------------------------------
>>>>
>>>> promote the use of rdf:resources for URLs (homepages, 
>>>> email-adresses, etc.). It might be arguable with respect to the 
>>>> concepts, but people *do* use URIs like that and it is even done in 
>>>> the specs of RDF as we see here.
>>>>
>>>> How do we cater for it?  By just stating I cannot get a substring 
>>>> out of a homepage-URL or email-address... just because rdf:resource 
>>>> (and rif:iri, respectively) are not datatypes?
>>>>
>>>> I knew somehow why I put that in my signature ;-)
>>>>
>>>> Axel
>>>>
>>>>
>>>> 1. http://xmlns.com/foaf/spec/
>>>> 2. http://www.w3.org/TR/REC-rdf-syntax/
>>>> 3. http://www.w3.org/TR/rdf-sparql-query/
>>>>
>>>> -- 
>>>> Dr. Axel Polleres
>>>> email: axel@polleres.net  url: http://www.polleres.net/
>>>>
>>>> rdfs:Resource owl:differentFrom xsd:anyURI .
>>>>
>>>
>>>
>>
>>
> 


-- 
Dr. Axel Polleres
email: axel@polleres.net  url: http://www.polleres.net/

rdfs:Resource owl:differentFrom xsd:anyURI .
Received on Tuesday, 4 March 2008 12:07:55 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 2 June 2009 18:33:47 GMT