Get Reasoner for an ontology in memory

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Get Reasoner for an ontology in memory

Michael_Aqui
Hi,

I would like to get an instance of the selected reasoner in the Protege ui and use for an ontology which I am building in memory not viewable in the ui. Is this possible? I am using Protege 5.2 for this.

Thanks,
Michael



Note: St.Martin's Institute of Higher Education is in no way responsible for the contents of this e-mail. Thank You.
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Get Reasoner for an ontology in memory

Matthew Horridge-2
Administrator
Hi Michael,

What you can potentially do is:

1) get hold of the OWLReasonerManager from the OWLOntologyManager, 
2) from this get hold of the current reasoner factory, actually and instance of ProtegeOWLReasonerInfo
3) from the instance of ProtegeOWLReasonerInfo get hold of the OWLReasonerFactory
4) create an instance of the reasoner using OWLReasonerFactory using the createNonBufferingReasoner method

Cheers,

Matthew



 
On 25 Jan 2018, at 01:27, Michael Aquilina <[hidden email]> wrote:

Hi,

I would like to get an instance of the selected reasoner in the Protege ui and use for an ontology which I am building in memory not viewable in the ui. Is this possible? I am using Protege 5.2 for this.

Thanks,
Michael



Note: St.Martin's Institute of Higher Education is in no way responsible for the contents of this e-mail. Thank You._______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev


_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: Get Reasoner for an ontology in memory

Michael_Aqui
Hi Matthew,

Thanks! Works like a charm. ;) Code below maybe it helps others.

Michael

Code

// 1) get hold of the OWLReasonerManager from the OWLOntologyManager,
OWLReasonerManagerImpl impl = new OWLReasonerManagerImpl(this.modelManager);
// 2) from this get hold of the current reasoner factory, actually and instance
// of ProtegeOWLReasonerInfo
ProtegeOWLReasonerInfo rf = impl.getCurrentReasonerFactory();

// 3) from the instance of ProtegeOWLReasonerInfo get hold of the
// OWLReasonerFactory
// 4) create an instance of the reasoner using OWLReasonerFactory using the
// createNonBufferingReasoner method
OWLReasoner owlReasoner = rf.getReasonerFactory().createReasoner(ontology);

On Wed, Jan 31, 2018 at 11:13 PM, Matthew Horridge <[hidden email]> wrote:
Hi Michael,

What you can potentially do is:

1) get hold of the OWLReasonerManager from the OWLOntologyManager, 
2) from this get hold of the current reasoner factory, actually and instance of ProtegeOWLReasonerInfo
3) from the instance of ProtegeOWLReasonerInfo get hold of the OWLReasonerFactory
4) create an instance of the reasoner using OWLReasonerFactory using the createNonBufferingReasoner method

Cheers,

Matthew



 
On 25 Jan 2018, at 01:27, Michael Aquilina <[hidden email]> wrote:

Hi,

I would like to get an instance of the selected reasoner in the Protege ui and use for an ontology which I am building in memory not viewable in the ui. Is this possible? I am using Protege 5.2 for this.

Thanks,
Michael



Note: St.Martin's Institute of Higher Education is in no way responsible for the contents of this e-mail. Thank You._______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev


_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev




--
Michael Aquilina
CIS 4th Year


Note: St.Martin's Institute of Higher Education is in no way responsible for the contents of this e-mail. Thank You.
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev