annotate service/reasoning/rules.n3 @ 199:7d897fe34306

some fuxi issue Ignore-this: a22564fc32a8528f937d714ee1cc4e84
author drewp@bigasterisk.com
date Sun, 04 Oct 2015 04:16:37 -0700
parents 71577a849628
children b0089d1ca4f6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
129
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
1 # rules only! statements in this file will not be considered in the graph
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
2
21
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
3 @prefix : <http://projects.bigasterisk.com/room/>.
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
4 @prefix bigast: <http://bigasterisk.com/>.
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
5 @prefix dev: <http://projects.bigasterisk.com/device/>.
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
6 @prefix foaf: <http://xmlns.com/foaf/0.1/> .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
7 @prefix env: <http://projects.bigasterisk.com/device/environment>.
54
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
8 @prefix math: <http://www.w3.org/2000/10/swap/math#> .
21
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
9
30
d858ccfd6649 another masked wifi address
drewp@bigasterisk.com
parents: 21
diff changeset
10 { <http://bigasterisk.com/wifiDevice/x> :connected bigast:wifiAccessPoints . } => { :auth :near :home } .
d858ccfd6649 another masked wifi address
drewp@bigasterisk.com
parents: 21
diff changeset
11 { <http://bigasterisk.com/wifiDevice/x> :connected bigast:wifiAccessPoints . } => { :auth :near :home } .
d858ccfd6649 another masked wifi address
drewp@bigasterisk.com
parents: 21
diff changeset
12 { <http://bigasterisk.com/wifiDevice/x> :connected bigast:wifiAccessPoints . } => { :playstation :powerState :on } .
21
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
13
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
14 { env: :localHour 8 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
15 { env: :localHour 9 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
16 { env: :localHour 10 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
17 { env: :localHour 11 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
18 { env: :localHour 12 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
19 { env: :localHour 13 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
20 { env: :localHour 14 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
21 { env: :localHour 15 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
22 { env: :localHour 16 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
23 { env: :localHour 17 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
24 { env: :localHour 18 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
25 { env: :localHour 19 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
26 { env: :localHour 20 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
27 { env: :localHour 21 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
28 { env: :localHour 22 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
29 { env: :localHour 23 } => { env: :localHour :awakeTime } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
30
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
31 {
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
32 :auth :near :home .
118
7179284779fd errors and logging in reasoning
drewp@bigasterisk.com
parents: 88
diff changeset
33 dev:theaterDoorOutsideMotion :state :sustainedMotion .
21
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
34 dev:theaterDoorOpen :state :closed .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
35 env: :localHour :awakeTime .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
36 } => { dev:theaterDoorLock :state :unlocked } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
37
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
38 { dev:frontDoorOpen :state :closed } => { dev:frontDoorOpenIndicator :text "_" } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
39 { dev:frontDoorOpen :state :open } => { dev:frontDoorOpenIndicator :text "D" } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
40
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
41 { dev:frontDoorMotion :state :noMotion } => {
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
42 dev:frontDoorMotionIndicator :text "_" .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
43 dev:frontDoorLcd :brightness 0 .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
44 } .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
45 { dev:frontDoorMotion :state :motion } => {
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
46 dev:frontDoorMotionIndicator :text "D" .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
47 dev:frontDoorLcd :brightness 255 .
425fb4a8ca5d reasoning rules moved from /my/proj/room
drewp@bigasterisk.com
parents:
diff changeset
48 } .
31
962320c056ca new rule to turn on bang/monitor
drewp@bigasterisk.com
parents: 30
diff changeset
49
54
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
50 { :darkKey :state :press } => {
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
51 <http://bigasterisk.com/host/dash/monitor> :powerState :off .
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
52 } .
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
53
88
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
54 { <http://projects.bigasterisk.com/room/star/button/blu> :change :down . } =>
67
b0f9eef8bb5d slideshow button rule
drewp@bigasterisk.com
parents: 54
diff changeset
55 {
b0f9eef8bb5d slideshow button rule
drewp@bigasterisk.com
parents: 54
diff changeset
56 <http://bigasterisk.com/host/star/slideshow> :postAction <http://bigasterisk.com/host/star/slideshow/advance> .
88
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
57 <http://bigasterisk.com/host/star/slideshow> :postAction <http://star:9049/effects/beep2> .
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
58 } .
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
59
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
60
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
61 { <http://projects.bigasterisk.com/room/star/button/yel> :change :down . } =>
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
62 {
129
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
63 <http://bigasterisk.com/host/star/slideshow> :postAction <http://bigasterisk.com/host/star/slideshow/toggleFeeder> .
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
64 <http://bigasterisk.com/host/star/slideshow> :postAction <http://star:9049/effects/beep1> .
88
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
65 } .
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
66
181
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
67 { <http://projects.bigasterisk.com/room/barcodeScan> <http://projects.bigasterisk.com/room/read> <http://projects.bigasterisk.com/room/barcode/UPC-A/4984343881945> } =>
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
68 {
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
69 <http://bigasterisk.com/host/star/slideshow> :postAction <http://star:9049/effects/troyandabed> .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
70 } .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
71
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
72 @prefix bed: <http://projects.bigasterisk.com/room/ariBed/> .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
73 { bed:button1 :change :down . } => {
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
74 <http://bigasterisk.com/host/star/slideshow> :postAction <http://brace:9055/starTrekLight/toggle> .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
75 <http://bigasterisk.com/host/star/slideshow> :postAction <http://brace:9049/effects/highlight> .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
76 } .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
77 { bed:button2 :change :down . } => { <http://bigasterisk.com/host/star/slideshow> :postAction <http://brace:9049/effects/troyandabed> . } .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
78 { bed:button3 :change :down . } => { <http://bigasterisk.com/host/star/slideshow> :postAction <http://brace:9049/effects/beep1> . } .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
79 { bed:button4 :change :down . } => { <http://bigasterisk.com/host/star/slideshow> :postAction <http://brace:9049/effects/beep1> . } .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
80 { bed:button5 :change :down . } => { <http://bigasterisk.com/host/star/slideshow> :postAction <http://brace:9049/effects/jazztrumpet> . } .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
81
129
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
82
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
83 # sound wasn't responding; waiting for other button fixes
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
84 # { <http://projects.bigasterisk.com/room/star/button/yel> :change :down . } =>
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
85 # {
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
86 # <http://bigasterisk.com/host/star/sound> :postAction <http://star:9049/sound?filename=/my/music/ubuntuone/Daft+Punk/Discovery/Harder+Better+Faster+Stronger.mp3> .
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
87 # } .
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
88
88
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
89 { <http://projects.bigasterisk.com/room/livingRoom/shuttlepro/dial> :change :up . } => {
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
90 <http://bigasterisk.com/host/slash/sound> :postAction <http://slash:9049/volume?offset=.05&max=.6> .
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
91 } .
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
92
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
93 { <http://projects.bigasterisk.com/room/livingRoom/shuttlepro/dial> :change :down . } => {
3988aaa5ea82 change cactus button to one that works. yellow button plays music
drewp@bigasterisk.com
parents: 67
diff changeset
94 <http://bigasterisk.com/host/slash/sound> :postAction <http://slash:9049/volume?offset=-.05&max=.6> .
67
b0f9eef8bb5d slideshow button rule
drewp@bigasterisk.com
parents: 54
diff changeset
95 } .
b0f9eef8bb5d slideshow button rule
drewp@bigasterisk.com
parents: 54
diff changeset
96
54
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
97 #{ :playstation :powerState ?s } => { <http://bigasterisk.com/host/bang/monitor> :powerState ?s } .
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
98
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
99 {
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
100 # this won't update right, currently, since I don't let the exact
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
101 # idle time into the rules recalculator. This threshold should be
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
102 # applied upstream.
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
103
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
104 <http://bigasterisk.com/host/dash/xidle> :idleTimeMinutes ?idle .
199
7d897fe34306 some fuxi issue
drewp@bigasterisk.com
parents: 181
diff changeset
105 # broken with new fuxi- needs review: ?idle math:lessThan 30 .
54
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
106 } => {
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
107 :drew :at :desk .
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
108 # the plan here is that as soon as we can show that I'm not at my
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
109 # desk (cell phone wifi, asleep, etc), power the screen off
42411726a7ca screen out more values that change on every update
drewp@bigasterisk.com
parents: 31
diff changeset
110 } .
129
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
111
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
112 @prefix shuttle: <http://bigasterisk.com/room/livingRoom/shuttlepro/> .
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
113 @prefix mpd: <http://bigasterisk.com/host/slash/mpd> .
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
114
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
115 { ?button :state :press . ?button :playsMusic ?song } => { mpd: :startMusic ?song } .
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
116 # the rest of this modeling is still a mess. Handled completely by special case in reasoning.py
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
117 { shuttle:button12 :state :press } => { mpd: :playState :pause } .
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
118 { shuttle:dial :change :clockwise } => { mpd: :audioState :volumeStepUp } .
745eff67ad40 reasoning actions: generalize them a bit but then add a bunch of special cases for mpd for now
drewp@bigasterisk.com
parents: 118
diff changeset
119 { shuttle:dial :change :counterclockwise } => { mpd: :audioState :volumeStepDown } .
181
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
120
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
121 { <http://bigasterisk.com/homeauto/sensor/motion0> :seesRecently <http://projects.bigasterisk.com/room/noMotion> . } => {
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
122 :storageCeilingLedCross :brightness "0" .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
123 :storageCeilingLedLong :brightness "0" .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
124 } .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
125
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
126 { <http://bigasterisk.com/homeauto/sensor/motion0> :seesRecently <http://projects.bigasterisk.com/room/motion> . } => {
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
127 :storageCeilingLedCross :brightness "1" .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
128 :storageCeilingLedLong :brightness "1" .
71577a849628 new reasoning config for storage motion.
drewp@bigasterisk.com
parents: 129
diff changeset
129 } .