You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Thomas Marsh <tm...@thetus.com> on 2014/02/19 03:30:19 UTC

question about getting properties from a class

hello again jena folks,
is there a way to list properties of a class without listing the 
inferred properties?
I am using OntClass.listProperties() and it gives me inferred subClassOf 
statements.
I need a way to differentiate the asserted ones from the inferred ones.
thanks,
-thomas


Re: question about getting properties from a class

Posted by thomas marsh <tm...@thetus.com>.
oh my goodness.  I can't believe I missed that in the javadoc.
thank you so much!
-thomas

On 02/19/2014 10:03 AM, Dave Reynolds wrote:
> On 19/02/14 17:45, Thomas Marsh wrote:
>> ok,
>> sorry to be thick here,  but how do I make a model without inferencing?
>> I am using:
>> jenaModel = ModelFactory.createOntologyModel();
>> and then just reading my owl file:
>> jenaModel.read(file)
>> and then not setting a reasoner.
>> is that right?
>
> Specify an explicit OntModelSpec with no reasoner. The default 
> OntModelSpec includes RDFS reasoning.
>
>   jenaModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
>
> If you want both with- and without- inference versions then load your 
> data first into a plain model then wrap two ontology models round that 
> with different OntModelSpecs.
>
> Dave
>
>> -thomas
>>
>>
>>
>>
>>
>> On 2/19/14, 12:40 AM, Dave Reynolds wrote:
>>> On 19/02/14 02:30, Thomas Marsh wrote:
>>>> hello again jena folks,
>>>> is there a way to list properties of a class without listing the
>>>> inferred properties?
>>>> I am using OntClass.listProperties() and it gives me inferred 
>>>> subClassOf
>>>> statements.
>>>> I need a way to differentiate the asserted ones from the inferred 
>>>> ones.
>>>> thanks,
>>>
>>> There's not a neat way to do this. The best bet is to create two
>>> OntModel wrappers over the same base model - one with inference and
>>> one without. Since OntModel's are just wrappers, they have no state,
>>> this is both safe and low overhead.
>>>
>>> Dave
>>>
>>>
>>
>


Re: question about getting properties from a class

Posted by Dave Reynolds <da...@gmail.com>.
On 19/02/14 17:45, Thomas Marsh wrote:
> ok,
> sorry to be thick here,  but how do I make a model without inferencing?
> I am using:
> jenaModel = ModelFactory.createOntologyModel();
> and then just reading my owl file:
> jenaModel.read(file)
> and then not setting a reasoner.
> is that right?

Specify an explicit OntModelSpec with no reasoner. The default 
OntModelSpec includes RDFS reasoning.

   jenaModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);

If you want both with- and without- inference versions then load your 
data first into a plain model then wrap two ontology models round that 
with different OntModelSpecs.

Dave

> -thomas
>
>
>
>
>
> On 2/19/14, 12:40 AM, Dave Reynolds wrote:
>> On 19/02/14 02:30, Thomas Marsh wrote:
>>> hello again jena folks,
>>> is there a way to list properties of a class without listing the
>>> inferred properties?
>>> I am using OntClass.listProperties() and it gives me inferred subClassOf
>>> statements.
>>> I need a way to differentiate the asserted ones from the inferred ones.
>>> thanks,
>>
>> There's not a neat way to do this. The best bet is to create two
>> OntModel wrappers over the same base model - one with inference and
>> one without. Since OntModel's are just wrappers, they have no state,
>> this is both safe and low overhead.
>>
>> Dave
>>
>>
>


Re: question about getting properties from a class

Posted by Thomas Marsh <tm...@thetus.com>.
ok,
sorry to be thick here,  but how do I make a model without inferencing?
I am using:
jenaModel = ModelFactory.createOntologyModel();
and then just reading my owl file:
jenaModel.read(file)
and then not setting a reasoner.
is that right?
-thomas





On 2/19/14, 12:40 AM, Dave Reynolds wrote:
> On 19/02/14 02:30, Thomas Marsh wrote:
>> hello again jena folks,
>> is there a way to list properties of a class without listing the
>> inferred properties?
>> I am using OntClass.listProperties() and it gives me inferred subClassOf
>> statements.
>> I need a way to differentiate the asserted ones from the inferred ones.
>> thanks,
>
> There's not a neat way to do this. The best bet is to create two 
> OntModel wrappers over the same base model - one with inference and 
> one without. Since OntModel's are just wrappers, they have no state, 
> this is both safe and low overhead.
>
> Dave
>
>


Re: question about getting properties from a class

Posted by Dave Reynolds <da...@gmail.com>.
On 19/02/14 02:30, Thomas Marsh wrote:
> hello again jena folks,
> is there a way to list properties of a class without listing the
> inferred properties?
> I am using OntClass.listProperties() and it gives me inferred subClassOf
> statements.
> I need a way to differentiate the asserted ones from the inferred ones.
> thanks,

There's not a neat way to do this. The best bet is to create two 
OntModel wrappers over the same base model - one with inference and one 
without. Since OntModel's are just wrappers, they have no state, this is 
both safe and low overhead.

Dave