jena-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benson Margulies <>
Subject Re: I think I've got some pretty basic confusion with reading into models
Date Thu, 09 Dec 2010 23:34:48 GMT
Yes. Now I'm 'merely' a bit fuddled about baseURI.

I want the about of the Ontology element to be "". To get this, the
reading suggests that I need to pass the URI that is the xml:base URI
of the entire document. I don't see any way to set a base URI of the
live model, but I do see a way to specify one at the time I write out
a model. Is that the plan? Pick a URI, pass it in to the
createOntology call, and then later pass it to the writer as base? Is
it important for it to be unique?

On Thu, Dec 9, 2010 at 6:20 PM, Dave Reynolds <> wrote:
> 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

View raw message