ontolog-forum
[Top] [All Lists]

Re: [ontolog-forum] When to use pure subclassing and when to use subclas

To: "'[ontolog-forum] '" <ontolog-forum@xxxxxxxxxxxxxxxx>
From: "Rich Cooper" <rich@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 26 Jul 2009 08:25:46 -0700
Message-id: <20090726152551.3B6B5138CD4@xxxxxxxxxxxxxxxxx>

It seems to me that the major difference is that logic presumes a global dictionary, so all properties are specifically defined and associated with a globally unique identifier.  OOP classes have private symbols, and the meaning of symbols (read, write, …) depends on which class(es) interpret the symbols.  In OOP, only the type names are globally uniquely defined.  All others are locally defined within a scope. 

 

-Rich

 

 

 

Sincerely,

Rich Cooper

EnglishLogicKernel.com

Rich AT EnglishLogicKernel DOT com

 


From: ontolog-forum-bounces@xxxxxxxxxxxxxxxx [mailto:ontolog-forum-bounces@xxxxxxxxxxxxxxxx] On Behalf Of Duane Nickull
Sent: Sunday, July 26, 2009 8:18 AM
To: [ontolog-forum]
Subject: Re: [ontolog-forum] When to use pure subclassing and when to use subclassing by intersecting

 

Agree here.  As a programmer first, the subclass relationship has special meaning.

//AS3 super class
Private class SuperClass():void {
 public var  name:String;

//methods
 private setName (String name) {
   name = this.name;
   }

 private getName():void {
  returns name;
  }
}

And now a subclass that extends the super
 
Private class SubClass():void extends SuperClass{
// this should do everything the super does but add something new.  
// by using “extends” it will inherit the Superclasses methods.

 public var  age:Integer;

//methods. Using uint instead of int since age will normally be 0 >
 private setAge (uint age) {
   age = this.age;
   }

 private getAge():void {
  returns age;
  }
}

Now an intersection class is often used in UML where CEP principles are involved.   This is however not a true intersection so it is usually called an Association class. Association class In modeling an association, there are times when you need to include another class because it includes valuable information about the relationship. For this you would use an association class that you tie to the primary association. An association class is represented like a normal class. The difference is that the association line between the primary classes intersects a dotted line connected to the association class. An example might be a class called “Event” and another one called “Entity” and the association class might document how the two are related (An Entity can be a catalyst for an event).

A true intersection must take two classes unrelated by their hierarchies' (often difficult since most taxonomies of classes in programming all inherit from the same primitive.  For example, everything in Java inherits from the Object:object).  There are some times when these do exist though.  Imagine you have a HusbandNetWealth and a WifeNetWealth class, you could say there is an intersection called “MarriedCoupleNetWealth” however many OO languages allow for something called Multiple inheritance and polymorphisms.  The latter class in this case can inherit from both the previous classes therefore rendering the intersection class notion completely worthless for most programmers and they simply regard it as an unnecessary construct invented by people who do not understand class inheritance.

Strictly speaking, from a programming perspective, most people will try to maintain some lineage of a hierarchy rather than trying to make an “intersection class” which is why ontologists who do this have a hard time trying to find programmers willing to implement their work.

Of course, this is all my personal opinion and others on the list will probably argue against it.

Duane Nickull

On 7/25/09 7:49 AM, "garz" <garz@xxxxxxx> wrote:

Hi Patrick,

i'm an object-oriented programmer, maybe thats why i have problems
understanding the concepts of an ontology. I dont want to model
anything, i want to write some components that enable you to create and
use ontologies in a some program. Therefor i need to understand the
concepts, so that those components can offer the full spectrum and in a
convenient way.

In object-oriented programming there are also classes and inheritance.
There i subclass a class so that i can add new properties to it (besides
adding new methods, which arent relevant for ontologies). You write,
that i cant have properties in a subclass that arent also in the
parentclass, but instances of a subclass can have properties that
instances of the superclass dont have because those properties arent
required in the superclass, but are required in the subclass. Is that right?

my question arose by studying the two example ontologies food.rdf and
wine.rdf in the ontology guide on the w3-site:
http://www.w3.org/TR/2004/REC-owl-guide-20040210/food.rdf
http://www.w3.org/TR/2004/REC-owl-guide-20040210/wine.rdf

in the food.rdf, there are the classes:
<owl:Class rdf:ID="ConsumableThing"/>

<owl:Class rdf:ID="PotableLiquid">
<rdfs:subClassOf rdf:resource="#ConsumableThing"/>
<owl:disjointWith rdf:resource="#EdibleThing"/>
</owl:Class>

and in the wine.rdf there is the class:
<owl:Class rdf:ID="Wine">
<rdfs:subClassOf
rdf:resource="http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#PotableLiquid"/>
<rdfs:subClassOf>
   <owl:Restriction>
      <owl:onProperty rdf:resource="#hasMaker"/>
         <owl:cardinality
rdf:datatype="http://www.w3.org/2001/XMLSchema#nonNegativeInteger">1</owl:cardinality>
   </owl:Restriction>
</rdfs:subClassOf>
.....
</owl:Class>

<owl:ObjectProperty rdf:ID="hasMaker">
<rdf:type rdf:resource="http://www.w3.org/2002/07/owl#FunctionalProperty"/>
</owl:ObjectProperty>

Here, the class Wine defines new properties, that the class
PortableLiquid doesnt posses. But this is done via anonymous classes
that are defined between the <rdfs:subClassOf>-tags? So the Wine class
is subclass of PortableLiquid and a anonymous class that defines the
property hasMaker and that it this property required, right? So to say,
the new properties that the Wine class posseses are tricked into the
Wine class? Tricked because subclasses cant have new properties, like
you wrote respectively like i hope to have understood it in the right way.

I want to very much thank you, both Patrick and Alex, for taking your
time to answer my questions.
@Alex, i will come back to your explanation, as soon as i understand a
little more.

Best regards
Mario Uhlig


Patrick Cassidy schrieb:
> Garz,
>    I am not quite clear about the question, and the distinctions you are
> making.   Every subclass merely picks out of some parent class instances
> that have specific properties.  So you cannot have in a subclass properties
> that are not also in the parent class, but you can *require* that the
> instances of the subclasses have a specific property, even if that property
> is not "mentioned" (i.e. not required) for every instance of the parent
> class.
>
>   The term "intersection" is usually used to refer to an intersection of
> classes - the intersection is the class of entities, each of which is an
> instance of both parent classes.  That intersection is a subclass of each of
> the parent classes.  If you have a class of "RedThings" (anything that is
> red) and a class of "Wines" and you define a class of "RedWines" it could be
> a subclass of both RedThings and of "Wines", and would be the same as the
> intersection of "RedThings" and "Wines", unless you also add other
> restrictions to the "RedWines" class.  [[ this is a bad example, because
> colors are too heterogeneous in application for "RedThings" to be a useful
> class]].  You seem to be using "intersection" in a different sense.
>
>   Perhaps you could give a more specific example of what you would like to
> do.
>
> Pat
>
> Patrick Cassidy
> MICRA, Inc.
> 908-561-3416
> cell: 908-565-4053
> cassidy@xxxxxxxxx
>
>
>  
>> -----Original Message-----
>> From: ontolog-forum-bounces@xxxxxxxxxxxxxxxx [mailto:ontolog-forum-
>> bounces@xxxxxxxxxxxxxxxx] On Behalf Of garz
>> Sent: Friday, July 24, 2009 12:35 PM
>> To: ontolog-forum@xxxxxxxxxxxxxxxx
>> Subject: [ontolog-forum] When to use pure subclassing and when to use
>> subclassing by intersecting
>>
>> Hi,
>>
>> i'm trying to create an ontology and there is a problem that i have in
>> understanding the difference between a pure subclass and a subclass
>> defined as intersection. my own explanation for this is the following:
>>
>> a subclass defined as intersection relates to the properties the
>> superclass has and constraints them. for example redwine constraints
>> the
>> property color of the superclass wine by constraining its value to red.
>> redwine is like an aspect or a view on a class, in this case on the
>> aspect color. or its like an alias picking a subset out of the related
>> superclass. a class defined that way introduces a new concept or term
>> by
>> just using the already existing, its not capable of creating new
>> content, so to speak.
>>
>> a pure subclass should then be used, if there is something new to it,
>> represented as a property that isnt mentioned in the superclass and the
>> subclass is free to introduce this property or not. if the property
>> already was in the superclass, a subclass defined by intersection would
>> be sufficient.
>>
>> am i correct with this thinking? i dont really get it. or is
>> intersection always applicable, but in this case i really dont
>> understand the sense behind it. plz enlighten me.
>>
>> regards
>>
>> _________________________________________________________________
>> Message Archives: http://ontolog.cim3.net/forum/ontolog-forum/
>> Config Subscr: http://ontolog.cim3.net/mailman/listinfo/ontolog-forum/
>> Unsubscribe: mailto:ontolog-forum-leave@xxxxxxxxxxxxxxxx
>> Shared Files: http://ontolog.cim3.net/file/
>> Community Wiki: http://ontolog.cim3.net/wiki/
>> To join: http://ontolog.cim3.net/cgi-bin/wiki.pl?WikiHomePage#nid1J
>> To Post: mailto:ontolog-forum@xxxxxxxxxxxxxxxx
>>
>>    
>
>
> _________________________________________________________________
> Message Archives: http://ontolog.cim3.net/forum/ontolog-forum/
> Config Subscr: http://ontolog.cim3.net/mailman/listinfo/ontolog-forum/
> Unsubscribe: mailto:ontolog-forum-leave@xxxxxxxxxxxxxxxx
> Shared Files: http://ontolog.cim3.net/file/
> Community Wiki: http://ontolog.cim3.net/wiki/
> To join: http://ontolog.cim3.net/cgi-bin/wiki.pl?WikiHomePage#nid1J
> To Post: mailto:ontolog-forum@xxxxxxxxxxxxxxxx
>
>
>  


_________________________________________________________________
Message Archives: http://ontolog.cim3.net/forum/ontolog-forum/
Config Subscr: http://ontolog.cim3.net/mailman/listinfo/ontolog-forum/
Unsubscribe: mailto:ontolog-forum-leave@xxxxxxxxxxxxxxxx
Shared Files: http://ontolog.cim3.net/file/
Community Wiki: http://ontolog.cim3.net/wiki/
To join: http://ontolog.cim3.net/cgi-bin/wiki.pl?WikiHomePage#nid1J
To Post: mailto:ontolog-forum@xxxxxxxxxxxxxxxx


_________________________________________________________________
Message Archives: http://ontolog.cim3.net/forum/ontolog-forum/  
Config Subscr: http://ontolog.cim3.net/mailman/listinfo/ontolog-forum/  
Unsubscribe: mailto:ontolog-forum-leave@xxxxxxxxxxxxxxxx
Shared Files: http://ontolog.cim3.net/file/
Community Wiki: http://ontolog.cim3.net/wiki/ 
To join: http://ontolog.cim3.net/cgi-bin/wiki.pl?WikiHomePage#nid1J
To Post: mailto:ontolog-forum@xxxxxxxxxxxxxxxx    (01)

<Prev in Thread] Current Thread [Next in Thread>