Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Following SWRL Rules

Rodolfo Rieckhof rodo2024 at googlemail.com
Thu Nov 18 01:32:47 PST 2010


Hi
for example i have:
bad:Device(?x) ∧ bad:deviceManufacturer(?x, ?m) ∧ bad:Manufacturer(?m) ∧
bad:manufacturerName(?m, ?name) →  this:deviceManufactererName(?x, ?name)
an then i call

String thePATH = help.getAbsoluteURI("myonto.owl");
            String theURI = new File(thePATH).toURI().toString();
            owlModel = ProtegeOWL.createJenaOWLModelFromURI(theURI);
            OWLDataFactoryImpl owlDF = new OWLDataFactoryImpl(owlModel);
            SWRLRule rule = owlDF.getSWRLRule(getRuleName());
            List<Atom> body = rule.getBodyAtoms();
            for (Atom atom : body) {
                System.out.println(atom);
            }

i get first the Properties (in the right order ) and then the classes (also
in the right order) like this:

http://www.baDevices#deviceManufacturer(x, m)
http://www.baDevices#manufacturerName(m, name)
http://www.baDevices#Device(x)
http://www./baDevices#Manufacturer(m)

 what i wanted was that they have the same order as in the rule above. Like
this

http://www.baDevices#Device(x)
http://www.baDevices#deviceManufacturer(x, m)
http://www./baDevices#Manufacturer(m)
http://www.baDevices#manufacturerName(m, name)

But with this order first properties and then Classes can also be done what
i wanted to.  I am relative new to the Protegeapi so i might be calling the
wrong methods. Could you tell me if i am doing anything wrong here.



Regards,
Rodolfo


2010/11/18 Martin O'Connor <martin.oconnor at stanford.edu>

> I am pretty sure Protege 3.4 does not reorder atoms. Can you give me an
> example where this happens?
>
> Martin
>
> Rodolfo Rieckhof wrote:
>
>> Hello,
>> we are generating a GUI out of the owl Ontology and rules and when the
>> atoms in the Rule are not in the "proper" oder, then the GUI  looks  weird.
>>
>> Regards,
>> Rodolfo
>>
>> 2010/11/16 Martin O'Connor <martin.oconnor at stanford.edu <mailto:
>> martin.oconnor at stanford.edu>>
>>
>>    I am somewhat confused. Why do you need to keep track of atom
>>    ordering for built-ins? Is it because of argument binding?
>>
>>    Martin
>>
>>    Rodolfo Rieckhof wrote:
>>
>>        Hi,
>>        "In Protege 3, the atoms are definitely not reordered."
>>        Ok then i must do it by hand, i was working with protege 3.
>>
>>        Thanks,
>>        Rodolfo
>>
>>
>>
>>
>>        2010/11/16 Martin O'Connor <martin.oconnor at stanford.edu
>>        <mailto:martin.oconnor at stanford.edu>
>>        <mailto:martin.oconnor at stanford.edu
>>        <mailto:martin.oconnor at stanford.edu>>>
>>
>>
>>           The comma notation would suggest that this is a Protege 4
>>        issues.
>>
>>           In Protege 3, the atoms are definitely not reordered.
>>
>>           Martin
>>
>>           Timothy Redmond wrote:
>>
>>
>>                   The problem is that Atoms are not in the right
>>        order so i
>>                   must rebuild the path order according to the order
>>        of the
>>                   variables, what is somehow hard. Is there another
>>        way to
>>                   do this ?
>>
>>
>>               I will have to ask Martin about this.  I am not sure
>>        why the
>>               order of the variables should be wrong.  I know that
>>        there is
>>               an issue with this in the OWL api which is used by
>>        Protege 4.
>>
>>                   Now there is another program that needs to understant
>>                   where the value from fatherName(?x,?name) came from.
>>
>>
>>               As a general rule, this is a hard problem.  A reasoner does
>>               many things and will not necessarily tell you how it
>>        reached
>>               its conclusions.  You may have some domain-specific
>>        knowledge
>>               that is allowing you to identify the rule.   A more general
>>               solution would be to use an explanation utility but I have
>>               never tried this with swrl rules.
>>
>>               -Timothy
>>
>>
>>
>>               On 11/10/2010 07:04 AM, Rodolfo Rieckhof wrote:
>>
>>                   Hello everybody,
>>                   i am trying to do the following i  have an SWRL
>>        Rule like:
>>                   Father(?f) , family(?x,?family) , familyName(?family,
>>                   ?name) -> fatherName(?x,?name) where Father is a class,
>>                   family is an Object Property and the rest are
>>                   DataProperties (DP). The reasoner sets the DP
>>         fatherName
>>                   when the body complies. Now there is another
>>        program that
>>                   needs to understant where the value from
>>                   fatherName(?x,?name) came from. So what i am doing
>>        now is
>>                   to build the an OWLModel, call getSWRLRule() and
>>        reading
>>                   rule. The problem is that Atoms are not in the
>>        right order
>>                   so i must rebuild the path order according to the
>>        order of
>>                   the variables, what is somehow hard. Is there
>>        another way
>>                   to do this ?
>>
>>                   Regards,
>>                   Rodolfo
>>
>>
>>                   _______________________________________________
>>                   protege-owl mailing list
>>                   protege-owl at lists.stanford.edu
>>        <mailto:protege-owl at lists.stanford.edu>
>>                   <mailto:protege-owl at lists.stanford.edu
>>        <mailto:protege-owl at lists.stanford.edu>>
>>
>>
>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>
>>                   Instructions for unsubscribing:
>>                   http://protege.stanford.edu/doc/faq.html#01a.03
>>
>>
>>  ------------------------------------------------------------------------
>>
>>
>>
>>               _______________________________________________
>>               protege-owl mailing list
>>               protege-owl at lists.stanford.edu
>>        <mailto:protege-owl at lists.stanford.edu>
>>               <mailto:protege-owl at lists.stanford.edu
>>        <mailto:protege-owl at lists.stanford.edu>>
>>
>>               https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>
>>               Instructions for unsubscribing:
>>               http://protege.stanford.edu/doc/faq.html#01a.03
>>
>>           _______________________________________________
>>           protege-owl mailing list
>>           protege-owl at lists.stanford.edu
>>        <mailto:protege-owl at lists.stanford.edu>
>>        <mailto:protege-owl at lists.stanford.edu
>>        <mailto:protege-owl at lists.stanford.edu>>
>>
>>           https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>
>>           Instructions for unsubscribing:
>>           http://protege.stanford.edu/doc/faq.html#01a.03
>>
>>
>>
>>  ------------------------------------------------------------------------
>>
>>        _______________________________________________
>>        protege-owl mailing list
>>        protege-owl at lists.stanford.edu
>>        <mailto:protege-owl at lists.stanford.edu>
>>        https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>
>>        Instructions for unsubscribing:
>>        http://protege.stanford.edu/doc/faq.html#01a.03
>>
>>
>>    _______________________________________________
>>    protege-owl mailing list
>>    protege-owl at lists.stanford.edu <mailto:protege-owl at lists.stanford.edu>
>>    https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>
>>    Instructions for unsubscribing:
>>    http://protege.stanford.edu/doc/faq.html#01a.03
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> protege-owl mailing list
>> protege-owl at lists.stanford.edu
>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>
>> Instructions for unsubscribing:
>> http://protege.stanford.edu/doc/faq.html#01a.03
>>
>>
>
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20101118/a8f91718/attachment.html>


More information about the protege-owl mailing list