In marklogic, triples can be embedded into an existing document. How can i use cts search query to return the document. An example of a document could be
<ContentVersion>
<Name>Testing</Name>
<Status>Approved</Status>
<sem:triples xmlns:sem="http://marklogic.com/semantics">
<sem:triple>
<sem:subject>http://mycontent/content/Testing</sem:subject>
<sem:predicate>is</sem:predicate>
<sem:object>Approved</sem:object>
</sem:triple>
</sem:triples>
</ContentVersion>
if try the below query
let $query := cts:word-query('Testing',"case-insensitive")
let $sparql := "PREFIX cts: <http://marklogic.com/cts#>
DESCRIBE ?s
WHERE{
?s ?p ?o .
FILTER cts:contains(?o, cts:word-query('Testing'))
}"
let $results := sem:sparql($sparql,(),("default-graph=magician"),($query))
return(sem:rdf-serialize($results,'rdfxml'))
I get an empty result. Any ideas on why nothing is returned? I am using MarkLogic 7