[topicmapmail] basics II - Inheritance in Topic Maps
Robert Barta
rho@bigpond.net.au
Tue, 03 Jun 2003 11:24:01 +1000
On Mon, Jun 02, 2003 at 05:02:18PM +0200, Lieberknecht, Katharina wrote:
> My question is, how does inheritance work with topic maps?
Katharina,
As Kal writes in this thread TMs are agnostic in respect to OO or
functional or other modelling paradigms. I think this was a wise
decision. It puts you (the ontology engineer) in charge instead of
pulling a particular model over the universe.
This implies that _you_ define in your ontology what _inheritance_
means for you (there are as many inheritance concepts as there are OO
languages I reckon). See below.
> I want to make a tm only with the general relationship
> "is-related-to (somehow)"
I had to read many maps (from students) which contained a
'is-related-to' association. I cannot say that made me too happy
because it is almost meaningless to the reader (Bush is also somehow
related to Osama-bin-Laden). It is sometimes difficult to come up with
good association types (and roles) but works out most of the time
(took me a while, though).
> And the more specialized "superclass-subclass" (is-a) relationship.
Yes, I have to tell my authors to be very concious of the distinction
- is-a as "is-instance-of-a-class", and
- is-a as "subclass-superclass"
kind of associations.
> Example:
>
> Science super-to physics
> physics super-to acoustics
> physics super-to mechanics
> physics super-to optics
Is science a superclass of acoustics? Does this (in AsTMa=[1]) make
sense to you?
(is-subclass-of)
superclass : physics
subclass : acoustics
I would have seen 'is-subclass-of' as a good candidate for an
association if all instances of one class are also meant to be
instances of the superclass. With 'physics' and 'acoustics' my best
bet would be 'is-subdiscipline-of' or something along these lines:
(is-subdiscipline-of)
discipline : physics
subdiscipline: acoustics
> Now I wonder whether instances of the topics inherit from their
> topic types?
As Kal mentioned, usually classes "inherit" from each other and that a
query language will have to collect the properties. You can influence
this with an ontology definition. In your ontology you may want to say
"for every discipline I need at least one expert". So if physics is an
instance of a discipline and, say, acoustics is as well then an
ontology rule as above would be
forall .. things which are an instance of discipline...
=> exists ... an association of type 'is-expert-in'
where the discipline plays a role ...
Here you prescribe that _every_ map which claims to follow your
ontology definition must make the above statement true. You as
ontology engineer can define what properties instances of a particular
class must expose.
Unfortunately, we do not have an official TM ontology language yet.
> And if, how far backwards do they inherit? Are there rules for
> inheritance?
You can control this with the ontology as well. So, for instance,
if you want the 'is-expert-in' property inherit along a particular
axis then you could say
forall ... instances X of 'discipline' and
=> forall experts E of this discipline and
=> forall other disciplines Y which are
connected via a 'uses-same-theory'
with this above discipline
=> exists that that above expert E is also
an expert in Y
> my_camera is-instance of camera
> 1. Is my_camera then automatically related-to optical elements,
> optics, physics and science?
Truth is in the eye of the beholder. In this case it will be up to the
query/retrieval engine not only to load and process your map but also
the ontology behind it.
I am not sure that helped :-)
\rho
[1] http://astma.it.bond.edu.au/astma=-tutorial.dbk