On 20/11/15 13:18, Gregor Trefs wrote:
Hello Jena Developers,
first: Thank you for this extensive work. I am currently developing a
little application where I use Jena TDB as my triple store. My intention is
to translate an entities into a named graphs. While driving my development
with unit tests I wondered what the difference between
DataSetImpl.addNamedModel and DataSetImpl.replaceNamedModel is? From the
code perspecitive the replace method does some additional work which seems
not to be necessary. In fact, invoking replace or add for a specific URI
seems to have the same effect: Any named graph which was previously stored
under this URI is replaced. Is this a bug or a feature?
Best regards,
Gregor
Hi Gregor,
It looks like there is, nowadays, no difference. It used to be that for
some datasets addNamedModel would only add a model under a new name, a
name not in use, whereas replaceNamedModel would work when that name was
already in-use. A SPARQL Update "CREATE" would be required.
But nowadays, the storage layers in the Jena system don't need an
explicit create step and so the two operations are the same.
RDF has a bit of problem differentiating an empty named graph in a
dataset from no named graph. The general community consensus is even if
desirable (and some people don't think its desirable), the need for
separating managing names from triples/quads is not worth the complexity
it adds.
Jena should at least remove the "throws" clause from addNamedModel as it
is misleading.
Andy
Logged as JENA-1073