Rule: 1
if the day is Monday or the day is Tuesday or the day is Wednesday or the day is Thursday or the day is Friday then today is a workday
Rule in non-RDF form:
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rul: <http://id.ninebynine.org/RDFRules/1.0/> . @prefix ex: <http://example.org/#> . ex : monday (?day)-> ex : workday (?day). ex : tuesday(?day)-> ex : workday (?day). ex : wednesday (?day)-> ex : workday (?day). ex : thursday (?day)-> ex : workday (?day). ex : friday (?day)-> ex : workday (?day).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:infer _:genid2].
_:genid1 rdf:type rul:Fact; rul:pred ex:monday; rul:args [rdf:type rdf:List; rdf:first _:genid3; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Var; rdfs:label “?day”.
[analogicznie dla pozostałych dni pracujacych]
Rule: 2
if the day is Saturday or the day is Sunday then today is the weekend
Rule in non-RDF form:
ex : saturday (?day)-> ex : weekend (?day). ex : sunday (?day)-> ex : weekend (?day).
[rdf:type rul:Rule; rul:from _:genid1; rul:infer _:genid2].
_:genid1 rdf:type rul:Fact; rul:pred ex:saturday; rul:args [rdf:type rdf:List; rdf:first _:genid3; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Var; rdfs:label “?day”.
[analogicznie dla „Sunday”]
Rule: 3
if today is workday
and the time is 'between 9 am and 5 pm' then operation is 'during business hours'
Rule in non-RDF form:
ex : workday (?day)& ex : time_between (?time1, ?time2) -> ex : during_buisness_hours (?day, ?time1, ?time2).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:from _:genid2; rul:infer _:genid3].
_:genid1 rdf:type rul:Fact; rul:pred ex:workday; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest rdf:nil].
_:genid2 rdf:type rul:Fact; rul:pred ex:time_between; rul:args [rdf:type rdf:List; rdf:first _:genid5; rdf:rest [rdf:type rdf:List; rdf:first _:genid6; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Fact; rul:pred ex: during_buisness_hours; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest [rdf:type rdf:List; rdf:first _:genid5; rdf rest [rdf:type rdf:List; rdf:first _:genid6; rdf:rest rdf:nil].
_:genid4 rdf:type rul:Var; rdfs:label “?day”.
_:genid5 rdf:type rul:Var; rdfs:label “?time1”.
_:genid6 rdf:type rul:Var; rdfs:label “?time2”.
Rule: 4
if today is workday
and the time is 'before 9 am' then operation is 'not during business hours'
Rule in non-RDF form:
ex : workday (?day)& ex : time_before (?time) -> ex : not_during_buisness_hours (?day, ?time).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:from _:genid2; rul:infer _:genid3].
_:genid1 rdf:type rul:Fact; rul:pred ex:workday; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest rdf:nil].
_:genid2 rdf:type rul:Fact; rul:pred ex:time_before; rul:args [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Fact; rul:pred ex: not_during_buisness_hours; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest [rdf:type rdf:List; rdf:first _:genid5; rdf rest [rdf:type rdf:List; rdf:first _:genid6; rdf:rest rdf:nil].
_:genid4 rdf:type rul:Var; rdfs:label “?day”.
_:genid5 rdf:type rul:Var; rdfs:label “?time”.
Rule: 5
if today is workday
and the time is 'after 5 pm' then operation is 'not during business hours'
Rule in non-RDF form:
ex : workday (?day)& ex : time_after_5pm (?time) -> ex : not_during_buisness_hours (?day, ?time).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:from _:genid2; rul:infer _:genid3].
_:genid1 rdf:type rul:Fact; rul:pred ex:workday; rul:args [rdf:type rdf:List; rdf:first _:genid3; rdf:rest rdf:nil].
_:genid2 rdf:type rul:Fact; rul:pred ex: time_after_5pm; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Var; rdfs:label “?day”.
_:genid4 rdf:type rul:Var; rdfs:label “?time”.
Rule: 6
if today is weekend
then operation is 'not during business hours'
Rule in non-RDF form:
ex : weekend (?day)-> ex : not_during_buisness_hours (?day).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:infer _:genid2].
_:genid1 rdf:type rul:Fact; rul:pred ex: weekend; rul:args [rdf:type rdf:List; rdf:first _:genid3; rdf:rest rdf:nil].
_:genid2 rdf:type rul:Fact; rul:pred ex: not_during_buisness_hours; rul:args [rdf:type rdf:List; rdf:first _:genid3; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Var; rdfs:label “?day”.
Rule: 7
if the month is January
or the month is February or the month is December then the season is summer
Rule in non-RDF form:
ex : January (?month)-> ex : summer (?month). ex : February (?month)-> ex : summer (?month). ex : December (?month)-> ex : summer (?month).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:infer _:genid2].
_:genid1 rdf:type rul:Fact; rul:pred ex:January; rul:args [rdf:type rdf:List; rdf:first _:genid3; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Var; rdfs:label “?month”.
[analogicznie dla „February” i „December”]
Rule: 8
if the month is March or the month is April or the month is May then the season is autumn
Rule in non-RDF form:
ex : March (?month)-> ex : autumn (?month). ex : April (?month)-> ex : autumn (?month). ex : May (?month)-> ex : autumn (?month).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:infer _:genid2].
_:genid1 rdf:type rul:Fact; rul:pred ex:March; rul:args [rdf:type rdf:List; rdf:first _:genid3; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Var; rdfs:label “?month”.
[analogicznie dla „April” i „May”]
Rule: 9
if the month is June or the month is July or the month is August then the season is winter
Rule in non-RDF form:
ex : June (?month)-> ex : winter (?month). ex : July (?month)-> ex : winter (?month). ex : August (?month)-> ex : winter (?month).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:infer _:genid2].
_:genid1 rdf:type rul:Fact; rul:pred ex:June; rul:args [rdf:type rdf:List; rdf:first _:genid3; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Var; rdfs:label “?month”.
[analogicznie dla „July” i „August”]
Rule: 10
if the month is September or the month is October or the month is November then the season is spring
Rule in non-RDF form:
ex : September (?month)-> ex : spring (?month). ex : October (?month)-> ex : spring (?month). ex : November (?month)-> ex : spring (?month).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:infer _:genid2].
_:genid1 rdf:type rul:Fact; rul:pred ex:September; rul:args [rdf:type rdf:List; rdf:first _:genid3; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Var; rdfs:label “?month”.
[analogicznie dla „October” i „November”]
Rule: 11
if the season is spring and operation is 'during business hours' then thermostat_setting is '20 degrees'
Rule in non-RDF form:
ex : spring (?season)& ex : during_business_hours (?operation) -> ex : 20_degrees (?season, ?operation).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:from _:genid2; rul:infer _:genid3].
_:genid1 rdf:type rul:Fact; rul:pred ex: spring; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest rdf:nil].
_:genid2 rdf:type rul:Fact; rul:pred ex: during_business_hours; rul:args [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Fact; rul:pred ex: 20_degrees; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid4 rdf:type rul:Var; rdfs:label “?season”.
_:genid5 rdf:type rul:Var; rdfs:label “?operation”.
Rule: 12
if the season is spring
and operation is 'not during business hours' then thermostat_setting is '15 degrees'
Rule in non-RDF form:
ex : spring (?season)& ex : not_during_business_hours (?operation) -> ex : 15_degrees (?season, ?operation).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:from _:genid2; rul:infer _:genid3].
_:genid1 rdf:type rul:Fact; rul:pred ex: spring; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest rdf:nil].
_:genid2 rdf:type rul:Fact; rul:pred ex: not_during_business_hours; rul:args [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Fact; rul:pred ex: 15_degrees; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid4 rdf:type rul:Var; rdfs:label “?season”.
_:genid5 rdf:type rul:Var; rdfs:label “?operation”.
Rule: 13
if the season is summer and operation is 'during business hours' then thermostat_setting is '24 degrees'
Rule in non-RDF form:
ex : summer (?season)& ex : during_business_hours (?operation) -> ex : 24_degrees (?season, ?operation).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:from _:genid2; rul:infer _:genid3].
_:genid1 rdf:type rul:Fact; rul:pred ex: summer; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest rdf:nil].
_:genid2 rdf:type rul:Fact; rul:pred ex: during_business_hours; rul:args [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Fact; rul:pred ex: 24_degrees; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid4 rdf:type rul:Var; rdfs:label “?season”.
_:genid5 rdf:type rul:Var; rdfs:label “?operation”.
Rule: 14
if the season is summer
and operation is 'not during business hours' then thermostat_setting is '27 degrees'
Rule in non-RDF form:
ex : summer (?season)& ex : not_during_business_hours (?operation) -> ex : 27_degrees (?season, ?operation).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:from _:genid2; rul:infer _:genid3].
_:genid1 rdf:type rul:Fact; rul:pred ex: summer; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest rdf:nil].
_:genid2 rdf:type rul:Fact; rul:pred ex: not_during_business_hours; rul:args [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Fact; rul:pred ex: 27_degrees; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid4 rdf:type rul:Var; rdfs:label “?season”.
_:genid5 rdf:type rul:Var; rdfs:label “?operation”.
Rule: 15
if the season is autumn
and operation is 'during business hours' then thermostat_setting is '20 degrees'
Rule in non-RDF form:
ex : autumn (?season)& ex : during_business_hours (?operation) -> ex : 20_degrees (?season, ?operation).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:from _:genid2; rul:infer _:genid3].
_:genid1 rdf:type rul:Fact; rul:pred ex: autumn; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest rdf:nil].
_:genid2 rdf:type rul:Fact; rul:pred ex: during_business_hours; rul:args [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Fact; rul:pred ex: 20_degrees; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid4 rdf:type rul:Var; rdfs:label “?season”.
_:genid5 rdf:type rul:Var; rdfs:label “?operation”.
Rule: 16
if the season is autumn and operation is 'not during business hours' then thermostat_setting is '16 degrees'
Rule in non-RDF form:
ex : autumn (?season)& ex : not_during_business_hours (?operation) -> ex : 16_degrees (?season, ?operation).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:from _:genid2; rul:infer _:genid3].
_:genid1 rdf:type rul:Fact; rul:pred ex: autumn; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest rdf:nil].
_:genid2 rdf:type rul:Fact; rul:pred ex: not_during_business_hours; rul:args [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Fact; rul:pred ex: 16_degrees; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid4 rdf:type rul:Var; rdfs:label “?season”.
_:genid5 rdf:type rul:Var; rdfs:label “?operation”.
Rule: 17
if the season is winter and operation is 'during business hours' then thermostat_setting is '18 degrees'
Rule in non-RDF form:
ex : winter (?season)& ex : during_business_hours (?operation) -> ex : 18_degrees (?season, ?operation).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:from _:genid2; rul:infer _:genid3].
_:genid1 rdf:type rul:Fact; rul:pred ex: winter; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest rdf:nil].
_:genid2 rdf:type rul:Fact; rul:pred ex: during_business_hours; rul:args [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Fact; rul:pred ex: 18_degrees; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid4 rdf:type rul:Var; rdfs:label “?season”.
_:genid5 rdf:type rul:Var; rdfs:label “?operation”.
Rule: 18
if the season is winter and operation is 'not during business hours' then thermostat_setting is '14 degrees'
Rule in non-RDF form:
ex : winter (?season)& ex : not_during_business_hours (?operation) -> ex : 14_degrees (?season, ?operation).
Rule represented in RDF/N3
[rdf:type rul:Rule; rul:from _:genid1; rul:from _:genid2; rul:infer _:genid3].
_:genid1 rdf:type rul:Fact; rul:pred ex: winter; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest rdf:nil].
_:genid2 rdf:type rul:Fact; rul:pred ex: not_during_business_hours; rul:args [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid3 rdf:type rul:Fact; rul:pred ex: 14_degrees; rul:args [rdf:type rdf:List; rdf:first _:genid4; rdf:rest [rdf:type rdf:List; rdf:first _:genid5; rdf:rest rdf:nil].
_:genid4 rdf:type rul:Var; rdfs:label “?season”.
_:genid5 rdf:type rul:Var; rdfs:label “?operation”.