On 02/03/12 04:06, Craig Trim wrote:
How do I get the name of model?
I have a dataset with several named models.
I create a named model using this call:
Model model =<Dataset>.getNamedModel(<uri>)
;
When I retrieve a Resource from the model, I call
Model model =<Resource>.getModel();
and retrieve the model associated with the resource.
Is there a method that would return the URI (name) of a model? Something
like this?
<Model>.getName() : String
I didn't see anything like that. I also tried digging into the Graph
layer, but didn't see anything there either.
Context:
I may not always be certain which model a resource is coming from, and as
the named models are used for tracking provenance, this would be helpful.
Using TDB 0.8.10 and Jena 2.6.4.
Thanks in advance,
Craig
Craig,
There isn't such as facility (and, unusually, a model can be in a
dataset under several different names). You may need to create your own
"NamedModel" that is a model, dataset and name (you need all three items).
Resources know their model, so r.getProperty works.
Andy