sem.databaseNodes( triples as sem.triple[], [options as String[]], [query as cts.query?] ) as Sequence
This function returns database nodes backing given triples. Any given cts:triple may be backed by zero, one, or multiple database nodes.
// Find the URIs of all documents containing a specified triple const sem = require('/MarkLogic/semantics'); const triple = sem.triple( sem.iri('http://dbpedia.org/resource/Judith_Massare'), sem.iri('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), sem.iri('http://xmlns.com/foaf/0.1/Person')); const results = []; for (const node of sem.databaseNodes(triple)) { results.push(xdmp.nodeUri(node)); } results // Returns, for example: // ['/my/unmanaged-triples.xml']
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.