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

PHPTMAPI CXTM writer

gepostet von Johannes Schmidt

Some days ago, I have committed a CXTM writer to QuaaxTM’s SVN. This writer is part of the QuaaxTMIO library. What is Canonical XTM, or CXTM for short?

“[...] The format is an XML format, and has the property that it guarantees that two equivalent Topic Maps Data Model instances [ISO/IEC 13250-2] will always produce byte-by-byte identical serializations [...] CXTM thus enables direct comparison of two topic maps to determine equality by comparison of their canonical serializations.” [1]

The CXTM-tests project provides a test suite based upon the various Topic Maps syntaxes which allows easy verification of Topic Maps software’s standards compliance.

The purpose (and advantage) of using CXTM tests in the context of deserialization and serialization of topic maps is obvious. It is possible to test the readers and writers for spec./standards conformity while, at the same time, the Topic Maps engine the readers and writers are working against is tested for Topic Maps Data Model (TMDM) compliance. Engines using CXTM tests are more reliable (from the standards perspective) than engines which are not using CXTM tests. This is the USP of CXTM.

QuaaxTM now passes all tests via reading the valid XTM 2.0 sources from the CXTM test suite and writing the respective CXTM using the XTM 2.0 parser and the CXTM writer. Both components are not yet officially released but committed to the SVN and ready to be checked out. Version 0.51 can be simply replaced by the SVN content.

As QuaaxTMIO only depends on PHPTMAPI the CXTM writer can be used by any PHPTMAPI implementation. The API is trivial:

$writer = new PHPTMAPICXTMWriter($tmLocator);
$cxtm = $writer->write($topicMap);

$tmLocator is the topic map’s locator as defined in http://phptmapi.sourceforge.net/2.0/docs/core/TopicMapSystem.html#createTopicMap; $topicMap is an implementation of PHPTMAPI TopicMap.

Two prerequisites have to be considered: The writer as well as the XTM 2.0 parser use PEAR’s Net_URL2 and, the writer exclusively, uses PHP’s Normalizer.

Happy CXTMing!

[1] http://www.isotopicmaps.org/cxtm/cxtm.html

Keine Kommentare

Kommentare zu diesem Beitrag als RSS 2.0 feed.

Kommentar abgeben

Folgendes HTML ist erlaubt: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

* Pflichtfelder

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