Builds a resource graph anchored at a chosen subject.
Passes subject to builder, boxing a bare IRI through named first, and returns the Graph it
produces, checked to hang off that subject. The subject is the caller's to choose: a named resource
for an identified one, or a blank node for an anonymous embedded one. An empty built graph is a
no-op, returned as it is: a resource whose properties are all absent contributes no statements and has nothing to
anchor.
Important
Every triple of a non-empty built graph must be reachable from subject, walking statements in either direction
through their resource positions: an inverse statement pointing back at the subject keeps its own subtree
anchored just as a direct one does. Literals carry no identity and are never walked through, so triples sharing
a literal value stay unconnected. The two ways a graph fails to hang off subject are reported apart rather than
returned half-anchored:
missing — no triple names subject, in either position, the typical mark of a builder ignoring the subject
threaded into it;
detached — some triples name subject, but others are stranded out of its reach (reported as disjoint).
RangeError if subject is a relative or otherwise malformed IRI, or if the built graph is non-empty and
either leaves subject unmentioned or strands triples away from it
Builds a resource graph anchored at a chosen subject.
Passes
subjecttobuilder, boxing a bare IRI through named first, and returns the Graph it produces, checked to hang off that subject. The subject is the caller's to choose: a named resource for an identified one, or a blank node for an anonymous embedded one. An empty built graph is a no-op, returned as it is: a resource whose properties are all absent contributes no statements and has nothing to anchor.Every triple of a non-empty built graph must be reachable from
subject, walking statements in either direction through their resource positions: an inverse statement pointing back at the subject keeps its own subtree anchored just as a direct one does. Literals carry no identity and are never walked through, so triples sharing a literal value stay unconnected. The two ways a graph fails to hang offsubjectare reported apart rather than returned half-anchored:subject, in either position, the typical mark of a builder ignoring the subject threaded into it;subject, but others are stranded out of its reach (reported as disjoint).