sem.triple( subject_or_node as Item, [predicate as xs.anyAtomicType], [object as xs.anyAtomicType], [graph as sem.iri?] ) as sem.triple
Creates a triple object, which represents an RDF triple containing atomic values representing the subject, predicate, object, and optionally graph identifier (graph IRI).
This function is a built-in.
sem.triple
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 sem:triple
are more general than
what is allowed in RDF.
sem.triple(sem.iri("subject"), sem.iri("predicate"), "object") (: Returns the specified triple. :)
sem.triple( { "triple" : { "subject" : "subject", "predicate" : "predicate", "object" : { "value" : "object", "datatype" : "http://www.w3.org/2001/XMLSchema#string" } } } ) (: Returns the specified triple. :)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.