How to return results of Swrl consequent

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

How to return results of Swrl consequent

IWilliams
I want to write the following swrl rule in Owlready2:

Flow(?fl) ∧ hasAsset(?fl, ?ast) ∧ hasLink(?fl, ?lk) →  hasAttack(?fl, WebAttack1)


There is documentation in Owlready2, but I cannot find any information on how to use the consequent of the rule to get Flows for WebAttack1.
I cannot use SPARQL because the some relationships have to be inferred and SPARQL does not give inferred results.

Is there a way to create rules and then get the results of the consequents and display them to a user?
Reply | Threaded
Open this post in threaded view
|

Re: How to return results of Swrl consequent

Jiba
Administrator
Hi,

I think you can run the Pellet reasoner, and then get the "results" as the instances and/or the subclasses of WebAttack1 (WebAttack1.instances() or WebAttack1.subclasses()).

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: How to return results of Swrl consequent

IWilliams
Hi Jiba,

I will try this at a later time. I may also compare this solution to using SPARQL in terms of runtime.