kokkenの仕事で、色々なnative XML server/libraryを使ったので、それらの特徴について記しておきます。 国立国語研究所で 作成された日本語話し言葉コーパス(CSJ)で構築されたXMLの構造は、深い上にデータ量も多いため、扱うライブラリがrobustな 作りになっていないと処理時間がかかるうえに作業中に落ちます。今回はXMLの検索として XQueryを使用したのですが、このXQueryを扱えるプログラムのうち、 自分が使っみてよかったと感じたものは、最初からあったTamino XML serverとeXistとQizx/Openです。
仕事についた時すでに使用が決まっていたものです。version4.1.4.1のLinux版はvesion3と違ってglibcのversionを
選び、RedHatLinux7.2のglibc環境以外ではまともに動かないという問題はありましたが、商用のdatabase serverである程度
安価なものの中では一番良く安定しており、tuningもそれなりに効いているものです。XPathでの検索のほうがずっと得意です。
Taminoを作っているSoftwareAGという会社はだいぶXMLに特化しているようです。最近、StarOffice(日本ではStarSuite)の
ロゴsplashにPowered by Software AGとあることに気づきました。そういえば、StarOfficeの保存ファイルは、
XMLのzip圧縮ですね。

今回はTaminoがあったので使う必要はなかったのですが、XQueryをサポートするdatabase serverとしてはよくできている ように感じました。
今回のツール作成では、Taminoサーバが存在しない状態でも検索ができるようにという条件があったので、XQueryを高速に実行できる Javaのライブラリが必要でした。W3Cのページにはライブラリ等が色々 載っていますが、preceding,preceding-sibling,following,following-sibling軸を扱えて高速なライブラリは今のところ これしかないようです。他のライブラリは軸のサポートが不完全なので、今回の仕事では使いませんでした。ただ、どちらかというと 学習用という位置づけです。
最近、NeoCore XML Management systemというのを雑誌で見かけたので、
ちょと試してみたのですが、Linux版はFedora Coreでないとinstallerすら動かないようです。仕方ないので、windows版を
試してみましたが、ちょっと軸のサポートが不親切なようです。
普通の使用では、XMLserverといってもRDBSと同じようなflatな検索しかかけないので、今回のような幾分特殊な用途に使う
libraryやserverを選定するのはかなり大変でした。ただ、検索言語としてXQueryを選んだのがが正解だったかどうかには
疑問が残ります。
A Tale of Two Cities LITE(tm)
-- by Charles Dickens
A man in love with a girl who loves another man who looks just
like him has his head chopped off in France because of a mean
lady who knits.
Crime and Punishment LITE(tm)
-- by Fyodor Dostoevski
A man sends a nasty letter to a pawnbroker, but later
feels guilty and apologizes.
The Odyssey LITE(tm)
-- by Homer
After working late, a valiant warrior gets lost on his way home.
<Mel|work> Yaakov: icke==troll?
<rindolf> Mel|work: no, he's not a troll.
<Yaakov> Mel|work: No, icke is just... enthusiastic about "channel
purity"
<Mel|work> k....
* rindolf hates when people abuse the == operator in English
for "contained in"
<apeiron> rindolf, "icke contained in troll"? That's not what Mel|work
meant.
<tarbo> sure he did, if you make troll a set of users
<rindolf> apeiron: what he meant by icke == troll is that icke belongs
to the set of trolls.
<rindolf> apeiron: not that every troll in the world is icke.
<apeiron> rindolf, No, he was asking if icke is a troll.
<icke> $icke->isa('Troll');
<icke> (false)
<rindolf> apeiron: is-a means "contained in the set of objects with the
property of"
<rindolf> apeiron: mathematically speaking.
<apeiron> rindolf, Okay, so you're assigning the mathematical meaning
of == to its usage in a *perl* channel?
<apeiron> rindolf, Now who's fiddling with meanings, eh?
<rindolf> apeiron: whatever.
<apeiron> 'whatever' is what those who have lost their argument say.
<rindolf> apeiron: whatever.
<apeiron> ^ QED
<rindolf> apeiron: whatever.
<PerlJam> apeiron: I thought that's what people who don't care say.
<apeiron> PerlJam, If one doesn't care, they wouldn't respond.
<PerlJam> apeiron: whatever
<PerlJam> ;-)
<rindolf> LOL.
-- Whatever
-- #perl, Freenode