Return-Path: Delivered-To: apmail-incubator-jena-users-archive@minotaur.apache.org Received: (qmail 663 invoked from network); 10 Dec 2010 09:09:47 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Dec 2010 09:09:47 -0000 Received: (qmail 96168 invoked by uid 500); 10 Dec 2010 09:09:47 -0000 Delivered-To: apmail-incubator-jena-users-archive@incubator.apache.org Received: (qmail 96145 invoked by uid 500); 10 Dec 2010 09:09:46 -0000 Mailing-List: contact jena-users-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jena-users@incubator.apache.org Delivered-To: mailing list jena-users@incubator.apache.org Received: (qmail 96137 invoked by uid 99); 10 Dec 2010 09:09:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Dec 2010 09:09:46 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of dave.e.reynolds@gmail.com designates 74.125.82.41 as permitted sender) Received: from [74.125.82.41] (HELO mail-ww0-f41.google.com) (74.125.82.41) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Dec 2010 09:09:38 +0000 Received: by wwi18 with SMTP id 18so741556wwi.0 for ; Fri, 10 Dec 2010 01:09:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:in-reply-to :references:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; bh=LKr8brzF/B0ovcnozAB8B/Tzq9xmJd0In97FsCp9yUs=; b=YnXmQ/ch66V1NHgkGWc/kpOLCzvWPVKmlEj2oIoPJ0vQZyjNHcYVkR2KbW7CcfPdCR r8R/oVMwFC9DbhPxGMYJJqN0ElXaxohxFyAWK2KbKUW/yo7K5BsHXNYLnCyPKuSRdkif vOoxPKCqgSH7Q3XEt0U0EUzOOy1MtYwVFV+j8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:in-reply-to:references:content-type:date:message-id :mime-version:x-mailer:content-transfer-encoding; b=VpMbSfFabP0IdxcITVVTyP1OesrF3wuftLxRWgWeD3rJWqKwpfFOozl5zh8LICp78Q 2UMk3sDRvqMknbg3xmIajjpUkfqWF83EnTWoMHpB+hYOOM9LdkWek2k+JtK7Omjf9PTJ YnVWXj2ViduHr4B0rnSAVIzrN8ktfQRXjYcu4= Received: by 10.216.171.76 with SMTP id q54mr689729wel.93.1291972157488; Fri, 10 Dec 2010 01:09:17 -0800 (PST) Received: from [192.168.1.51] (82-69-1-248.dsl.in-addr.zen.co.uk [82.69.1.248]) by mx.google.com with ESMTPS id n78sm1094529weq.27.2010.12.10.01.09.15 (version=SSLv3 cipher=RC4-MD5); Fri, 10 Dec 2010 01:09:16 -0800 (PST) Subject: Re: I think I've got some pretty basic confusion with reading into models From: Dave Reynolds To: jena-users@incubator.apache.org In-Reply-To: References: <1291910679.2462.161.camel@dave-desktop> <1291916787.2462.220.camel@dave-desktop> <4D016454.7050208@gmail.com> Content-Type: text/plain; charset="UTF-8" Date: Fri, 10 Dec 2010 09:09:14 +0000 Message-ID: <1291972154.2646.29.camel@dave-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Content-Transfer-Encoding: 7bit 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 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 > > > >