REST Interface for HORUS.AI Platform - Tutorial Highlights
This tutorial delves into creating profiles and users using the ProfileManager service in the HORUS.AI platform. It covers steps like creating new profiles, adding users to profiles, and setting rules. The focus is on providing a REST interface for seamless interaction with the HORUS.AI system. The tutorial is an informative guide presented at the 19th International Semantic Web Conference, showcasing practical applications in health and wellbeing.
Uploaded on Oct 05, 2024 | 0 Views
Download Presentation
Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
E N D
Presentation Transcript
Part 4 HORUS.AI APIs Mauro Dragoniand Ivan Donadello Fondazione Bruno Kessler Process and Data Intelligence Research Unit Health and Wellbeing High Impact Initiative SEMEX4ALL TUTORIAL 19thInternational Semantic Web Conference Anywhere, World November 02th, 2020
main goal To provide a REST interface for interacting with the HORUS.AI platform and for exploiting the results of the reasoning process. page 02
ProfileManager create a new profile { "serviceRequestName":"ProfileManager", "serviceRequestData":{ "mode": "newprofile", "userId": "", "username": "", "gender": "", "height": -1, "weight": -1, "age": 0, "profiles": [{ "profileId": "TEST-PROFILE", "startDate": 1586736000000 }] } } page 03
ProfileManager create a new user { "serviceRequestName":"ProfileManager", "serviceRequestData":{ "mode": "newuser", "userId": "Mauro", "username": "Mauro", "gender": "M", "height": 178, "weight": 78, "age": 347963400000, "profiles": [] } } page 04
ProfileManager add a user to a profile { "serviceRequestName":"ProfileManager", "serviceRequestData":{ "mode": "addgoal", "userId": "Mauro", "username": "Mauro", "gender": "M", "height": -1, "weight": -1, "age": -1, "profiles": [{ "profileId": "TEST-PROFILE", "startDate": 1586736000000 }] } } page 05
RuleManager create a new rule { "serviceRequestName":"RuleManager", "serviceRequestData":{ "mode": "newrule", "priority" : 1, "ruleId": "MR-ACTIVITY-003-GDAY", "command": "contains", "operator": "greater", "timing": "Day", "monitoredEntity": "AlcoholicBeverages", "monitoredEntityType": "Food", "monitoredValue": 10, "profiles": [{ "profileId": "TEST-PROFILE1", "startDate": 1586736000000 }, { "profileId": "TEST-PROFILE2", "startDate": 1586736000000 }] } } page 06
RuleManager create a new rule { "serviceRequestName":"RuleManager", "serviceRequestData":{ "mode": "newrule", "priority" : 1, "ruleId": "MR-ACTIVITY-003-GDAY", "command": "contains", "operator": "greater", "timing": "Day", "monitoredEntity": "AlcoholicBeverages", "monitoredEntityType": "Food", "monitoredValue": 10, "profiles": [{ "profileId": "TEST-PROFILE1", "startDate": 1586736000000 }, { "profileId": "TEST-PROFILE2", "startDate": 1586736000000 }] } contains notcontains hascalories portion requirement } page 07
RuleManager create a new rule { "serviceRequestName":"RuleManager", "serviceRequestData":{ "mode": "newrule", "priority" : 1, "ruleId": "MR-ACTIVITY-003-GDAY", "command": "contains", "operator": "greater", "timing": "Day", "monitoredEntity": "AlcoholicBeverages", "monitoredEntityType": "Food", "monitoredValue": 10, "profiles": [{ "profileId": "TEST-PROFILE1", "startDate": 1586736000000 }, { "profileId": "TEST-PROFILE2", "startDate": 1586736000000 }] } greater less equal percentage } page 08
RuleManager create a new rule { "serviceRequestName":"RuleManager", "serviceRequestData":{ "mode": "newrule", "priority" : 1, "ruleId": "MR-ACTIVITY-003-GDAY", "command": "contains", "operator": "greater", "timing": "Day", "monitoredEntity": "AlcoholicBeverages", "monitoredEntityType": "Food", "monitoredValue": 10, "profiles": [{ "profileId": "TEST-PROFILE1", "startDate": 1586736000000 }, { "profileId": "TEST-PROFILE2", "startDate": 1586736000000 }] } Meal Day Week } page 09
RuleManager create a new rule { "serviceRequestName":"RuleManager", "serviceRequestData":{ "mode": "newrule", "priority" : 1, "ruleId": "MR-ACTIVITY-003-GDAY", "command": "contains", "operator": "greater", "timing": "Day", "monitoredEntity": "AlcoholicBeverages", "monitoredEntityType": "Food", "monitoredValue": 10, "profiles": [{ "profileId": "TEST-PROFILE1", "startDate": 1586736000000 }, { "profileId": "TEST-PROFILE2", "startDate": 1586736000000 }] } List of the food categories provided. } page 010
RuleManager remove a rule from a profile { "serviceRequestName":"RuleManager", "serviceRequestData":{ "mode": "removerule", "ruleId": "MR-ACTIVITY-003-GDAY", "profiles": [{ "profileId": "TEST-PROFILE1", "startDate": 1586736000000 }] } } page 011
MealManager save food intake information related to a specific user { "serviceRequestName":"MealManager", "serviceRequestData":{ "userId": "Mauro", "mode": "save", "timestamp": 1587744000000, "meals": [ { "mealId": "meal-1587744000001", "foods": [{"foodId": "FOOD-1145", "foodQuantity": 80}], "mealType": "Snack", "timestamp": 1587744000001 }, { "mealId": "meal-1587744000002", "foods": [{"foodId": "FOOD-1145", "foodQuantity": 80}], "mealType": "Snack", "timestamp": 1587744000002 }] } } page 012
ViolationManager { "violationId": "violation_1123", "user": "test-user", "rule": "MR-DIET-011-NDAY", "ruleId": "MR-DIET-011-NDAY", "timestamp": "1552462081810", "startTime": "1552462081810", "endTime": "1552492081810", "entityType": "FOODCATEGORY", "entity": "Vegetables", "timing": "Day" "quantity": "0" "expectedQuantity": "2" "meals": [ "MEAL-meal-1", "MEAL-meal-2" ], "goals": [], "goalsConstraints": [], "priority": "1", "level": "-4", "constraint": "greater", "history": "1", "feedback": "Today you didn't consume enough vegetables (0 of minimum 2).", "argument": "Did you know that vegetables contain dietary fiber helping to control glycemia?", "suggestion": "Next time be more careful and remember to eat healthy!" } page 013
our contacts Mauro Dragoni dragoni@fbk.eu Ivan Donadello donadello@fbk.eu page 014