Loading TOC...

sem.graph

sem.graph(
   $graphname as sem.iri
) as Sequence

Summary

This function returns all triples from a named graph in the database.

Parameters
$graphname The name of the graph to retrieve.

Example

var sem = require("/MarkLogic/semantics.xqy");
 
sem.graph(sem.iri("http://marklogic.com/semantics#default-graph"));
 
=> 
returns all triples from the default graph 

Example

var sem = require("/MarkLogic/semantics.xqy");
sem.graph(sem.iri("bookgraph"));

=> 
returns all triples from a named graph as triples 

    sem:triple(sem:iri("urn:isbn:006251587X"), 
	sem:iri("http://purl.org/dc/elements/1.1/title"),
	"Weaving the Web", sem:iri("bookgraph"))
 
    sem:triple(sem:iri("urn:isbn:9780080540160"),
    sem:iri("http://purl.org/dc/elements/1.1/title"),
	"Query XML,
XQuery, XPath, and SQL/XML in context", 
	sem:iri("bookgraph"))

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy