Skip to content

Commit b277e3a

Browse files
authored
Merge pull request #158 from elf-pavlik/from
DataFactory methods to create from existing term and quad | closes #137
2 parents 57e79c7 + 5be9dfc commit b277e3a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,8 @@ <h3><dfn>DataFactory</dfn> interface</h3>
376376
Variable variable(string value);
377377
DefaultGraph defaultGraph();
378378
Quad quad(Term subject, Term predicate, Term object, optional Term? graph);
379+
Term fromTerm(Term original);
380+
Quad fromQuad(Quad original);
379381
};
380382
</pre>
381383

@@ -408,6 +410,15 @@ <h3><dfn>DataFactory</dfn> interface</h3>
408410
If <code>graph</code> is <code>undefined</code> or <code>null</code>
409411
it MUST set <code>graph</code> to a <code>DefaultGraph</code>.
410412
</p>
413+
<p>
414+
<dfn>fromTerm()</dfn> returns a new instance of the specific <code>Term</code> subclass given by <code>original.termType</code>
415+
(e.g., <code>NamedNode</code>, <code>BlankNode</code>, <code>Literal</code>, etc.),
416+
such that <code>newObject.equals(original)</code> returns <code>true</code>.
417+
</p>
418+
<p>
419+
<dfn>fromQuad()</dfn> returns a new instance of <code>Quad</code>,
420+
such that <code>newObject.equals(original)</code> returns <code>true</code>.
421+
</p>
411422
</section>
412423
</section>
413424
</body>

0 commit comments

Comments
 (0)