I am trying to write a SWRL rule that takes the facts :
Robot:robot1 hasSkill RobotSkill:location.
Robot:robot1 hasSkill RobotSkill:move.
Robot:robot2 hasSkill RobotSkill:location.
Robot:robot2 hasSkill RobotSkill:greeting.
RobotTask:guide2visitor dependOn RobotSkill:location.
RobotTask:guide2visitor dependOn RobotSkill:move.
and the rule should state that a robot with all the skills required for a task (via "dependOn" relation) can take the task. My attempt in SWRL is like this:
Robot(?robot), RobotSkill(?skill), RobotTask(?task), hasSkill(?robot, ?skill), dependOn(?task, ?skill) -> takeTask(?robot, ?task)
and the inference result I'm expecting should include a new fact:
Robot:robot1 take RobotTask:guide2visitor.
but the real result include two new facts:
Robot:robot1 take RobotTask:guide2visitor.
Robot:robot2 take RobotTask:guide2visitor.
I have a feeling the rule might require set operations (the skill set required for the task must be a subset of the skill set possessed by the robot), but I can't find useful information on this. I also tried Jena rules and the same problem happened.
How should I correct my SWRL rule? Or if you can let me know the corresponding Jena production rule? Thank you very much in advance!