Re: Enhancing object-oriented programming with OWL

Hello,

Yes, I've seen Jenabean and some of the other software that treats 
attributes as properties, but I found them just recently.  I think I'll 
get in touch with one of those projects.  Mainly what I think I do 
differently is that my software just runs on Java instead of on anything 
like Sesame or Jena.  What I have is an alternative to Sesame or Jena.  
I have a version of HashSet that represents a set of objects for a given 
subject and non-functional predicate and is stored in an attribute:

SCollection<RangeClass> attribute = new SHashSet<RangeClass>();

It stores its unreasoned objects in a HashSet as a field.  Then when a 
read method is called on it, reasoning is done to add objects to the 
set.  The only reasoning done is what is relevant to adding objects to 
that set, though; not all of memory is reasoned.  It's as if Protege 
only did the reasoning relevant to the screen the user is currently 
viewing and left all the other data unreasoned.

It seems to me that storing data as sets of objects is a much better 
idea than storing whole triples.  It uses about a third as much memory.  
I'd think operations on Java Collections would be faster than operations 
on whole triples, but that's just a guess.

Certainly, object-oriented classes and OWL classes are different, but my 
understanding is that the main difference is just that OWL is strictly 
better.  I'm not aware of anything OOP can do that OWL cannot do, but 
OWL can do a lot more.  Well, abstract classes, but that's all I can 
think of.  Or if there is still going to be a disparity, we should still 
just be able to add all the OWL class constructs and everything else 
about OWL and let people use them in OOP.  We'd need to get into a 
compiler to do some of it, but I think it would be worth it.

Tim


On 08/17/2012 03:49 AM, Heiko Paulheim wrote:
> Hi Tim,
>
> there are quite a few frameworks doing similar things; JenaBean, 
> mentioned by Martynas, being one of them.
>
> Although the idea looks tempting, I do not think that simply mapping a 
> class model to an OWL/RDFS ontology in a 1:1 fashion will result in a 
> usable RDF model, since common modeling practices in ontology 
> engineering and OOX are different and not trivially compatible. Thus, 
> I believe that allowing more flexible mappings between a class model 
> and OWL/RDFS than just wiring each Java class to an OWL/RDFS class and 
> each attribute to a property is required.
>
> See our 2011 DESWeb paper [1] for an in-depth discussion.
>
> Best,
> Heiko
>
>
>
> [1] Paulheim et al.: "Mapping Pragmatic Class Models to Reference 
> Ontologies". In: 2nd International Workshop on
> Data Engineering meets the Semantic Web (DESWeb), 2011.
>
> Am 17.08.2012 09:33, schrieb Martynas Jusevičius:
>> Hey Timothy,
>>
>> are you familiar with JenaBean? It uses annotations for a similar 
>> purpose:
>> http://code.google.com/p/jenabean/wiki/AnnotationGuide
>>
>> Martynas
>> graphity.org
>>
>> On Thu, Aug 16, 2012 at 8:42 PM, Timothy Armstrong
>> <tim.armstrong@gmx.com> wrote:
>>> Hello everyone,
>>>
>>> My understanding is that we can post all object-oriented data on the
>>> Semantic Web, as object-oriented programming and OWL and are entirely
>>> compatible.  I have a correspondence between OOP and OWL. 
>>> Object-oriented
>>> classes are OWL classes, object-oriented attributes are OWL properties,
>>> object-oriented operations are Semantic Web Services, and 
>>> object-oriented
>>> packages are ontologies.  Class membership is unary predicates, and
>>> attributes are binary predicates, relating two entities.  In Java, if a
>>> field is a Java Collection or an array, each element in it is just the
>>> object of a triple.  I interpret all object-oriented data as being 
>>> triples
>>> in RDF.  So we should be able to serialize all object-oriented data 
>>> to RDF.
>>> We can thus have lots more data on the Semantic Web!
>>>
>>> Based on these principles, what we want to do is extend OOP to make 
>>> it into
>>> OWL, i.e. to make it better.  I've developed an extension to Java 
>>> using OWL
>>> and have just released it open source: http://www.semanticoop.org.  I'm
>>> looking to talk to people about it.  I've translated the entire RDF, 
>>> RDFS,
>>> and OWL ontologies into Java; see the packages beginning with org.w3 at
>>> http://www.semanticoop.org/xref/.  Here is rdfs:comment, for 
>>> instance, as a
>>> Java annotation in a file comment.java:
>>>
>>> @AnnotationProperty
>>> @label("comment")
>>> @comment("A description of the subject resource.")
>>> @isDefinedBy("http://www.w3.org/2000/01/rdf-schema#")
>>> @domain(Resource.class)
>>> @range(Literal.class)
>>>
>>> @Documented
>>> @Retention(RetentionPolicy.RUNTIME)
>>> public @interface comment
>>> {
>>>      public String[] value();
>>> }
>>>
>>> The OWL annotation properties are Java annotations, so I can write
>>> ontologies entirely in Java.
>>>
>>> The proof that the correspondence between attributes and properties 
>>> holds up
>>> is just that I have most of the property reasoning working for 
>>> attributes,
>>> and it all makes sense and seems like it would be very useful in
>>> object-oriented programming.  We will allow programmers to define 
>>> classes as
>>> intersections, unions, or complements of other classes, run SPARQL 
>>> queries
>>> and rules on main memory, and do everything else we can do with OWL 
>>> inside
>>> an object-oriented language, object database, or object-relational 
>>> database.
>>>
>>> I have a lot working.  I came across other software that treats 
>>> attributes
>>> as properties, like AliBaba, very late in the development process.  
>>> I think
>>> I did a lot differently.  Would anyone be interested in talking 
>>> about it or
>>> hearing more?  This is the first I'm announcing the project. I've 
>>> just done
>>> everything myself to this point, so I've gotten as far as I could.  
>>> I was
>>> trying to do it as part of my Ph.D. research.  I'm currently looking 
>>> to talk
>>> to people about the software rather than for people to use it yet. 
>>> Well, I
>>> hope people like it.
>>>
>>> Thank you,
>>> Tim Armstrong
>>>
>>>
>

Received on Friday, 17 August 2012 22:09:07 UTC