It's a bit ambiguous in the design, but it could be
useful to be able to load a simple corpus into a
NOM (NXT's data model with multi-rooted trees)
as well as a JDOM. That way users who knew the
NXT query language wouldn't have to go back to
Xpath to work with the data, and applications could
generalize for either simple or complex corpora.
(The reason this is ambiguous is that the interface
ObjectModelElement, which is intended to be used to
manipulate either JDOM or NOM data, is perhaps
another way of getting the same effect, but let's
assume for now that we do intend simple corpora
to load directly into the NOM). Nothing says that
we shouldn't use the NOM manipulators to modify
the data and resave it, but the attached zip archive
shows that at least in some cases (inserting a new
element between two existing ones in a hierarchical
relationship so that it is child of the first and parent
of the second) the serializer gets messed up and
saves an xlink syntax nite:child link to the new
element, failing to save the new element anywhere
and placing the link in the wrong place in the data
file.
To see this using the zip archive, unzip over the
NXT installation, compile SimpleSaveBug.java,
run it, and inspect New/Newcorpus/simplesavebug.xml.
It's meant to be like simplesavebug.xml but with
a new <LOCATION> element between the first
paragraph and the first word. A println exhibits
another bug (see "getElementByID returns null").
zip archive exhibiting serialization bug for simple corpus modified using NOM
Logged In: YES
user_id=858324
Our thinking has changed on this.
A better approach is to remove the facility
for simple corpora completely and assume everything is
stand-off --- and if anyone has a single XML file they have
to load, they can declare it as a corpus resource or
interaction coding in a stand-off corpus that has nothing
else in it. No one currently uses simple corpora (and
our inclusion of simple corpora was just motivated by
needing early results way back when, with working
GUIs before the NOM was ready).