2

I'm writing a REST API extension where I need to know the mapping of lexicon values to documents.

Given a lexicon (and backing range index), how can I get a map of of document URIs to lexicon (index) values?

1 Answer 1

1

In XQuery, for values of an element, use

cts:value-tuples(cts-uri-reference(), cts:element-reference("foo"))

For values of a field, use:

cts:value-tuples(cts-uri-reference(), cts:field-reference("foo"))

See also

cts:collection-reference, 
cts:element-attribute-reference, 
cts:path-reference, 
cts:geospatial-attribute-pair-reference
cts:geospatial-element-child-reference
cts:geospatial-element-pair-reference
cts:geospatial-element-reference
cts:geospatial-path-reference

You can get a map on co (or n-way) occurence tuples as well, by providing more arguments to cts:value-tuples().

2
  • 1
    If you want the results in map:map format, don't forget the 'map' option.
    – mblakele
    Jan 21, 2014 at 0:23
  • 1
    @eric-bloch: can one also use value-tuples to do the inverse? Find all uris/docs that doesn't have element foo?
    – grtjn
    Jan 21, 2014 at 6:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.