Reasoning about data property

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

Reasoning about data property

jayson
Hello together,

I would like to do some reasoning based on data properties and I already read this old post (http://owlready.8326.n8.nabble.com/Reasoning-with-data-properties-td600.html) but could not figure it out so far.

What I am trying to accomplish is to restrict a class using a data property and reason about it.
Using the Manchester syntax (part of it), this would look like

Equivalent To: SubstanceProperty and (substanceHasFlashpoint some xsd:float[>= 55.f])

This is what i tried so far:

with onto:
        class Substance(Thing):
                pass
               
        class SubstanceProperty(Thing):
                pass
               
        class substanceHasFlashpoint(Substance >> float, FunctionalProperty):
        pass
               
        class HighlyFlammable(SubstanceProperty):
                equivalent_to = [SubstanceProperty & substanceHasFlashpoint.some([>= "55.0"^^decimal])]

There seems to be a syntax issue and I was not able to make it work.

Alternatively would this be easier to acomplish by using SWRL ?


Thank you for your time,
Jayson
Reply | Threaded
Open this post in threaded view
|

Re: Reasoning about data property

Jiba
Administrator
Hi,

You can simply use:

    class HighlyFlammable(SubstanceProperty):
        equivalent_to = [SubstanceProperty & (substanceHasFlashpoint >= 55.0)]

Owlready will automatically consider 55.0 as a decimal, and understand it as a "some" restriction.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Reasoning about data property

jayson
Hi Jiba,

thank you very much, that works like a charm!

Best regards,
Jayson