Re: How to save the explanations to a local file

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: How to save the explanations to a local file

Matthew Horridge-2
Administrator
Yes, if you want to configure/choose things and put them together.  Otherwise, you can use the following….

Assuming
rf is a pointer to an OWLReasonerFactory
ont is a point to an OWLOntology

ExplanationGeneratorFactory<OWLAxiom> genFac = ExplanationManager.createExplanationGeneratorFactory(rf);
ExplanationGenerator<OWLAxiom> gen = genFac.createExplanationGenerator(ont);
Set<Explanation<OWLAxiom>> expls = gen.getExplanations(ax);

Cheers,

Matthew

On 7 Feb 2014, at 11:15, Lorenz Bühmann <[hidden email]> wrote:

> Nice to hear about the Github plans!
>
> From what I can see, you can run the code like this:
>
> int limit = 5;
> boolean useModularization = true;
> OWLAxiom entailment = ...
> OWLOntology ontology = ...
> OWLReasonerFactory reasonerFactory = ... //your specific OWL reasoner factory, e.g. Pellet, HermiT, JFact
> EntailmentCheckerFactory<OWLAxiom> checkerFactory = new SatisfiabilityEntailmentCheckerFactory(reasonerFactory, useModularization);
> Configuration<OWLAxiom> configuration = new Configuration<OWLAxiom>(checkerFactory);
> ExplanationGeneratorFactory<OWLAxiom> explanationGeneratorFactory = new BlackBoxExplanationGeneratorFactory<OWLAxiom>(configuration);
> //if you want laconic explanations, use in addition
> explanationGeneratorFactory = new LaconicExplanationGeneratorFactory<OWLAxiom>(explanationGeneratorFactory);
> ExplanationGenerator<OWLAxiom> expGen = explanationGeneratorFactory.createExplanationGenerator(ontology);
> Set<Explanation<OWLAxiom>> explanations = expGen.getExplanations(entailment, limit);
>
> Kind regards,
> Lorenz Bühmann
>
>
> On 02/07/2014 07:44 PM, Matthew Horridge wrote:
>> btw, the code is not Protege specific or tied to Protege in any way.
>>
>> On 7 Feb 2014, at 10:44, Matthew Horridge <[hidden email]> wrote:
>>
>>> The code will end up on github soon, with an example of how to use it :)
>>>
>>> Cheers,
>>>
>>> Matthew
>>>
>>> On 7 Feb 2014, at 09:14, Phillip Lord <[hidden email]> wrote:
>>>
>>>> Timothy Redmond <[hidden email]> writes:
>>>>
>>>>> On 02/07/2014 04:15 AM, Phillip Lord wrote:
>>>>>> That's interesting; I've spent a little time trying to produce
>>>>>> explanations programmatically and have so far failed badly.
>>>>>>
>>>>>> The explanations produced by protege, though, appear to be coming from
>>>>>> protege specific code, rather than the OWL API. Confusing.
>>>>> In the older versions, the explanations produced by Protege came directly from
>>>>> the OWL api explanation utilities.  The explanations produced by the later
>>>>> versions of Protege come from code developed by Matthew.  If you look in your
>>>>> plugins directory you will see a plugin with whose name includes the word
>>>>> "explanation".
>>>>
>>>> Yes, I know. I wanted to use it outside of protege. I've tried hacking
>>>> through the code, but working out what is doing what is quite hard; it's
>>>> rather a morass of factories, and workbenches. Last time I tried, I felt
>>>> like I'd been beaten over the head repeatedly with a copy of Gamma et
>>>> al.
>>>>
>>>> Does anyone have a laconic and precise explanation of how to use this
>>>> api?
>>>>
>>>> Phil
>>>> _______________________________________________
>>>> protege-user mailing list
>>>> [hidden email]
>>>> https://mailman.stanford.edu/mailman/listinfo/protege-user
>> _______________________________________________
>> protege-user mailing list
>> [hidden email]
>> https://mailman.stanford.edu/mailman/listinfo/protege-user
>>
>>
>>
>
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

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