Loading TOC...

MarkLogic 12 EA 2 Product Documentation
sem.transitiveClosure

sem.transitiveClosure(
   seeds as sem.iri[],
   predicates as sem.iri[],
   limit as Number
) as Sequence

Summary

From a starting set of seeds, follow a given set of predicates, to a given depth, and return all unique node IRIs.

Parameters
seeds A set of seed IRIs.
predicates A set of predicates to follow.
limit A limit of how many predicates to follow.

Example


const sem = require("/MarkLogic/semantics.xqy");
sem.transitiveClosure(
    sem.iri("http://www.w3.org/People/Berners-Lee/card#i"),
    sem.iri("http://xmlns.com/foaf/0.1/knows"),
    9);
=>
http://www.w3.org/People/Berners-Lee/card#i
    

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.