On 26/03/12 22:24, Crapo, Andrew (GE Global Research) wrote:
I'm new to TDB but have managed to create a Dataset, to which I can add and
remove OWL files. I load two OWL files one of which imports the other and
which form the "t-box" of my test case. When I retrieve these from the TDB
store, I can generate OntModels for them so all is well.
Now I wish to load a third OWL file, which is my "a-box" and which imports
the t-box models, one directly and the other indirectly, that I previously
loaded into TDB. I don't want to place this model in TDB but only have an
in-memory OntModel for manipulation. I can't figure out how to have Jena
actually import the t-box so that the properties in the model will be
recognized as OntProperties. I can load the file as an OntModel but when I
retrieve a Property p from a Statement and do a p.canAs(OntProperty.class)
it returns false, even though p is an OntProperty defined in the t-box.
Summarizing, I'd like to store my t-box in TDB but only load my a-box (which
imports the t-box) into memory, not persist it in TDB. How would I do that?
I think you could do this by implementing a ModelMaker that retrieves
named models from your TDB. Then clone an OntModelSpec,
setImportModelMaker to that maker, use the spec to create your OntModel.
Dave