I have a content repository where the latest versions of documents use an IsLatestVersion triple.
This is an example of a document with the isLatestVersion triple.
Document URI: /Transaction/00000000000101000000/1.xml
<aptp:Transaction xmlns:aptp="http://sample.com/aptp">
<aptp:TransactionDate>2016-07-28</aptp:TransactionDate>
<aptp:TransactionType>Principal</aptp:TransactionType>
<aptp:Operation>Buy</aptp:Operation>
<sem:triple name="isLatestVersion"
xmlns:aptp="http://sample.com/aptp"
xmlns:sem="http://marklogic.com/semantics">
<sem:subject datatype="http://www.w3.org/2001/XMLSchema#string">
/Transaction/00000000000101000000/1.xml
</sem:subject>
<sem:predicate>isLatestVersion</sem:predicate>
<sem:object datatype="http://www.w3.org/2001/XMLSchema#boolean">true</sem:object>
</sem:triple>
</aptp:Transaction>
I'd like the following code snippet to return the sequence of latest version uris. It currently returns an empty set.
import module namespace sem = "http://marklogic.com/semantics" at "/MarkLogic/semantics.xqy";
let $uris :=
(
"/Transaction/00000000000101000000/1.xml",
"/Transaction/00000000000101000001/1.xml",
"/Transaction/111111/1.xml"
)
let $query := cts:triple-range-query($uris, "isLatestVersion", fn:true())
return
cts:uris("", (), $query)
Am I missing something obvious?
A few thoughts:
cts:triple-range-query
. You can pass in empty sequence instead."isLatestVersion"
in sem:iri
, e.g. sem:iri("isLatestVersion")
.HTH!