Just last week I had two more such requests, and decided to do something about it; I'm doing it again, this time a bit more formal and a bit better informed. Basically, I'm starting up again a Topic Maps for PHP5 project, and this post will work as a first design draft. Some of it is based on code I've already done, and the rest I will have to take in stride over the next little while as I'm in a deadline zone right now;
There's a few things to say about Topic Maps in itself. The first is a choice between using the Topic Maps DataModel (TMDM) vs. the Topic Maps Reference Model (TMRM). Actually, it's an easy choice; I've made the switch to the TMRM some time ago, and haven't looked back since. The TMRM is an abstract layer above the TMDM, and in fact you can define the TMDM in it, so it's a good candidate for doing serious work, albeit it's not as widely supported as the TMDM. In this case, it shouldn't matter too much as I'll be using it to define a version of the TMDM to stay compatible with XTM (1.0 and 2.0).
Features and requirements
The framework / toolkit will do the following ;
- Out-of-the-box visualisation and browsing of Topic Maps
- Provide a simple API for working with Topic Maps (but not TMAPI)
- input and output XTM 1.0 and 2.0, input LTM and input CSXTM
A bit of controversy about this one, perhaps, but the internal representation of the Topic Maps data / reference model will be done in XML. Yup, you heard that right, but there's a few reasons that I'm going down this path;
- Cross-technology; most technology platforms have support for XML, with API's or tools to work with them.
- XML technologies are mature and getting very fast indeed; I don't want to impose too much OO mockery if I can avoid it for such a simple tool.
- I love XSLT and XPath; no way around this one, and XPath is a fantastic way to handle a lot of complex XML querying, given that the XML is well-written for the task (this is why we're not using XTM but something else internally)
Where am I up to?
The caching and converting of XTM 1.0 is complete, and the internal XML format nearly complete, with queries being about 7 times faster than they would be if working with XTM directly. That's a pretty good start. The caching layer is such that you can use file cahcing, database caching, or somewhere inbetween (for example, choosing ADO or Zend::Db), giving you heaps of options for scalability and performance.
Using the normal test Topic Map, the Opera map by Steve Pepper, somewhat complex queries and handling is done in the 0.3 ms region, which is good enough for a version 1.0 of the framework.
I'm currently tweaking the input and output buffering and converters, creating more efficent internals for the XML handling, and writing up some documentation as well.
Where do I want to go?
- Support for "enterprise size" topic mapping, meaning maps between 5 and 50 Mb in XTM 1.0 size.
- Concurrent editing of the maps.
- Astoundingly easy user-interface.
- An XSLT framework to support those user-interfaces (I've actually done this bit already as part of a different project, but I need some time to document and clean it up :)
- An internet community to use and help out (which is also why I chose an XML internal engine wrapped up in PHP for simplicity).