-
Notifications
You must be signed in to change notification settings - Fork 5
/
irrigator.asl
33 lines (22 loc) · 1.25 KB
/
irrigator.asl
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
// irrigator_agent
// Add your graph repo location below
repo_location("https://sandbox-graphdb.interactions.ics.unisg.ch/repositories/was-exercise-3-danai").
!start.
+!start : repo_location(KGRepo) <-
.print("Hello world");
!setup_artifacts(KGRepo).
+!setup_artifacts(KGRepo) : true <-
makeArtifact("farmKG2", "farm.FarmKG", [KGRepo], FarmKGId);
queryFarm(Farm);
+farm(Farm);
.print("Queried farm to manage: ", Farm);
queryThing(Farm, "https://was-course.interactions.ics.unisg.ch/farm-ontology#IrrigateAffordance", ThingDescription);
.print("Queried td:Thing for irrigating: ", ThingDescription);
makeArtifact("tractor2", "org.hyperagents.jacamo.artifacts.wot.ThingArtifact", [ThingDescription], TractorId).
+low_moisture(Coordinates)[source(Agent)] : true <-
.print(Agent, " claims low moisture in: ", Coordinates);
!irrigate(Coordinates).
+!irrigate(Coordinates) : low_moisture(Coordinates)[source(Agent)] <-
.print("Irrigating ", Coordinates);
invokeAction("https://was-course.interactions.ics.unisg.ch/farm-ontology#IrrigateAffordance", ["https://www.w3.org/2019/wot/json-schema#ArraySchema"], Coordinates)[artifact_id(TractorId)];
-low_moisture(Coordinates)[source(Agent)].