Can SQWRL queries be called in SWRL rules?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Can SQWRL queries be called in SWRL rules?

This post has NOT been accepted by the mailing list yet.

 I am currently building a simple ontology for connected vehicles for my bachelor project.  I have built a really long rule to give a result of whether the system is ok or not:

Vehicle(?v) ^ Warning_Sensor(?ws) ^ Crash(?e) ^ Avg_Speed_Sensor(?ss) ^ Road(?r) ^ Location_Sensor(?ls) ^ locationSensor_Vehicle(?ls, ?v) ^ recorded_location(?ls, ?r) ^ Traffic_Flow_Sensor(?tfs) ^ trafficFlowSensor_Infrastructure(?tfs, ?r) ^ recorded_traffic_flow(?tfs, "high") ^ avgSpeedSensor_Infrastructue(?ss, ?r) ^ recorded_speed(?ss, ?rs) ^ min_speed_limit(?r, ?msl) ^ swrlb:lessThan(?rs, ?msl) ^ warningSensor_Vehicle(?ws, ?v) ^ recorded_warning_event(?ws, ?e) -> system_ok(?v, true)

Since it is too long, I wanted to break it down a bit by writing two SQWRL queries on SQWRL tab in Protege. The first query, for instance,is called RetrieveCarSensors, and it lists all vehicle instances and the sensors attached to each vehicle:

Vehicle(?v) ^ Warning_Sensor(?ws) ^ Location_Sensor(?ls) ^ locationSensor_Vehicle(?ls, ?v) ^ warningSensor_Vehicle(?ws, ?v) -> sqwrl:select(?v, ?ls, ?ws)

I cannot find instructions on calling that query in a SWRL rule though. Is it allowed to call this query in the SWRL rule to reduce the size of the rule then? or is there another way that someone could suggest to me?

Your help would be much appreciated.
Best Regards,