[foaf-protocols] how to define that a relation is a dataype?
Pat Hayes
phayes at ihmc.us
Mon Feb 22 22:11:17 CET 2010
Dan is absolutely correct. See below.
On Feb 22, 2010, at 2:31 PM, Dan Connolly wrote:
> On Mon, 2010-02-22 at 13:50 -0600, Pat Hayes wrote:
>> On Feb 22, 2010, at 8:42 AM, Dan Connolly wrote:
>>
>>> On Sun, 2010-02-21 at 23:57 -0600, Pat Hayes wrote:
>>>> On Feb 21, 2010, at 6:15 PM, Story Henry wrote:
>>>>
>>>>> I have a relation :hex defined as
>>>>>
>>>>> @prefix : <http://www.w3.org/ns/auth/cert#> .
>>>>>
>>>>> :hex a owl:DatatypeProperty,
>>>>> owl:InverseFunctionalProperty;
>>>>> rdfs:label "hexadecimal"@en;
>>>>> rdfs:domain :Integer;
>>>>> rdfs:range :String;
>>>>> vs:term_status "unstable" .
>>>>>
>>>>> This relates a number to a string.
>>>>
>>>> Fair enough. But be clear: that is *not* a datatype. It is the
>>>> inverse
>>>> of a datatype mapping, in fact. Datatypes always map FROM strings
>>>> TO
>>>> values.
>>>
>>> That's completely arbitrary; it makes just as much sense to adopt
>>> the opposite convention.
>>
>> Except that RDF already used this one. Its not completely arbitrary,
>> but in any case its set in stone now.
>
> I don't think so. I'm pretty sure the 2004 specs are silent on the
> use of datatypes as properties. Both directions are consistent
> semantic extensions.
Yes, you are right. So this semantic extension is perfectly legal,
contrary to what I was claiming. <Sound of crows being eaten />
Sigh. However, it seems utterly crazy to me to use the same URI to
denote both a mapping (inside a typed literal) and its inverse mapping
(as a property). If I had even thought that anyone would want do that,
I would have urged that we made it illegal back when we were writing
the specs. The only possible reason for it that I can see would be to
set out to make things deliberately confusing.
Pat
>
>
>>>>> 1234 :base64 "TU";
>>>>> :hex "4D2";
>>>>> :dec "1234";
>>>>> :oct "2322";
>>>>> :bin "11010010" .
>>>>
>>>> You could, but by using properties from values to strings, you have
>>>> kind of shot yourself in the foot.
>>>
>>> How so? This works just fine, in my experience.
>>>
>>>>> if this WERE equivalent to the two relations:
>>>>>
>>>>> :x :dollarValue "1234".
>>>>> "1234" xsd:int 1234 .
>>>>
>>>> No, its certainly not. The literal denotes the value, not the
>>>> string.
>>>> So the right way to split that up into two triples would be
>>>>
>>>> :x :dollarValue :y .
>>>> "1234" xsd:int :y .
>>>
>>> or:
>>>
>>> :x :dollarValue _:y.
>>> _:y xsd:int "1234".
>>
>> That will get you an immediate domain/range error. Well, it should.
>> The range of xsd:int is numbers, not strings.
>
> I'm pretty sure it's not specified either way.
>
>>> or:
>>>
>>> :x :dollarValue 1234.
>>
>> Um... is that legal RDF?
>
> It's a turtle abbreviation for
> :x :dollarValue "1234"^^xsd:integer.
>
> http://www.w3.org/TeamSubmission/turtle/#abbrev
>
> --
> Dan Connolly, W3C http://www.w3.org/People/Connolly/
> gpg D3C2 887B 0F92 6005 C541 0875 0F91 96DE 6E52 C29E
>
>
>
------------------------------------------------------------
IHMC (850)434 8903 or (650)494 3973
40 South Alcaniz St. (850)202 4416 office
Pensacola (850)202 4440 fax
FL 32502 (850)291 0667 mobile
phayesAT-SIGNihmc.us http://www.ihmc.us/users/phayes
More information about the foaf-protocols
mailing list