This commit is contained in:
2021-12-16 11:42:27 +01:00
parent 27ccc54458
commit 6c17b20c55
60 changed files with 947 additions and 216 deletions

View File

@@ -33,7 +33,7 @@ public class InstructionToRobotAdapter implements InstructionToRobotPort {
String endpoint = "https://api.interactions.ics.unisg.ch/search/searchEngine";
String input = "@prefix dct: <http://purl.org/dc/terms/> . select ?title where { ?title dct:title 'Mirogate' }";
String input = "@prefix dct: <http://purl.org/dc/terms/> . select ?title where { ?title dct:title 'leubot1' }";
var httpRequest = HttpRequest.newBuilder()
.uri(URI.create(endpoint))

View File

@@ -45,8 +45,10 @@ public class UserToRobotAdapter implements UserToRobotPort {
try {
var description = client.send(httpRequest, HttpResponse.BodyHandlers.ofString()).body();
String uri = "http://yggdrasil.interactions.ics.unisg.ch/environments/61/workspaces/102/artifacts/leubot1";
// Parse a TD from a string
ThingDescription td = TDGraphReader.readFromString(ThingDescription.TDFormat.RDF_TURTLE, description);
ThingDescription td = TDGraphReader.readFromURL(ThingDescription.TDFormat.RDF_TURTLE, uri);
// Create the payload to be sent with the HTTP request
Map<String, Object> logInPayload = new HashMap<>();