[topicmapmail] Topic Maps in a DBMS
Guy Murphy
guy.murphy@easynet.co.uk
Thu, 7 Aug 2003 07:05:32 +0100
There's no definitive answer Dan.
What I can do is show you the model I'm using for a current project which
persists something a lot like a topicmap. Keep in mind this is something
like a topicmap and not an actual topicmap, with some regarding the
departure from cannon heresy.
Topic (Topic_id, Name).
Association (Assoc_id, Assoc_role).
Occurrence (Topic_id, Resource, Behaviour, Content, Context, Ordinal).
Locator (Assoc_id, Topic_id, Loc_role).
So if we had some instance data marked up thus...
<topic id="GuyMurphy">
<name>Guy Murphy</name>
<occurrences>
<occurrence resource="someDB" behaviour="moduleToResolveRef"
context="primary">guy_murphy</occurrence>
</occurrences>
</topic>
<topic id="RyanMurphy">
<name>Ryan Murphy</name>
<occurrences>
<occurrence resource="someDB" behaviour="moduleToResolveRef"
context="primary">ryan_murphy</occurrence>
</occurrences>
</topic>
<association role="family">
<locator ref="GuyMurphy" role="brother" />
<locator ref="RyanMurphy" role="brother" />
</association>
Then the data we shove in our tables might look like...
Topic (GuyMurphy, 'Guy Murphy').
Topic (RyanMurphy, 'Ryan Murphy').
Occurrence (GuyMurphy, someDB, moduleToResolveRef, guy_murphy, primary, 0).
Occurrence (RyanMurphy, someDB, moduleToResolveRef, ryan_murphy, primary,
0).
Association (anon_0001, family).
Locator (anon_0001, GuyMurphy, brother).
Locator (anon_0001, RyanMurphy, brother).
Again, this isn't a topicmap, and it's not XTM, it's something similar. What
it will hopefully do is illustrate how one can wire together nodes and arcs
in a relational model.
What I've also found useful is freeform metadata for topics and associations
modelled thus...
Metadata (Item, Value, Type, Reference).
Which allows me to extend the topic and association model flexibly and
informally with something like...
Metadata (created, '07 August 2003', topic, GuyMurphy).
This has been a real god-send when using a topicmap-like datastore for a Web
application and has allowed me to keep maps simple which might otherwise
have quickly become complex.
I'm not sure if I've made enough sense; I've not wanted to belabour any
points and bore you. If I've been too terse yell, and I'll provide more
explanation.
Unless you actually need a topicmap, and know why you need a topicmap, I'd
suggest you take a look at the Associative Model of Data
http://www.lazysoft.com/docs/other_docs/amd_whitepaper.pdf for inspiration.
When I come to reimplement I'll be moving in this direction as here's
aspects of the topicmap model of a graph that I've found a major pain in the
arse.
Lastly the Ordinal on Occurrence is a nasty hack that I found necessary in a
particular application. It's presence is undesirable in most cases.
Cheers,
Guy.
----- Original Message -----
From: "Dan Corwin" <dan@lexikos.com>
To: "Murray Altheim" <m.altheim@open.ac.uk>
Cc: <topicmapmail@infoloom.com>
Sent: Friday, August 08, 2003 6:02 AM
Subject: Re: [topicmapmail] Topic Maps in a DBMS
> Hi Murray-
>
> If I want to persist various topic maps in a data base,
> what table structures would I declare?
>
> I can visualize topic maps concretely as XTM fragments,
> or sometimes as networks of Java objects.
>
> But what does a topic map look like under (e.g) mySQL?
>
> And is this black art or a cookbook design pattern?
>
> Dan
>
> Murray Altheim wrote:
> > Dan Corwin wrote:
> >
> >> How does one set up a relational data base schema that comfortably
> >> handles the topic map paradigm? Is there a standard approach?
> >>
> >> Thanks for any references or comments.
> >
> >
> > Perhaps you could clarify. What do you mean by "comfortably handle the
> > topic map paradigm"? Certainly, databases can store documents, and links
> > can be represented and acted upon by application software. Is there
> > something specific you have in mind?
> >
> > Murray
> >
> >
...........................................................................
> > Murray Altheim
http://kmi.open.ac.uk/people/murray/
> > Knowledge Media Institute
> > The Open University, Milton Keynes, Bucks, MK7 6AA, UK
.
> >
> > "Shhh. Be vewy, vewy quiet. We're hunting wabbits." -- Elmer Fudd
> >
> > "I don't know how close we are, closer than we were yesterday,
> > I guess. All I know is we're on the hunt." -- George W. Bush
> > BBC News: http://news.bbc.co.uk/1/hi/world/americas/3110615.stm
> >
> >
>
> _______________________________________________
> topicmapmail mailing list
> topicmapmail@infoloom.com
> http://www.infoloom.com/mailman/listinfo/topicmapmail
>