-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDesign-AS.n3
More file actions
93 lines (78 loc) · 2.88 KB
/
Copy pathDesign-AS.n3
File metadata and controls
93 lines (78 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
@prefix as: <https://www.w3.org/ns/activitystreams#>.
# Announcement from openHAB actor
<#uuid> a as:Announce;
as:actor <openHAB>; # should be the webid of the actual actor
as:object <Bureau_rechts_Color> . # the items that are changed?
<Bureau_rechts_Color> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://saref.etsi.org/core/OffState> .
<Bureau_rechts_Color> <http://dbpedia.org/resource/Hue> 0 .
<Bureau_rechts_Color> <http://dbpedia.org/resource/Colorfulness> 0 .
<Bureau_rechts_Color> <http://dbpedia.org/resource/Brightness> 0 .
# Announcement from solid Actor
<#uuid> a as:Announce;
as:actor <solid>; # should be the webid of the actual actor
as:object <http://localhost:3000/state> . # state resource that has changed
<Bureau_rechts_Color> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://saref.etsi.org/core/OffState> .
<Bureau_rechts_Color> <http://dbpedia.org/resource/Hue> 0 .
<Bureau_rechts_Color> <http://dbpedia.org/resource/Colorfulness> 0 .
<Bureau_rechts_Color> <http://dbpedia.org/resource/Brightness> 0 .
# Rules in orchestration actor
## For openHAB actor
{
?id a as:Announce .
?id as:actor <openHAB>.
} =>
{
ex:MyDemoPolicy pol:policy [
a fno:Execution ;
fno:executes ex:hasStateChanged ; # function that checks whether internal state has changed. Creates an orchestrator announce request + updates state
ex:param1 <solid>; # Target actor?
ex:param2 "ResourceToKeepInSync"; # Resource that should be updated <http://localhost:3000/state>
ex:body ?id
] .
}
## For solid actor
{
?id a as:Announce .
?id as:actor <solid>.
} =>
{
ex:MyDemoPolicy pol:policy [
a fno:Execution ;
fno:executes ex:hasStateChanged ; # function that checks whether internal state has changed. Creates an orchestrator announce request + updates state
ex:param1 <openHAB>; # Target actor?
ex:param2 "openHABEndpoint"; # Endpoint that should be updated <http://localhost:8080>
ex:body ?id
] .
}
## For Orch actor
{
# Orchestrator announce request
?id a as:Announce .
?id as:actor <orchestrator>.
?id as:target <solid>. # Indicates The target actor to send the message to
?id as:to ?target. # https://www.w3.org/TR/activitystreams-vocabulary/#dfn-to | Indicates the target that the actor should sent the update to
} =>
{
ex:MyDemoPolicy pol:policy [
a fno:Execution ;
fno:executes ex:updateSolidState ;
ex:body ?id ;
ex:to ?target
] .
}.
{
# Orchestrator announce request
?id a as:Announce .
?id as:actor <orchestrator> .
?id as:target <openHAB>. # Indicates The target actor to send the message to
?id as:to ?target. # https://www.w3.org/TR/activitystreams-vocabulary/#dfn-to | Indicates the target that the actor should sent the update to
} =>
{
ex:MyDemoPolicy pol:policy [
a fno:Execution ;
fno:executes ex:updateOpenHABState ;
ex:body ?id ;
as:to ?target;
as:target <openHAB>
] .
}.