On 09/12/2010 22:44, Benson Margulies wrote:
"Add the appropriate import"

is that 'addLoadedImport' or something else I'm missing?

Probably not.

There are a couple of different notions here and the answer depends on exactly how you want this to work :)

First, thinking of your graph as an OWL document then there is the notion of adding an import statement into the document. This means adding statements to the graph (that "clutter" is one of the reasons I tend to avoid explicit imports in internal processing chains). You can do that using OntModel#createOntology to create a resource of type owl:Ontology corresponding to this graph and then use Ontology#addImport to add the import statement to that ontology resource.

Second, there's the processing that means an OntModel "sees" all the statements in the ontology. If you just load in a model with an import statement (such as created by the above) then the OntModel will by default so look for that Ontology, read it in, and add it as a subModel to the OntModel.

Now you can programmatically add a subModel anyway without having an import statement by just calling OntModel#addSubModel. This can be useful when you are doing some processing on a graph and want to see it along with its ontology closure but don't want to mess with the base graph itself by adding import statements.

Sometimes you do this addSubModel yourself but later on want to do some import processing anyway. OntModel#addLoadedImport is there for that case I believe, it records that an import has been done somehow. Is that right Ian?

Does that all make sense?

Dave

Reply via email to