W3C home > Mailing lists > Public > semantic-web@w3.org > December 2005

Re: How will the semantic web emerge - OO languages

From: Henry Story <henry.story@bblfish.net>
Date: Wed, 21 Dec 2005 16:18:18 +0100
Message-Id: <6EBDF187-B7F7-4432-94EB-74EF71B13366@bblfish.net>
Cc: Frank Manola <fmanola@acm.org>, semantic-web@w3.org, Joshua Allen <joshuaa@microsoft.com>
To: Russell Duhon <fugu13@mac.com>


On 21 Dec 2005, at 00:16, Russell Duhon wrote:
> Its not so much a dichotomy of optional/not optional, but typing-by- 
> properties and typing-by-class.
>
> Duck typing is where an object is treated with based on what  
> properties it has, or in python and similar, what methods can be  
> called on it. If I have a function that calls certain methods on  
> the objects passed in, it very well might not matter which objects  
> are passed in, provided they have those methods -- the formal types  
> are not considered directly. This is duck typing -- anything that  
> walks like a duck, quacks like a duck, and looks like a duck might  
> as well be a duck.

RDF is a declarative language so things are at first view somewhat  
different. We are working in a space where inferencing is the norm.  
So if something

[ foaf:firstName "Henry"].

you can deduce

[ foaf:firstName "Henry";
   rdf:type foaf:Person ].

This is not like saying "treat it like a foaf:Person". It *is* a  
foaf:Person. Those relations go hand in hand. When you say one, you  
are commited to the other. You are so committed in fact that you  
don't need to state the foaf:Person part. It is part of your first  
statement. Just as when you say x is a bachelor, you are saying he is  
an unmarried man.


> Those objects (in Python) still have strong types, its just that  
> methods don't have type signatures (at least, not unless you make  
> that happen ;-) ), and the language is dynamically typed. If my  
> method still works whether a string or an integer is passed in, I  
> can pass in either -- but a string is very much not an integer, and  
> there are certain operations that protest very loudly if I try  
> using a string like an integer or an integer like a string!
>
> One can also include those checks of object types in one's code, as  
> needed/desired.

By the way I have written a RDF to Java OO mapping, and describe how  
one can do that here:
http://blogs.sun.com/roller/page/bblfish? 
entry=java_annotations_the_semantic_web

My guess is that there will be different ways to do the mapping for  
each OO language out there.

> Now, RDF's not quite in the same situation -- types really are  
> optional, in a sense. But its also going to continue to make sense  
> to create RDF with lots of type-rich information, and create  
> ontologies that can infer types in under-typed RDF.

The way I interpret relations without a type in RDF is to map these  
relations to java.util.Map .
I have found that sometimes it is more interesting just to look at  
the Maps between things, and ignore the types. The RDFMap constructor  
takes a URI in its constructor, where one can specify the rdf  
relation that identifies this map.


> The first is pretty clear because tools for creating RDF and  
> interpreting common sorts of RDF can get a leg up with types. For  
> instance, if I want all RSS items in an RDF store, the type is one  
> of the best ways to get at those. I expect a lot of RDF uses will  
> require certain type information, much like RSS 1.0 effectively  
> does, in order to ensure easy "mining".
>
> The second is happening/will happen because it allows for the use  
> of generic reasoners. I won't have to create an application that  
> meticulously examines my RDF data for desired instances, I'll throw  
> a declarative ontology at it, then be able to grab things by type  
> and know they're the sort of thing I want.

yes. I find this very useful in BlogEd where I use an RDF database to  
store my data.

> Because it makes sense for a lot of RDF to be type rich or type  
> enrich-able, I think any view emphasizing type-optionality is  
> missing out on a lot of the potential for RDF. At the same time,  
> any view trying to make all RDF data be strictly typed is flawed as  
> well (particularly as some typing information from OWL Full  
> ontologies and the like will be problematic to determine), and  
> misses out on many of the possibilities for flexible RDF usage that  
> proceed purely based on examining (non-type parts of) the graph.

I agree. Use what is needed when it is needed.


> Russell
>
>
>
> On Dec 20, 2005, at 5:27 PM, Frank Manola wrote:
>
>>
>> Russell Duhon wrote:
>> snip
>>
>>> Personally, I view RDF as more along  the lines of Python or  
>>> similar important dynamic, strongly typed  languages -- we can  
>>> play fast and loose with it in many ways, using  duck typing, but  
>>> the types are still there to exploit when useful.
>>
>> This seems like a reasonble position, except that being able to  
>> ignore the types when you want to makes them optional doesn't it?   
>> And playing fast and loose doesn't sound like what I recall of  
>> strong typing!
>>
>> --Frank
>>
>
Received on Wednesday, 21 December 2005 15:18:44 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 22 February 2013 14:24:52 GMT