Version 6 (modified by 16 years ago) ( diff ) | ,
---|
XPATH
author: Heikki Doeleman
This page describes the current ideas about implementing support for XPATH in the ebRIM project.
Introduction
XPATH is a language to precisely select a set of nodes in an XML document. It is also sometimes used to address certain parts of Java object graphs. One of the requirements for the ebRIM project is to support XPATH queries in OGC Filters.
Issues
It would be straightforward to evaluate XPATH against complete ebRIM documents (domain object graphs). However, we do not have all ebRIM data in memory, therefore we cannot simply evaluate XPATH queries against complete ebRIM documents. This suggests that the best option is to evaluate XPATH queries against the Lucene index. How should we go about doing that ?
A search on Google does not return too many insightful results. One implementation of XPATH against Lucene can be found in the CMS Alfresco, albeit with severe limitations: "does not currently support the attribute axis or predictes".
A hint as to their implementation is the description of Alfresco's Lucene index. It appears as if they use a dedicated field in the index to operate on with XPATH :
# PATH * An XPATH expression used to select nodes * This should only be access via a phrase query (ie in "") as it requires special tokenisation
I'm currently looking into their sources to learn more about their implementation, specificaly org.alfresco.util.SearchLanguageConversion.