joemfb / cts-extensions

experimental extensions to MarkLogic cts functionality

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cts-extensions

xquery library module: http://marklogic.com/cts-extensions

experimental extensions to MarkLogic cts functionality. Includes new query and lexicon types, and conversion functions for lexicon references.

Warning: this is experimental software! This module uses un-supported features of MarkLogic Server, which are subject to modification or removal without notice.

Author: Joe Bryan

Version: 1.1.0

Table of Contents

Variables

$ctx:numeric-scalar-types as xs:string+

numeric lexicon scalar types

Functions

ctx:root-element-query($qname as xs:QName) as cts:query

returns a cts:query matching fragments with a given root QName

params
  • $qname as xs:QName
returns cts:query
ctx:root-element-query($qname as xs:QName, $query as cts:query?) as cts:query

returns a cts:query matching fragments with a given root QName, constrained by the query param

params
  • $qname as xs:QName
  • $query as cts:query?
returns cts:query
ctx:element-child-query($qname as xs:QName, $child as xs:QName) as cts:query

returns a cts:query matching fragments with the given parent/child QNames

params
  • $qname as xs:QName
  • $child as xs:QName
returns cts:query
ctx:element-child-query($qname as xs:QName,  $child as xs:QName,  $query as cts:query?) as cts:query

returns a cts:query matching fragments with the given parent/child QNames, constrained by the query param

params
  • $qname as xs:QName
  • $child as xs:QName
  • $query as cts:query?
returns cts:query
ctx:element-attribute-query($qname as xs:QName, $attr as xs:QName) as cts:query

returns a cts:query matching fragments with the given element/attribute QNames

params
  • $qname as xs:QName
  • $attr as xs:QName
returns cts:query
ctx:element-attribute-query($qname as xs:QName,  $attr as xs:QName,  $query as cts:query?) as cts:query

returns a cts:query matching fragments with the given element/attribute QNames, constrained by the query param

params
  • $qname as xs:QName
  • $attr as xs:QName
  • $query as cts:query?
returns cts:query
ctx:path-query($path-expression as xs:string) as cts:query

returns a cts:query matching fragments containing $path-expression

params
  • $path-expression as xs:string
returns cts:query
ctx:path-query($path-expression as xs:string, $namespaces as xs:string*) as cts:query

returns a cts:query matching fragments containing $path-expression

params
  • $path-expression as xs:string
  • $namespaces as xs:string*
returns cts:query
ctx:path-query($path-expression as xs:string,  $scalar-type as xs:string,  $collation as xs:string?) as cts:query

returns a cts:query matching fragments with values of $type in $path-expression (requires a matching path-range-index)

params
  • $path-expression as xs:string
  • $scalar-type as xs:string
  • $collation as xs:string?
returns cts:query
ctx:field-query($field-name as xs:string,  $scalar-type as xs:string,  $collation as xs:string?) as cts:query

returns a cts:query matching fragments with values of $type in $field-name (requires a matching path-range-index)

params
  • $field-name as xs:string
  • $scalar-type as xs:string
  • $collation as xs:string?
returns cts:query
ctx:root-QNames() as xs:QName*

a "pseudo-lexicon" of root-element QNames; returns a sequence of all document-root element QNames

returns xs:QName*
ctx:root-QNames($arg) as xs:QName*

a "pseudo-lexicon" of root-element QNames; returns a sequence of document-root element QNames where document matches $arg. (if $arg is a QName, matches documents containing an element of that name)

params
  • $arg as cts:query or xs:QName
returns xs:QName*
ctx:root-QNames($query as cts:query?, $excluded-roots as xs:QName*) as xs:QName*

a "pseudo-lexicon" of root-QNames; returns a sequence of document-root element QNames constrained by $query, excluding $excluded-roots

params
  • $query as cts:query?
  • $excluded-roots as xs:QName*
returns xs:QName*
ctx:db-path-namespaces() as xs:string*

returns the database-path-namespaces as a sequence of alternating namespace prefixes and URIs

returns xs:string*
ctx:db-path-namespaces($database-id as xs:unsignedLong) as xs:string*
params
  • $database-id as xs:unsignedLong
returns xs:string*
ctx:reference-to-map($reference as cts:reference) as map:map

constructs a map from a cts:reference object

params
  • $reference as cts:reference
returns map:map
ctx:reference-from-map($map as map:map) as cts:reference?

constructs a cts:reference object from a map

params
  • $map as map:map
returns cts:reference?
ctx:reference-alias($reference as cts:reference) as xs:string

returns a string alias describing a `cts:reference object

params
  • $reference as cts:reference
returns xs:string
ctx:resolve-reference-from-index($node) as cts:reference*

constructs 1-or-more cts:reference objects from the given index definition

params
  • $node as element(db:*-index) (as returned by the admin API)
returns cts:reference*
ctx:reference-query($reference as cts:reference) as cts:query

constructs a cts:query matching fragments that contain a cts:reference

params
  • $reference as cts:reference
returns cts:query
ctx:reference-query($reference as cts:reference, $values as xs:anyAtomicType*) as cts:query

constructs an = range query from a cts:reference and 1-or-more values

params
  • $reference as cts:reference
  • $values as xs:anyAtomicType*
returns cts:query
ctx:reference-query($reference as cts:reference,  $operator as xs:string,  $values as xs:anyAtomicType*) as cts:query

constructs a range query from a cts:reference and 1-or-more values

params
  • $reference as cts:reference
  • $operator as xs:string
  • $values as xs:anyAtomicType*
returns cts:query

Generated by xquerydoc

License Information

  • Copyright (c) 2014 Joseph Bryan. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

[http://www.apache.org/licenses/LICENSE-2.0] (http://www.apache.org/licenses/LICENSE-2.0)

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

The use of the Apache License does not indicate that this project is affiliated with the Apache Software Foundation.

About

experimental extensions to MarkLogic cts functionality

License:Other


Languages

Language:XQuery 100.0%