<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/sem.triple.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>sem.triple</api:function-name><api:suggest>sem.triple</api:suggest><api:suggest>sem</api:suggest><api:suggest>triple</api:suggest><api:function-link mode="xquery" fullname="sem:triple">/apidoc/8.0/sem:triple.xml</api:function-link><api:function mode="javascript" name="triple" type="builtin" lib="sem" category="Semantics" hidden="false" bucket="MarkLogic Built-In Functions" prefix="sem" namespace="http://marklogic.com/semantics" fullname="sem.triple"><api:summary>
  Creates a triple object, which represents an RDF triple
  containing atomic values representing the subject, predicate, object, and
  optionally graph identifier (graph IRI).
  <p xmlns="http://www.w3.org/1999/xhtml">This function is a built-in.</p>
</api:summary><api:params><api:param name="subject_or_node" type="item()"><api:param-description>
    The triple's subject as an atomic value, or the whole triple as a
    <span class="javascript" xmlns="http://www.w3.org/1999/xhtml">JavaScript object</span>.
    If specifying a node as a triple, this function must be used
    as a single-parameter version (that is, you cannot specify a triple
    in this parameter and also use the other parameters).
  </api:param-description><api:param-name>subject_or_node</api:param-name><api:param-type>String</api:param-type></api:param><api:param name="predicate" type="xs:anyAtomicType" optional="true"><api:param-description>
    The triple's predicate.
  </api:param-description><api:param-name>predicate</api:param-name><api:param-type>xs.anyAtomicType</api:param-type></api:param><api:param name="object" type="xs:anyAtomicType" optional="true"><api:param-description>
    The triple's object.
  </api:param-description><api:param-name>object</api:param-name><api:param-type>xs.anyAtomicType</api:param-type></api:param><api:param name="graph" type="sem:iri?" optional="true"><api:param-description>
    The triple's graph IRI.  This parameter is only available if you have
    specified a subject, predicate, and object, and is not available if you
    have specified an element as a triple in the first parameter.
  </api:param-description><api:param-name>graph</api:param-name><api:param-type>sem.iri?</api:param-type></api:param></api:params><api:return>sem.triple</api:return><api:usage class="javascript">
   It is possible to create triples with <code xmlns="http://www.w3.org/1999/xhtml">sem.triple</code> that might not
   be valid RDF triples.  For example, you can create a triple with a number as
   a predicate, even though that is not allowed in RDF.  This is because the
   triples you can create with <code xmlns="http://www.w3.org/1999/xhtml">sem:triple</code> are more general that
   what is allowed in RDF.
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">

sem.triple(sem.iri("subject"), sem.iri("predicate"), "object")

(: Returns the specified triple. :)
</pre></api:example><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">

sem.triple(
  {
    "triple" : {
      "subject" : "subject",
      "predicate" : "predicate",
      "object" : {
        "value" : "object",
        "datatype" : "http://www.w3.org/2001/XMLSchema#string"
      }
    }
  }
)

(: Returns the specified triple. :)
</pre></api:example></api:function></api:function-page>