XPath

Started work on XPath integration into the mandarax project today. This is one of the three current projects I am working on, and to say the least, is interesting. Before a few days ago I didn’t even know what XPath was, let alone how to extend it to be able to retrieve data stored within an uncommon document model (i.e. the Mandarax KnowledgeBase class).

Results have started appearing. I can now request all facts (think declarative programming, knowledge bases, and in general, a Java version of Prolog) simply by giving the following XPath query:

/fact

Isn’t that cool? Ok, maybe not to you, but to the people at Massey who created the rest of Mandarax, this will be incredibly useful. Maybe another example would be in order. If I want a list (an Iterator to be specific) of all predicates in the head of a rule, I can give the XPath query:

/rule/head/predicate

I’m still working on a lot of things, so whilst this looks like good progress, I know I have a fair bit more work to do (considering this is a 3-4 week job).

Work

So, I’ve spent yesterday and today doing a slightly different thing – I wrote my first ever decent server application. It’s a little, 1000 line Java application which is designed to provide a server-side to my research. Currently, it handles:

  • Users requests for reminder alerts to be emailed or SMS’d.
  • Users subscriptions to be emailed or SMS’d when something they have subscribed to changes in a way in which they are interested.
  • Server side SQL. Previously, the client directly communicated with the database through JDBC. This is obviously not optimal. Now, the server can handle both database queries (‘SELECT’, returning a CachedResultSet) and INSERT/UPDATE statements.
  • LDAP user authentication. Once again, the client currently communicates directly with the LDAP server, so this is now replaced with the client communicating with the server, which then takes care of talking to LDAP.

The last two points meant I had to define my own protocol for the various options. This was rather ‘cute’, with my communication between the server and client being messages like ‘hello’, ‘ok’, ‘sql’, ‘ldap’, and ‘bye’.

A benefit to doing this is that it lessens the filesize of the client – we no longer need JDBC or LDAP libraries. For the MySQL and Novell eDirectory libraries, this cuts out about 540Kb of file size. It only gets bigger on larger database servers as well.

I’ve pretty much done my server work now, so I may go relax for a bit. Next week I start work out at Massey for three weeks, which should be a bit of money but I need to actually study the stuff I’m doing – mainly XPath, XSLT, XML, and a library called Jaxen.

Ciao.

Merry Christmas

Hi there,

I thought I’d just write to say that I hope everyone has a good Christmas and new year. My plans are simple – spending time at home with family and Julia (my fiancee).

Next year over the Summer break I plan to continue with my three software projects (Leopard Tutor, Centruflow, and Mandarax), and get out and enjoy the sun a bit. I’m planning to get away to Kuratau (at the southern end of Lake Taupo, and right on the beach), and Microsoft is flying me up to Auckland for an orientation as to my role as a student ambassador for Massey University here in Palmy. I’m hoping to come up a few days early with Julia and make a mini-holiday out of it as well – 4 or so days away from the laptop. Yes, I know laptops are portable, but having been on it so much these last few months with massey, it’ll be nice to get away from it for a bit.

Anyway, one other thing – I have a bad hand – nerve damage up by the elbow in fact. It’s still getting worse, and causes my fingers on my left hand to be very weak and droop. As you can imagine this makes typing quite a long process. Hence my lack of updates. I have already had one operation to try and fix it (in April 2005), but they couldn’t find the problem. I’m likely in the next few months to need another operation, and hopefully this time the (new) surgeon can help out.

Catch you later,

Jo.