MarkLogic Server 11.0 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
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy