XML Indexer

From Gcube Wiki
Revision as of 18:57, 27 August 2008 by Federico.defaveri (Talk | contribs)

Jump to: navigation, search

The XMLIndexer Service is a generic indexer of XML data homogeneous collections. The service allows creating, populating and resolving queries against such collections. Two types of XMLIndexer have been designed, each of them manages a collection of XML documents:

  • WSDaix – a WSDaix is completely unconscious of the collection and the data handled. This means that it does not impose any constraint about them and, therefore, it assumes that the clients know the schema of the documents to query. It can be used each time it is useful to index and query a (temporary) set of XML data, like a result set;
  • GCUBEDaix – a GCUBEDaix is bound to a specific Metadata Collection and it is used to index the elements of such a collection. When a new Metadata Collection to be indexed is created, the Metadata Manager Service creates also a new related GCUBEDaix and, each time a new Metadata Object is added/updated in such collection, the Metadata Manager Service also adds/updates the GCUBEDaix by feeding it with the new element.

Resources and Properties

The Service adopts a Factory pattern and creates a WS-Resource per each XML Indexer. Since there are two kinds of XML Indexer, there are also two kinds of WS-Resource that the Factory service can create: the GCUBEDaix resource and the WSDaix resource. The state of each Indexer is published in the DIS by means of its WS-ResourceProperties. These resource properties includes the creation parameters and, if the Indexer is a WSDaix, the SetTerminationTime and CurrentTime WS-ResourceProperties.

A GCUBEDaix operates on a collection of homogeneous XML documents bound to a specific Metadata Collection. Since the managed XML documents are wrapped in the Metadata envelope, each document is identified by a unique ID (the Metadata Object ID) and this allows a more advanced management of this type of Indexer with respect to the WSDaix one.

Functions

The main functions supported by the GCUBEDaix XMLIndexer are:

  • addElements() – which takes a list of XML documents and adds them to the current XML collection managed by this instance;
  • addElementsRS() – which implement the previous operation by reference, i.e. the message passed as input parameter contains the EPR of a result set containing the list of documents;
  • executeXPath() – which takes and executes a valid XPath expression against the current XML collection and returns all the XML Documents that match the given expression;
  • executeXPathRS() – which takes and executes a valid XPath expression against the current XML collection and returns a reference (the EPR of a Result Set containing them) to the list of XML Documents that match the given expression;
  • executeXQuery() – which takes and executes a valid XQuery against the current XML collection and returns the list XML Documents resulting from the evaluation of the given query on the managed collection;
  • executeXQueryRS() – which takes and executes a valid XQuery against the current XML collection and returns a reference to (its EPR) the list XML Documents resulting from the evaluation of the given query on the managed collection;

The main functions supported by the WSDaix are those specified in the WS-DAIX specification.