Social Software powered by Instant Communities
Springe direkt: zur Navigationzum Inhaltzur Sidebar

Archiv für 'php'

Vote on PHPTMAPI 2.0.1

14.01.2011

Today’s the last chance to vote on PHPTMAPI 2.0.1. See http://sourceforge.net/mailarchive/message.php?msg_id=26869004. Just join our mailing list to contribute.

Importing topic maps with QuaaxTMIO

07.11.2010

Last week, version 0.5.4 of the QuaaxTM PHP Topic Maps engine was released which, finally, brought XTM 2.1 read/write support via the QuaaxTMIO library. QuaaxTM now provides a basic tool set of Topic Maps technologies enabling PHP developers to build subject centric applications on the LAMP stack.

An essential feature is the import of topic maps. Topic maps (TMDM instances) can be serialized to one of the various Topic Maps syntaxes such as XTM 1.0/2.0/2.1, CTM, LTM, AsTMa=, or JTM to allow data interchange. Let’s see how to import a publicly available topic map from Maiana using the QuaaxTMIO library; I choose Lutz Maicher‘s  topic map about Donald Duck in XTM 2.1 for the following example.

QuaaxTM has to be set up like described in README (maybe you’d like to tun the PHPUnit tests afterwards). You’ll need three classes then which you have to require_once:

  • TopicMapSystemFactory.class.php (from lib/phptmapi2.0/core)
  • PHPTMAPITopicMapHandler.class.php (from lib/quaaxtmio/src/in)
  • XTM201TopicMapReader.class.php (from lib/quaaxtmio/src/in)

First, get a TopicMapSystem:
$tmSystemFactory = TopicMapSystemFactory::newInstance();
// QuaaxTM specific feature
$tmSystemFactory->setFeature(
VocabularyUtils::QTM_FEATURE_AUTO_DUPL_REMOVAL, false
);
$tmSystem = $tmSystemFactory->newTopicMapSystem();

Import the topic map using the XTM 2.0/2.1 parser and a topic map handler:

$tmHandler = new PHPTMAPITopicMapHandler($tmSystem, 'http://localhost/topicmaps/1');
$reader = new XTM201TopicMapReader($tmHandler);
$reader->readFile(
'http://maiana.topicmapslab.de/u/lmaicher/tm/ducks/download.xtm'
);

Finally access the imported topic map via PHPTMAPI 2.0:

$tm = $tmSystem->getTopicMap('http://localhost/topicmaps/1');
$topics = $tm->getTopics();
echo count($topics);// 278

Yet another QuaaxTM release – 0.5.3

09.10.2010

There has been yet another release of the PHP Topic Maps engine QuaaxTM. Version 0.5.3 comes with JTM 1.0 import and export (via QuaaxTMIO library). Import of brand new JTM 1.1 is also supported. Download latest version here.

QuaaxTM 0.52 released

01.09.2010

All details in this post on the Topic Maps mailing list.

You are currently browsing the archives for the php category.

Creative Commons License
This work is licensed under a
Creative Commons Attribution-Share Alike 2.5 License.
t8d blogged mit WordPress