This repository contains a partial implementation of a JaCaMo application, in which autonomous agents are able to operate on Linked Data in a distributed social network — and to manage personal data of a user.
├── src
│ ├── agt
│ │ ├── movie_manager.asl // agent program of the agent that stores in your pod the titles of movies you add to your watchlist
│ │ ├── wristband_manager.asl // agent program of the agent that stores in your pod information about your sleep and running trails
│ │ └── personal_assistant.asl // agent program of the agent that recommends to you activities based on your personal data
│ └── env
│ └── solid
│ └── Pod.java // artifact that can be used for interacting with an LDP container in a Solid pod
└── task.jcm // the configuration file of the JaCaMo application
- Use PodPro to navigate and edit the Access Control List (ACL) of your Solid pod (https://wiser-solid-xi.interactions.ics.unisg.ch/your-pod-name/.acl). Update the
<#public>
authorization rule based on the Web Access Control vocabulary so that agents can interact with your pod to read and/or write data:
@prefix acl: <http://www.w3.org/ns/auth/acl#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
<#public>
a acl:Authorization;
acl:agentClass foaf:Agent;
acl:accessTo <./>;
acl:mode acl:Read, acl:Write, acl:Control;
acl:default <./>.
First, update line 24 in the JaCaMo configuration file task.jcm, so that the project uses your own Solid pod:
artifact pod: solid.Pod("https://wiser-solid-xi.interactions.ics.unisg.ch/your-pod-name")
Second, complete the tasks that follow to enable autonomous agents to interact with our group's Solid Community Server that implements the Solid protocol, based on the W3C Linked Data Platform (LDP) specification. The API of our group’s Solid Community Server is documented here.
With the completion of the tasks you should expect the following project behavior: The personal assistant (personal_assistant.asl) creates an LDP container in your pod, named "personal-data", and informs the other agents that a new container is available. As a result, the movie manager (movie_manager.asl) stores in the container the titles of movies you add to your watchlist (e.g. Matrix, Inseption etc.) within a file watchlist.txt. The wristband manager (wristband_manager.asl) stores in the container information about the number of hours you sleep every night (e.g. 6h, 7h, 5h etc. every 4000ms) within a file sleep.txt. Additionally, the wristband manager stores in the container information about the distance of the running trails that you follow every time you train (e.g. 3km, 5.5km, 5.5km etc. every 4000s) within a file trails.txt. Every 10000ms, the personal assistant reads the data available in the "personal-data" container to make movie or running trail suggestions based on the number of hours you slept last night.
Implement the method createContainer()
of the Java class Pod
that enables agents to to create an LDP container in your pod.
Implement the method publishData()
of the Java class Pod
that enables agents to publish data (text/plain) to an LDP container in your pod.
Implement the method readData()
of the Java class Pod
that enables agents to read data (text/plain) from an LDP container in your pod.
You can run the project directly in Visual Studio Code or from the command line with Gradle 7.4.
- In VSCode: Click on the Gradle Side Bar elephant icon, and navigate through
GRADLE PROJECTS
>exercise-4
>Tasks
>jacamo
>task
. - On MacOS and Linux run the following command:
./gradlew task
- On Windows run the following command:
gradle.bat task