Collection has a slightly different meaning in Qizx than in the XML Query language specifications:
in Qizx, a Collection is a kind of folder than can contain Documents and other sub-collections. This is very similar to a directory on a disk. Being a Library Member, a Collection can bear Metadata Properties.
in XML Query. a collection is any sequence of Nodes.
Needless to say, the two notions are related: when using the path of a Qizx Collection in the predefined function fn:collection()
, it yields the sequence of document-nodes of all documents contained at any level within the collection. The order of document nodes is stable and corresponds to the order of creation or replacement.
A Document is the primary unit of storage in a Qizx Library. It holds both a XML Data Model and a set of Metadata Properties. It always belongs to a Collection.
Library is a database of XML documents in Qizx speak.
A Library Group is basically a descriptor file (XML syntax) which describes the names and locations of one or several XML Libraries. It is handled by a Library Manager.
A Library Manager is an object that handles a group of XML Libraries. It manages shared resources, like caches. It is generally initialized by opening a Library Group.
Generic term standing for both Documents and Collections contained within a Library. Library members can hold Metadata Properties, system- or user-defined. Library members can be searched efficiently using any of their Properties.
A Metadata Property is a pair (name, value) that can be attached to a Document or a Collection inside a XML Library. Values can be simple items (string, integer, double, boolean, Java Date, Java Object) or XML nodes. Some properties are created automatically by the database engine, but applications can add any number of properties.
Since Properties can be queried efficiently using XQuery, they constitute a powerful mechanism to:
Annotate documents with metadata, without altering the document contents
Create custom indexes: by associating a computed property with documents (or collections), it is possible to perform queries which would be otherwise very inefficient.
Path Expressions are XQuery/XPath expressions that use the '/' separator and return a sequence of nodes. In an XML database like Qizx, they are the primary queries.
Examples:
collection("...")/test/agent[ name = "John" ] doc("/hamlet.xml")//SPEECH[ft:phrase("to be or not to be")] $t/name
Absolute Path Expressions start from a root and produce nodes through one or several steps. Returned nodes appear only once and are in document order. Typical roots are collection()
, doc()
or a variable containing a node.
Relative Path Expressions have no explicit root like collection()
or doc()
or variable name. They starts from the implicit context node, often noted by '.' (single dot). The context node, as the name says, is defined by the context, either the system initial conditions, or inside a predicate, as the node to which the predicate applies, like in //item[./name = 'John']
where '.' points out the current 'item' element.
A special case is a single step like "CHAPTER
" or "node()
", where the slash operator does not appear but which is equivalent to ./CHAPTER
or ./node()
respectively.
The XML Data Model is used by the XPath2, XML Query and XSLT2 languages, and defined by a W3C Recommendation. It describes the abstract structure of XML documents, independently of syntactic aspects.