Как извлечь все актуаторы, которые выключены, когда дома нет пользователей. Я пытался написать правило Jena, но не смог получить правильный результат. Я добавил желаемый результат, который я хочу. Нужна помощь в написании правила.
[rule1: noValue(:users :hasLocation :home) ->
(:actuators :hasLocation :home)
(:actuators :state "OFF"^^xsd:boolean)]
[rule2: noValue(:users :hasLocation :home) ->
(?x rdf:type :actuators)
(?x :hasLocation :home)
(?x :state "OFF"^^xsd:boolean)]
{ rulex: [noValue(:subject1 :hasPropertyP2 :Object1) ->
(:subject2 :hasProperty1 :Object2)
(:subject2 :hasPropertyP3 Object3)] }
Ontology:
class:user
Individual user_1 -> user
Individual user_2 -> user
.
.
class: actuators
subclass: ac -> actuators
subclass: light -> actuators
subclass: other -> actuators
Individual central_ac -> ac
Individual room_lighting -> light
Individual tv -> other
Individual refridgration -> other
Individual heater -> other
result for rule1 [:actuators :state "OFF"^^xsd:boolean]
result for rule2 [:4e62503a:14b01762f42:-7eea :state "OFF"^^xsd:boolean]
desired result:
[central_ac :state "OFF"^^xsd:boolean]
[room_lighting :state "OFF"^^xsd:boolean]
[tv :state "OFF"^^xsd:boolean]
.
.
[rule1: (?actuator :hasLocation ?home) noValue(?user :hasLocation ?home) -> (?actuator :state "false"^^xsd:boolean)]
. - person Joshua Taylor   schedule 21.01.2015