Re: Further testing...

From: Rickard Öberg <rickard.oberg_at_senselogic.se>
Date: Mon, 23 Jan 2006 22:11:21 +0100

David Huynh wrote:
>> I added generic XPath's to this which indexes ALL references between
>> objects, regardless of where they are. I am all giggly now, because
>> the result is just mindbogglingly cool. Now I can do search-replace of
>> object references (e.g. "delete object X and replace all references
>> with object Y") and easily find how many links I have to a particular
>> page (e.g. "find all references between X and Y where X is a Link and
>> Y is a Page"). Stuff like that. Things that would have been IMPOSSIBLE
>> with our old technology, and certainly very very difficult with either
>> just an RDBMS or even XML-database. Now it's just plain trivial. I
>> could even implement garbage collection of objects in the database by
>> using this (e.g. "find all objects with no references and remove them.
>> Repeat until none are left").
>
> Any of this code we can reuse?... :-)

Well, most of it is fairly straightforward code. Basically, for the
storage the Java objects are serialized using XStream into a DOM Node.
The XPath's of the desired properties goes into an XSL which is applied
to the DOM using TrAX. The XSL has the Graph bound as parameter so that
the XSL rules can add stuff into it, or even better, use a simple
utility method object whose methods can be called from the XSL to add
RDF properties to the graph. The current XSL's that I use are very
specific to our way of doing objects and persistence with AOP, but any
system that can handle object references should be relatively easy to
handle with XStream (like JDO or EJB). You really do need to be able to
distinguish between a plain Java reference (such as A having a Date
object as instance variable) and an object reference (such as A having a
field with B as value, or A having a collection with B as member). We do
it using proxies (or variants thereof), and it's those proxy references
which are stored and indexed as RDF references.

So, no. I'm afraid not. But, as above, it should be fairly easy to do
something similar for whatever persistence store you fancy. The tricky
part is the relationship between the XML/RDF store and the Java object
model, since the latter needs to be able to have proxy references (or
similar).

Making sense?

/Rickard
Received on Mon Jan 23 2006 - 21:10:51 EST

This archive was generated by hypermail 2.3.0 : Thu Aug 09 2012 - 16:39:18 EDT