Small Java program to execute a single SWRL rule

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

Small Java program to execute a single SWRL rule

Aguiar Magalhaes
Hi,
I'm studing SWRL + SQWRL in Protege-OWL 3.4.4 and I need a small Java program to execute a single SWRL rule and get the result into a variable.
The rule is implemented in Protege and working properly.
Could you help me ?
Please,
Magalhaes



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

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
Reply | Threaded
Open this post in threaded view
|

Re: Small Java program to execute a single SWRL rule

Martin O'Connor
http://protege.cim3.net/cgi-bin/wiki.pl?SQWRLQueryAPI#nidBJO

The SWRLTab wiki has documentation on all SWRL- and SQWRL-releated APIs in Protege-OWL.

Martin

On 2/9/2011 10:03 AM, Aguiar Magalhaes wrote:

> Hi,
> I'm studing SWRL + SQWRL in Protege-OWL 3.4.4 and I need a small Java program to execute a single SWRL rule and get the result into a variable.
> The rule is implemented in Protege and working properly.
> Could you help me ?
> Please,
> Magalhaes
>
>
>
>
> _______________________________________________
> protege-owl mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>

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

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
Reply | Threaded
Open this post in threaded view
|

Re: Small Java program to execute a single SWRL rule

Aguiar Magalhaes
In reply to this post by Aguiar Magalhaes
Thanks Martin,
However, i've created an ontology APA.owl and I need to load it into my Java program. Following the example below, how can I create the OWLModel object referencing my APA.owl ontology ?
 
OWLModel owlModel = ????
SQWRLQueryEngine queryEngine = SWRLQueryEngineFactory.create(owlModel);
SQWRLResult result = queryEngine.runSQWRLQuery("Query-1", Person(?p) ^ hasName(?p, ?name) ^ hasSalary(?p, ?salary) -> sqwrl:select(?name, ?salary)");

Help me, please.
Magalhaes

--- Em qua, 9/2/11, Martin O'Connor <[hidden email]> escreveu:

> De: Martin O'Connor <[hidden email]>
> Assunto: Re: [protege-owl] Small Java program to execute a single SWRL rule
> Para: [hidden email]
> Data: Quarta-feira, 9 de Fevereiro de 2011, 16:07
> http://protege.cim3.net/cgi-bin/wiki.pl?SQWRLQueryAPI#nidBJO
>
> The SWRLTab wiki has documentation on all SWRL- and
> SQWRL-releated APIs in Protege-OWL.
>
> Martin
>
> On 2/9/2011 10:03 AM, Aguiar Magalhaes wrote:
> > Hi,
> > I'm studing SWRL + SQWRL in Protege-OWL 3.4.4 and I
> need a small Java program to execute a single SWRL rule and
> get the result into a variable.
> > The rule is implemented in Protege and working
> properly.
> > Could you help me ?
> > Please,
> > Magalhaes
> >
> >
> >
> >
> > _______________________________________________
> > protege-owl mailing list
> > [hidden email]
> > https://mailman.stanford.edu/mailman/listinfo/protege-owl
> >
> > Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
> >
>
> _______________________________________________
> protege-owl mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>


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

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
Reply | Threaded
Open this post in threaded view
|

Re: Small Java program to execute a single SWRL rule

Thomas Russ

On Feb 11, 2011, at 4:34 AM, Aguiar Magalhaes wrote:

> Thanks Martin,
> However, i've created an ontology APA.owl and I need to load it into  
> my Java program. Following the example below, how can I create the  
> OWLModel object referencing my APA.owl ontology ?
>
> OWLModel owlModel = ????

http://protegewiki.stanford.edu/wiki/ProtegeOWL_API_Advanced_Topics#Loading_and_Saving_Files

> SQWRLQueryEngine queryEngine =  
> SWRLQueryEngineFactory.create(owlModel);
> SQWRLResult result = queryEngine.runSQWRLQuery("Query-1", Person(?p)  
> ^ hasName(?p, ?name) ^ hasSalary(?p, ?salary) -> sqwrl:select(?
> name, ?salary)");
>
> Help me, please.
> Magalhaes
>
> --- Em qua, 9/2/11, Martin O'Connor <[hidden email]>  
> escreveu:
>
>> De: Martin O'Connor <[hidden email]>
>> Assunto: Re: [protege-owl] Small Java program to execute a single  
>> SWRL rule
>> Para: [hidden email]
>> Data: Quarta-feira, 9 de Fevereiro de 2011, 16:07
>> http://protege.cim3.net/cgi-bin/wiki.pl?SQWRLQueryAPI#nidBJO
>>
>> The SWRLTab wiki has documentation on all SWRL- and
>> SQWRL-releated APIs in Protege-OWL.
>>
>> Martin
>>
>> On 2/9/2011 10:03 AM, Aguiar Magalhaes wrote:
>>> Hi,
>>> I'm studing SWRL + SQWRL in Protege-OWL 3.4.4 and I
>> need a small Java program to execute a single SWRL rule and
>> get the result into a variable.
>>> The rule is implemented in Protege and working
>> properly.
>>> Could you help me ?
>>> Please,
>>> Magalhaes
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> protege-owl mailing list
>>> [hidden email]
>>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>>
>>> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>>>
>>
>> _______________________________________________
>> protege-owl mailing list
>> [hidden email]
>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>
>> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>>
>
>
>
> _______________________________________________
> protege-owl mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03

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

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03