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

Archiv für 'PHPTMAPI'

QuaaxTM 0.6.0 released

19.01.2011

Version 0.6.0 of the PHP Topic Maps engine QuaaxTM has been released. See the changes log for what’s new and download at sourceforge.

PHPTMAPI 2.0.1 released

16.01.2011

PHPTMAPI 2.0.1 has been released. See http://sourceforge.net/projects/phptmapi/files/ for sources. See http://phptmapi.sourceforge.net/2.0/docs/ for the latest docs. 2.0.1 contains several enhancements and is backward compatible to version 2.0. You might have a look at the PHPTMAPI mailing list January archive for feature details.

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

You are currently browsing the archives for the PHPTMAPI category.

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