You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by Claude Warren <cl...@xenei.com> on 2013/09/21 11:31:05 UTC

contract tests: modelCon:getBag, modelCon.getSeq() and modelCon.getAlt()

The javadoc for the modelCon methods getBag(), getSeq() and getAlt()
indicate that the returned resource should exist before the method is
called.

If the resource does not exist, the default implementation seems to create
one.  However the resulting resources are different from the createBag,
createSeq, and  createAlt methods in that the returned resource is not part
of a <resource, RDF.type, X> statement and resource.getModel() does not
return the original model.

I would have expected that the methods would return null if the objects did
not exist in the model.

However, since it doesn't should these methods be equivalent to the createX
versions and add the statement and return the model?  If it should not
return the model then I assume that it should return a new model of some
type (e.g. a model that does not have any statements in it)

However, this turns out I will update the documentation and the test cases.

Claude

-- 
I like: Like Like - The likeliest place on the web<http://like-like.xenei.com>
LinkedIn: http://www.linkedin.com/in/claudewarren