jena-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Reynolds <dave.e.reyno...@gmail.com>
Subject Re: I think I've got some pretty basic confusion with reading into models
Date Fri, 10 Dec 2010 09:09:14 GMT
On Thu, 2010-12-09 at 18:34 -0500, Benson Margulies wrote: 
> Yes. Now I'm 'merely' a bit fuddled about baseURI.
> 
> I want the about of the Ontology element to be "". 

That's just a relative URI, relative to the base of the document.

> 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? 

Yes. URIs internally in Jena are all absolute. You can read/write them
as relative to some base.

> Is
> it important for it to be unique?

Generally, yes.

By creating an Ontology element you are declaring a URI for the whole
ontology which, by convention but not necessity, is the URL for the
document in which the ontology[*] is published.

As I mentioned, this whole Ontology element/imports stuff in OWL is a
pretty document centric view.

There is no fundamental reason you can't have different graphs with
different content but the same Ontology URI in each. But you are
implicitly saying that they each represent a document with the same URI
which is probably not what you mean.

Cheers,
Dave

[*] Note that in this OWL view of the world (as opposed to most of RDF)
your instance data is an ontology that includes both your individuals
(so called "abox") and the bits of the ontology you wrote with Protege
and imported (so called "tbox").


> 
> On Thu, Dec 9, 2010 at 6:20 PM, Dave Reynolds <dave.e.reynolds@gmail.com> 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
> >
> >




Mime
View raw message