sem:graph( $graphname as sem:iri ) as sem:triple*
This function returns all triples from a named graph in the database.
Parameters | |
---|---|
graphname | The name of the graph to retrieve. |
xquery version "1.0-ml"; import module namespace sem = "http://marklogic.com/semantics" at "/MarkLogic/semantics.xqy"; sem:graph(sem:iri("http://marklogic.com/semantics#default-graph")) => (: returns all triples from the default graph :)
xquery version "1.0-ml"; import module namespace sem = "http://marklogic.com/semantics" at "/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"))