You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Kamalraj Jairam <kj...@semanticsoftware.com.au> on 2015/01/08 07:30:10 UTC

Inferencing

Hello All,

I have small problem with reasoning. I’m not sure whether i’m doing the right thing

In My ontology i have following statements

A rdf:type owl:Class
B rdf:type owl:Class
A owl:equivalentClass B

in My ref data i have following statements

A1 rdf:type A

When i run the reasoner, the inference model should have additional statement

A1 rdf:type B

the inference model seems to have just the first statement the inferred statement seems to be missing

Where am i going wrong.

This is my code

OntModelSpec ontModelSpec = OntModelSpec.OWL_DL_MEM_TRANS_INF;

ontModelSpec.setReasoner(getReasonerType(reasonerName));

OntModel ontModel = ModelFactory.createOntologyModel(ontModelSpec, namedSchema);
Reasoner reasoner = getReasonerType(reasonerName);
Reasoner boundReasoner = reasoner.bindSchema(ontModel);
infModel = ModelFactory.createInfModel(boundReasoner, model);

Thanks
Kamalraj


Re: Inferencing

Posted by Kamalraj Jairam <kj...@semanticsoftware.com.au>.
Hi,

	Will go with Dave’s suggestion by using the right reasoners instead of writing specific ruleset

Thanks
 


> On 8 Jan 2015, at 6:09 pm, xiaoq95a@163.com wrote:
> 
> Theoretically, it is symmetric,but add the rule did solved my problem.Have you tried?
> 
> 
> 
> 
> From: Kamalraj Jairam
> Date: 2015-01-08 14:49
> To: users@jena.apache.org
> Subject: Re: Inferencing
> Hi,
> 
> Thanks , isn’t owl:equivalentClass as symmetric property?
> 
> Thanks
> Kamalraj
> 
> 
> On 8 Jan 2015, at 5:45 pm, xiaoq95a@163.com<ma...@163.com> wrote:
> 
> rule "rule x:[?a owl:equivalentClass ?b]->[?b owl:equivalentClass ?a]"
> 


Re: Re: Inferencing

Posted by "xiaoq95a@163.com" <xi...@163.com>.
Theoretically, it is symmetric,but add the rule did solved my problem.Have you tried?




From: Kamalraj Jairam
Date: 2015-01-08 14:49
To: users@jena.apache.org
Subject: Re: Inferencing
Hi,
 
Thanks , isn’t owl:equivalentClass as symmetric property?
 
Thanks
Kamalraj
 
 
On 8 Jan 2015, at 5:45 pm, xiaoq95a@163.com<ma...@163.com> wrote:
 
rule "rule x:[?a owl:equivalentClass ?b]->[?b owl:equivalentClass ?a]"
 

Re: Inferencing

Posted by Kamalraj Jairam <kj...@semanticsoftware.com.au>.
Hi,

Thanks , isn’t owl:equivalentClass as symmetric property?

Thanks
Kamalraj


On 8 Jan 2015, at 5:45 pm, xiaoq95a@163.com<ma...@163.com> wrote:

 rule "rule x:[?a owl:equivalentClass ?b]->[?b owl:equivalentClass ?a]"


Re: Inferencing

Posted by "xiaoq95a@163.com" <xi...@163.com>.
I had a similar problem,Which I successfully solved by add a rule "rule x:[?a owl:equivalentClass ?b]->[?b owl:equivalentClass ?a]"



Louise
 
From: Kamalraj Jairam
Date: 2015-01-08 14:30
To: users@jena.apache.org
Subject: Inferencing
Hello All,
 
I have small problem with reasoning. I’m not sure whether i’m doing the right thing
 
In My ontology i have following statements
 
A rdf:type owl:Class
B rdf:type owl:Class
A owl:equivalentClass B
 
in My ref data i have following statements
 
A1 rdf:type A
 
When i run the reasoner, the inference model should have additional statement
 
A1 rdf:type B
 
the inference model seems to have just the first statement the inferred statement seems to be missing
 
Where am i going wrong.
 
This is my code
 
OntModelSpec ontModelSpec = OntModelSpec.OWL_DL_MEM_TRANS_INF;
 
ontModelSpec.setReasoner(getReasonerType(reasonerName));
 
OntModel ontModel = ModelFactory.createOntologyModel(ontModelSpec, namedSchema);
Reasoner reasoner = getReasonerType(reasonerName);
Reasoner boundReasoner = reasoner.bindSchema(ontModel);
infModel = ModelFactory.createInfModel(boundReasoner, model);
 
Thanks
Kamalraj
 

Re: Inferencing

Posted by Kamalraj Jairam <kj...@semanticsoftware.com.au>.
Hi Dave,

	Yes, it was a typo :)

	Thanks, Thats what i’m doing right now to get around the issues

Thanks
Kamalraj
 

> On 10 Jan 2015, at 10:45 pm, Dave Reynolds <da...@gmail.com> wrote:
> 
> On 09/01/15 22:04, Kamalraj Jairam wrote:
>> Hello Dave and everyone
>> 
>> I have run into one more issue
>> 
>> I have a class “A” and “B” in my ontology for which i have added an equivalent class from “Schema.org<http://Schema.org>” and “DBPedia” ontologies (This is to provide external context).
>> 
>> Now when i run the reasoner to inter data against my ontology (using OWLMINI or OWLMICRO”), takes a very long time to produce results.
>> 
>> So, i started using Pellet to reason my ontologies, but pellet doesn’t reason unless i put ontology and the data in the same model .
>> 
>> 1) How can i improve the speed of OWLMINI and OWLMICRO to reason DBPEDIA and Schema.org<http://Schema.org>
> 
> Don't think you can easily, equivalences are expensive especially for the rule reasoner. The only option is to cut down the fractions of the ontologies that you include or switch to a reasoner like Pellet.
> 
>> 2) Why wouldn’t the following statement work for Pellet ?
>> 
>> Reasoner reasoner = ontModelSpec.getReasoner();
>> 
>>    Reasoner boundReasoner = reasoner.bindSchema(ontModel);
>>    infModel = ModelFactory.createInfModel(boundReasoner, model);
>> 
>> my infidel does not have inferred statements if i use pellet
> 
> [Aside: "infidel" was a great typo :)]
> 
> Don't know, you would have to ask the Pellet folks. Perhaps bindSchema isn't fully supported. That would be reasonable since I doubt there's any partial evaluation that Pellet could do at that stage.
> 
> Your alternative is to create a union model (e.g. an OntModel over the base model which imports the ontology, or manually create a dynamic union model of base and ontology). Then you can call createInfModel over that union and omit the step of generating a boundReasoner.
> 
> Dave
> 


Re: Inferencing

Posted by Dave Reynolds <da...@gmail.com>.
On 09/01/15 22:04, Kamalraj Jairam wrote:
> Hello Dave and everyone
>
> I have run into one more issue
>
> I have a class “A” and “B” in my ontology for which i have added an equivalent class from “Schema.org<http://Schema.org>” and “DBPedia” ontologies (This is to provide external context).
>
> Now when i run the reasoner to inter data against my ontology (using OWLMINI or OWLMICRO”), takes a very long time to produce results.
>
> So, i started using Pellet to reason my ontologies, but pellet doesn’t reason unless i put ontology and the data in the same model .
>
> 1) How can i improve the speed of OWLMINI and OWLMICRO to reason DBPEDIA and Schema.org<http://Schema.org>

Don't think you can easily, equivalences are expensive especially for 
the rule reasoner. The only option is to cut down the fractions of the 
ontologies that you include or switch to a reasoner like Pellet.

> 2) Why wouldn’t the following statement work for Pellet ?
>
> Reasoner reasoner = ontModelSpec.getReasoner();
>
>     Reasoner boundReasoner = reasoner.bindSchema(ontModel);
>     infModel = ModelFactory.createInfModel(boundReasoner, model);
>
> my infidel does not have inferred statements if i use pellet

[Aside: "infidel" was a great typo :)]

Don't know, you would have to ask the Pellet folks. Perhaps bindSchema 
isn't fully supported. That would be reasonable since I doubt there's 
any partial evaluation that Pellet could do at that stage.

Your alternative is to create a union model (e.g. an OntModel over the 
base model which imports the ontology, or manually create a dynamic 
union model of base and ontology). Then you can call createInfModel over 
that union and omit the step of generating a boundReasoner.

Dave


Re: Inferencing

Posted by Kamalraj Jairam <kj...@semanticsoftware.com.au>.
Hello Dave and everyone

I have run into one more issue

I have a class “A” and “B” in my ontology for which i have added an equivalent class from “Schema.org<http://Schema.org>” and “DBPedia” ontologies (This is to provide external context).

Now when i run the reasoner to inter data against my ontology (using OWLMINI or OWLMICRO”), takes a very long time to produce results.

So, i started using Pellet to reason my ontologies, but pellet doesn’t reason unless i put ontology and the data in the same model .

1) How can i improve the speed of OWLMINI and OWLMICRO to reason DBPEDIA and Schema.org<http://Schema.org>

2) Why wouldn’t the following statement work for Pellet ?

Reasoner reasoner = ontModelSpec.getReasoner();

   Reasoner boundReasoner = reasoner.bindSchema(ontModel);
   infModel = ModelFactory.createInfModel(boundReasoner, model);

my infidel does not have inferred statements if i use pellet

Thanks
Kamalraj




On 8 Jan 2015, at 9:44 pm, Dave Reynolds <da...@gmail.com>> wrote:

On 08/01/15 10:35, Kamalraj Jairam wrote:
Hi Dave,

Your solution worked.

I thought the transitive reasoner handled more axioms than Micro_Rule.

No, as it says in the docs the transitive reasoner is very minimal it is mostly there as a building block for the more useful reasoners:
https://jena.apache.org/documentation/inference/index.html#transitive

Are there any documentation in the Jena site which shows what entailment does each of these Jena reinsures handle?

Yes, the coverage of the different OWL options outlined in:
https://jena.apache.org/documentation/inference/index.html#OWLcoverage

Dave


Re: Inferencing

Posted by Dave Reynolds <da...@gmail.com>.
On 08/01/15 10:35, Kamalraj Jairam wrote:
> Hi Dave,
>
> 	Your solution worked.
>
> 	I thought the transitive reasoner handled more axioms than Micro_Rule.

No, as it says in the docs the transitive reasoner is very minimal it is 
mostly there as a building block for the more useful reasoners:
https://jena.apache.org/documentation/inference/index.html#transitive

> 	Are there any documentation in the Jena site which shows what entailment does each of these Jena reinsures handle?

Yes, the coverage of the different OWL options outlined in:
https://jena.apache.org/documentation/inference/index.html#OWLcoverage

Dave

Re: Inferencing

Posted by Kamalraj Jairam <kj...@semanticsoftware.com.au>.
Hi Dave,

	Your solution worked.

	I thought the transitive reasoner handled more axioms than Micro_Rule.

	Are there any documentation in the Jena site which shows what entailment does each of these Jena reinsures handle?

Thanks
Kamalraj


> On 8 Jan 2015, at 7:46 pm, Dave Reynolds <da...@gmail.com> wrote:
> 
> 
> 
> On 08/01/15 06:30, Kamalraj Jairam wrote:
>> Hello All,
>> 
>> I have small problem with reasoning. I’m not sure whether i’m doing the right thing
>> 
>> In My ontology i have following statements
>> 
>> A rdf:type owl:Class
>> B rdf:type owl:Class
>> A owl:equivalentClass B
>> 
>> in My ref data i have following statements
>> 
>> A1 rdf:type A
>> 
>> When i run the reasoner, the inference model should have additional statement
>> 
>> A1 rdf:type B
>> 
>> the inference model seems to have just the first statement the inferred statement seems to be missing
>> 
>> Where am i going wrong.
>> 
>> This is my code
>> 
>> OntModelSpec ontModelSpec = OntModelSpec.OWL_DL_MEM_TRANS_INF;
> 
> The is just the transitive reasoner. You need an OWL reasoner if you want OWL inferences. A good default is to use: OWL_MEM_MICRO_RULE_INF
> 
> Dave


Re: Inferencing

Posted by Dave Reynolds <da...@gmail.com>.

On 08/01/15 06:30, Kamalraj Jairam wrote:
> Hello All,
>
> I have small problem with reasoning. I’m not sure whether i’m doing the right thing
>
> In My ontology i have following statements
>
> A rdf:type owl:Class
> B rdf:type owl:Class
> A owl:equivalentClass B
>
> in My ref data i have following statements
>
> A1 rdf:type A
>
> When i run the reasoner, the inference model should have additional statement
>
> A1 rdf:type B
>
> the inference model seems to have just the first statement the inferred statement seems to be missing
>
> Where am i going wrong.
>
> This is my code
>
> OntModelSpec ontModelSpec = OntModelSpec.OWL_DL_MEM_TRANS_INF;

The is just the transitive reasoner. You need an OWL reasoner if you 
want OWL inferences. A good default is to use: OWL_MEM_MICRO_RULE_INF

Dave