# Triggering an action as SWRL implication

**URL:** <https://community.stardog.com/t/triggering-an-action-as-swrl-implication/761>\
**Category:** Support\
**Created:** [January 9, 2018, 9:44pm UTC](https://community.stardog.com/t/triggering-an-action-as-swrl-implication/761 "2018-01-09T21:44:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![johan.kumps](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/johan.kumps/32/201_2.png) [@johan.kumps](https://community.stardog.com/u/johan.kumps)\
**Post date:** [January 9, 2018, 9:44pm UTC](https://community.stardog.com/t/triggering-an-action-as-swrl-implication/761/1 "2018-01-09T21:44:42Z")

</div>

Hi,

What are the design options to trigger an action (for example invoke an API to sending a message to an actuator device) as the implication of a SWRL rule? Take this example https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3586453/bin/CMMM2013-650671.009.gif. Do I need to have a polling component looking for a property being set to an individual or newly created individuals of a certain type?  
In case other designs next to polling exist, I would prepare that.

Could you advice?

Kind regards,

---

<div class="post-metadata">

**Author:** ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)\
**Post date:** [January 9, 2018, 10:22pm UTC](https://community.stardog.com/t/triggering-an-action-as-swrl-implication/761/2 "2018-01-09T22:22:26Z")

</div>

I can’t read the GIF you linked to so I’m unsure if it provides some relevant context. The inferences from rules are available in the results of SPARQL queries. Stardog does not implement any type of trigger to respond to new data (whether inferred or concrete).

Jess

---

<div class="post-metadata">

**Author:** ![johan.kumps](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/johan.kumps/32/201_2.png) [@johan.kumps](https://community.stardog.com/u/johan.kumps)\
**Post date:** [January 10, 2018, 8:08am UTC](https://community.stardog.com/t/triggering-an-action-as-swrl-implication/761/3 "2018-01-10T08:08:46Z")

</div>

> [@johan.kumps](#):
>
> [https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3586453/bin/CMMM2013-650671.009.gif](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3586453/bin/CMMM2013-650671.009.gif)

Hi Jess,

Thanks for your reply. The gif can be found on this page [The iOSC3 System: Using Ontologies and SWRL Rules for Intelligent Supervision and Care of Patients with Acute Cardiac Disorders - PMC](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3586453/) (box 1).

So we only have the polling approach to react to new information.

Kind regards,

---

<div class="post-metadata">

**Author:** ![jess](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/jess/32/10_2.png) [@jess](https://community.stardog.com/u/jess)\
**Post date:** [January 11, 2018, 3:21am UTC](https://community.stardog.com/t/triggering-an-action-as-swrl-implication/761/4 "2018-01-11T03:21:13Z")

</div>

I see the SWRL rule now. As recently mentioned in [this thread](https://community.stardog.com/t/how-to-handle-nulls-in-snarl/760/2) it's possible to listen for triples being added to a database. It would be possible to use this to look for changes that may potentially infer the head of the rule. For example you could listen for new `Decision` instances and then execute a SPARQL query to check if the decision meets the "increase dose" requirements. This may save some effort and give quicker results than polling.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [January 25, 2018, 3:33am UTC](https://community.stardog.com/t/triggering-an-action-as-swrl-implication/761/5 "2018-01-25T03:33:46Z")

</div>

Closed on January 25, 2018, 3:33am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
