You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Cindy A McMullen <ci...@oracle.com> on 2013/06/03 18:41:24 UTC

Ontologies and model data

I've been working with Protege, where the 'individuals' are loaded into the same model as my ontologies.  In the real world, however, I wonder whether one loads the ontologies into a separate model from the actual graph data.  Any best practices here?



Re: Ontologies and model data

Posted by Andy Seaborne <an...@apache.org>.
On 04/06/13 13:44, David Jordan wrote:
> Andy, I am curious, I have not evaluated this. Are there any inherent
> performance consequences when working with a union of graphs? For
> example, is there a need to do multiple lookups as opposed to one
> when searching for resources?


Union Default Graph is quite cheap nowadays - single access per triple 
pattern, and it needs to ensure set of triples (not a bag of triples) 
semantics but it now has detailed knowledge of TDB storage to know 
duplicates are (due to the index structure) adjacent in the streams of 
matches of a triple pattern.  That duplicate suppression is cheap. It is 
not a loop over the graphs.

You can go further:
http://jena.apache.org/documentation/tdb/dynamic_datasets.html

SELECT *
FROM <http://example/g1>
FROM <http://example/g2>
WHERE { .. }

is a default graph of just the union of <g1> and <g2>  That is a loop 
over the graphs. Imagine two graph out of 100K

It could be done with the quad filter hook:

   http://jena.apache.org/documentation/tdb/quadfilter.html

but that is a low level hook and harder developer work to use.

	Andy

> -----Original Message----- From: Andy Seaborne
> [mailto:andy@apache.org] Sent: Monday, June 03, 2013 4:26 PM To:
> users@jena.apache.org Subject: Re: Ontologies and model data
>
> On 03/06/13 18:09, Joshua TAYLOR wrote:
>> On Mon, Jun 3, 2013 at 12:41 PM, Cindy A McMullen
>> <ci...@oracle.com> wrote:
>>> I've been working with Protege, where the 'individuals' are
>>> loaded into the same model as my ontologies.  In the real world,
>>> however, I wonder whether one loads the ontologies into a
>>> separate model from the actual graph data.  Any best practices
>>> here?
>>
>> I typically create my data (mostly individuals and property
>> assertions) in an OWL ontology that owl:imports the ontology that
>> defines the vocabulary (mostly classes and properties) is defined.
>> I think that's fairly common practice, especially when referencing
>> ontologies that you didn't create.
>>
>
> If the individuals are in one named graph of a TDB dataset, the
> ontology can go in another, so they are in different graphs.  You can
> query the combination with the union of named graphs as the default
> graph of the SPARQL query.
>
> Or you can use a union graph of two graphs in-memory (or indeed any
> storage mixture).
>
> Andy
>


RE: Ontologies and model data

Posted by David Jordan <Da...@sas.com>.
Andy,
I am curious, I have not evaluated this. Are there any inherent performance consequences when working with a union of graphs? For example, is there a need to do multiple lookups as opposed to one when searching for resources?


-----Original Message-----
From: Andy Seaborne [mailto:andy@apache.org] 
Sent: Monday, June 03, 2013 4:26 PM
To: users@jena.apache.org
Subject: Re: Ontologies and model data

On 03/06/13 18:09, Joshua TAYLOR wrote:
> On Mon, Jun 3, 2013 at 12:41 PM, Cindy A McMullen 
> <ci...@oracle.com> wrote:
>> I've been working with Protege, where the 'individuals' are loaded 
>> into the same model as my ontologies.  In the real world, however, I 
>> wonder whether one loads the ontologies into a separate model from 
>> the actual graph data.  Any best practices here?
>
> I typically create my data (mostly individuals and property
> assertions) in an OWL ontology that owl:imports the ontology that 
> defines the vocabulary (mostly classes and properties) is defined.
> I think that's fairly common practice, especially when referencing 
> ontologies that you didn't create.
>

If the individuals are in one named graph of a TDB dataset, the ontology can go in another, so they are in different graphs.  You can query the combination with the union of named graphs as the default graph of the SPARQL query.

Or you can use a union graph of two graphs in-memory (or indeed any storage mixture).

	Andy


Re: Ontologies and model data

Posted by Andy Seaborne <an...@apache.org>.
On 03/06/13 18:09, Joshua TAYLOR wrote:
> On Mon, Jun 3, 2013 at 12:41 PM, Cindy A McMullen
> <ci...@oracle.com> wrote:
>> I've been working with Protege, where the 'individuals' are loaded
>> into the same model as my ontologies.  In the real world, however,
>> I wonder whether one loads the ontologies into a separate model
>> from the actual graph data.  Any best practices here?
>
> I typically create my data (mostly individuals and property
> assertions) in an OWL ontology that owl:imports the ontology that
> defines the vocabulary (mostly classes and properties) is defined.
> I think that's fairly common practice, especially when referencing
> ontologies that you didn't create.
>

If the individuals are in one named graph of a TDB dataset, the ontology 
can go in another, so they are in different graphs.  You can query the 
combination with the union of named graphs as the default graph of the 
SPARQL query.

Or you can use a union graph of two graphs in-memory (or indeed any 
storage mixture).

	Andy

Re: Ontologies and model data

Posted by Joshua TAYLOR <jo...@gmail.com>.
On Mon, Jun 3, 2013 at 12:41 PM, Cindy A McMullen
<ci...@oracle.com> wrote:
> I've been working with Protege, where the 'individuals' are loaded into the same model as my ontologies.  In the real world, however, I wonder whether one loads the ontologies into a separate model from the actual graph data.  Any best practices here?

I typically create my data (mostly individuals and property
assertions) in an OWL ontology that owl:imports the ontology that
defines the vocabulary (mostly classes and properties) is defined.  I
think that's fairly common practice, especially when referencing
ontologies that you didn't create.

-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/