1
votes

I am using MarkLogic 8

I am trying to pass cts built in functions inside SPARQL

I tries with cts:contains and it worked perfectly.

But when I tried with cts:collection-query() I got an error XDMP-EFFBOOLVALUE (err:FORG0006)

SPARQL query:

PREFIX cts: <http://marklogic.com/cts#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX xs: <http://www.w3.org/2001/XMLSchema>

SELECT ?s ?o
WHERE{ 
  ?s skos:prefLabel ?o .
  FILTER cts:contains(?o, cts:word-query('agor*'))
         FILTER cts:collection-query('thesaurus-work')


} LIMIT 100

complete error:

[1.0-ml] XDMP-EFFBOOLVALUE: (err:FORG0006) ?s http://www.w3.org/2004/02/skos/core#prefLabel ?o . FILTER (cts:contains($o, cts:word-query("agor*"))) FILTER (cts:collection-query("thesaurus-work")) -- Effective Boolean Value is undefined for cts:collection-query("thesaurus-work")

I am not able to understand why I am getting this error. please help!

1

1 Answers

3
votes

cts:collection-query() is an expression function that returns a boolean.

cts:collection-query() is a constructor function that returns a query instead of a boolean value for use in the FILTER.

To constrain a SPARQL query to the triples projected from documents matched by a cts:query you can construct a sem:store object with the cts:query and pass the sem:store object on the sem:sparql() call:

http://docs.marklogic.com/sem:store

http://docs.marklogic.com/sem:sparql

Hoping that helps,