| 59 | === Other considerations === |
| 60 | |
| 61 | The above design decision is about how to relate an XPATH !LocationPath to a valid result set from the Lucene index. XPATH is a much larger language and supports many constructs that combine !LocationPaths (such as disjuncts), supports a set of built-in functions (for example arithmetic, like ''round()''), a set of operators (for example aritmetic, like ''mod''), and a set of ''axes'' which refer to other parts of the document in relation to the current node (such as ''following-sibling''). |
| 62 | |
| 63 | I have already created code for an XPATH interpreter that recursively processes an XPATH expression to the desired level, so it seems it won't be too difficult to support these 'advanced' features. The interpreter uses the [http://commons.apache.org/jxpath/ JXPath] library. An example is: |
| 64 | |
| 65 | input XPATH : |
| 66 | //rim:ExtrinsicObject[@objectType='urn:x-ogc:specification:csw-ebrim-cim:ObjectType:MetadataInformation']/rim:Slot[@name='http://purl.org/dc/elements/1.1/language' and @ slotType='urn:ogc:def:dataType:RFC-4646:Language'] |
| 67 | |
| 68 | output interpreter : |
| 69 | |
| 70 | 'locationpath': //rim:ExtrinsicObject[@objectType = 'urn:x-ogc:specification:csw-ebrim-cim:ObjectType:MetadataInformation']/rim:Slot[@name = 'http://purl.org/dc/elements/1.1/language' and @slotType = 'urn:ogc:def:dataType:RFC-4646:Language'] |
| 71 | step: xpath axis: descendant-or-self |
| 72 | step: rim:ExtrinsicObject[@objectType = 'urn:x-ogc:specification:csw-ebrim-cim:ObjectType:MetadataInformation'] xpath axis: child |
| 73 | operation 'compare': @objectType = 'urn:x-ogc:specification:csw-ebrim-cim:ObjectType:MetadataInformation' symbol: = |
| 74 | 'locationpath': @objectType |
| 75 | step: @objectType xpath axis: attribute |
| 76 | 'constant': 'urn:x-ogc:specification:csw-ebrim-cim:ObjectType:MetadataInformation' |
| 77 | step: rim:Slot[@name = 'http://purl.org/dc/elements/1.1/language' and @slotType = 'urn:ogc:def:dataType:RFC-4646:Language'] xpath axis: child |
| 78 | operation 'and': @name = 'http://purl.org/dc/elements/1.1/language' and @slotType = 'urn:ogc:def:dataType:RFC-4646:Language' |