<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/sem.graph.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>sem.graph</api:function-name><api:suggest>sem.graph</api:suggest><api:suggest>sem</api:suggest><api:suggest>graph</api:suggest><api:function-link mode="xquery" fullname="sem:graph">/apidoc/8.0/sem:graph.xml</api:function-link><api:function mode="javascript" name="graph" lib="sem" category="Semantics" hidden="false" bucket="MarkLogic Built-In Functions" prefix="sem" namespace="http://marklogic.com/semantics" fullname="sem.graph"><api:summary>
		  This function returns all triples from a named graph 
		  in the database.
	  </api:summary><api:params><api:param name="graphname" type="sem:iri"><api:param-description>
		  The name of the graph to retrieve.
	  </api:param-description><api:param-name>graphname</api:param-name><api:param-type>sem.iri</api:param-type></api:param></api:params><api:return>ValueIterator</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var sem = require("/MarkLogic/semantics.xqy");
 
sem.graph(sem.iri("http://marklogic.com/semantics#default-graph"));
 
=&gt; 
returns all triples from the default graph 
</pre></api:example><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
var sem = require("/MarkLogic/semantics.xqy");
sem.graph(sem.iri("bookgraph"));

=&gt; 
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,&amp;#10;XQuery, XPath, and SQL/XML in context", 
	sem:iri("bookgraph"))
</pre></api:example></api:function></api:function-page>