Re: RDF's curious literals

On 2 Aug 2007, at 16:14, Garret Wilson wrote:
>> On 1 Aug 2007, at 18:32, Garret Wilson wrote:
>>>   3. Even if we prefer to write 123 and "123", why do we need
>>>      rdfs:datatype when we can simply use rdf:type set to  
>>> xsd:Integer?
>>
>> Why do you keep railing against rdf:datatype? It is merely an  
>> artifact of the RDF/XML syntax. It does not exist in the RDF  
>> abstract syntax (which you call the “RDF model”).
>
> What? If that were true, there would be no such things as typed  
> literals in the model, because once you suck RDF/XML or N3 into the  
> model and then re-serialize it, you'd just have plain literals again.

Garret, you say things like “why do we need rdf:datatype” and “death  
to rdf:datatype”. rdf:datatype is an XML attribute in the RDF/XML  
sytnax. Nothing else.

You quote RDF Concepts and Abstract Syntax. You will find that the  
document does not mention rdf:datatype. The only specification that  
mentions rdf:datatype is the RDF/XML spec.

Now, of course, there *is* a distinction between typed literals and  
other resources in the RDF abstract syntax.

So, when you say, “death to rdf:datatype”, do you mean “death to  
rdf:datatype” or do you mean “death to the distinction between typed  
literals and URIs in the RDF abstract syntax”?

You know, it's kind of hard to follow your arguments when you mix up  
terms.

[snip]
> So that means, in an API, if I want to see if an object is a US  
> president or an integer, I would have to do the following:

Do you? No. An API is just another surface syntax, and you can do  
whatever pleases you in an RDF API. The abstract syntax doesn't in  
any way limit or prescribe API design decisions. All it gives you is  
some well-defined terminology that you *can* use in your API.

You can do all kinds of convenient shortcuts and use whatever  
terminology you like in your API, just as you can do all kinds of  
convenient shortcuts in your RDF serialization of choice.

Discussions of APIs are not very relevant to questions about the RDF  
abstract syntax. No one is trying to stop you from unifying URIs and  
literals *in your API*. Which I think would be a good idea. But we  
are talking about the RDF abstract model here, don't we?

To use an XML metaphor, the RDF abstract syntax isn't like the DOM  
(an API for XML), it's like the XML Infoset (an abstract data model  
for XML).

> Resource resource=getResourceSomehow();
> if(resource instanceof Literal)  //we can't look at the datatype  
> unless this is a literal
> {
>  if(XSD_INTEGER.equals(((Literal)resource).getDataType()))
>  {
>    //this is an integer
>  }
> }
> else  //if this is not a literal, we can check rdf:type
> {
>  if(US_PRESIDENT.equals(resource.getProperty(RDF_TYPE)))
>  {
>    //this is a US president
>  }
> }
>
> Do you see why I still claim that the RDF abstract syntax is  
> inconsistent,

“Inconsistent” means “containing a contradiction”. The example above  
might demonstrate poor API design or a certain redundancy or  
awkwardness in the RDF abstract syntax. But I don't see a  
contradiction anywhere.

Now you'll certainly say that this is all totally beside the point,  
and that you didn't really mean to say “inconsistent” but something  
else, and that we should consider your argument based on what you  
*mean*, not on what you *say*.

Go ahead.

Best,
Richard





> which you disputed in a separate email to this thread? Why must I  
> use two separate ways to check the types of literal resources and  
> non-literal resources?
>
>>
>> And we wouldn't want anyone to mix up surface serialization syntax  
>> and abstract model in this thread, wouldn't we? ;-)
>
> We wouldn't indeed. ;)
>
>>
>> (Just kidding -- I think I understood the point you are trying to  
>> make.)
>
> Thanks! It's nice to hear that once in a while. :)
>
> Best,
>
> Garret
>
> P.S. Does this mean I can keep railing against rdf:datatype? ;)
>

Received on Thursday, 2 August 2007 15:23:33 UTC