Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Equipment Booking System #1446

Open
wants to merge 45 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
45450c4
dev-1620-extend-other-ontologies-for-asset-ontology: Add new device
Michael-TeguhLaksana Jul 17, 2023
40e3b7b
dev-1620-extend-other-ontologies-for-asset-ontology:Update conteont of
Michael-TeguhLaksana Jul 18, 2023
77b4110
dev-1620-extend-other-ontologies-for-asset-ontology: Updated restriction
Michael-TeguhLaksana Jul 18, 2023
a648dcc
dev-1620-extend-other-ontologies-for-asset-ontology : Updated ontology
Michael-TeguhLaksana Jul 18, 2023
3e2635c
dev-1620-extend-other-ontologies-for-asset-ontology: Create
Michael-TeguhLaksana Jul 18, 2023
4f10835
dev-1620-extend-other-ontologies-for-asset-ontology: Added new classes
Michael-TeguhLaksana Jul 19, 2023
c5e9e44
dev-1620-extend-other-ontologies-for-asset-ontology: Add extra classes
Michael-TeguhLaksana Jul 19, 2023
def1d2f
dev-1620-extend-other-ontologies-for-asset-ontology: Extended ontodevice
Michael-TeguhLaksana Aug 3, 2023
3a3b9fa
dev-1620-extend-other-ontologies-for-asset-ontology: Add new classes to
Michael-TeguhLaksana Aug 4, 2023
e367ca6
dev-1620-extend-other-ontologies-for-asset-ontology: Update new classes
Michael-TeguhLaksana Aug 4, 2023
66bbb0d
dev-1620-extend-other-ontologies-for-asset-ontology: Created
Michael-TeguhLaksana Aug 4, 2023
a77066f
dev-1620-extend-other-ontologies-for-asset-ontology: Created ontosystem
Michael-TeguhLaksana Aug 4, 2023
f9938c3
dev-1620-extend-other-ontologies-for-asset-ontology: Added property to
Michael-TeguhLaksana Aug 7, 2023
ab23bf7
dev-1620-extend-other-ontologies-for-asset-ontology: Remove xml and t…
Abyssus1010 Dec 4, 2023
405ad0f
dev-1620-extend-other-ontologies-for-asset-ontology: Update ontodevic…
Abyssus1010 Dec 4, 2023
bfc02d7
dev-1620-extend-other-ontologies-for-asset-ontology: Revert ontodevic…
Abyssus1010 Dec 4, 2023
308a432
Merge branch 'main' into dev-1620-extend-other-ontologies-for-asset-o…
Abyssus1010 Dec 4, 2023
3cc3c3c
dev-1620-extend-other-ontologies-for-asset-ontology: Add in initial e…
Abyssus1010 Dec 4, 2023
ef9a637
dev-1620-extend-other-ontologies-for-asset-ontology: Fix typo
Michael-TeguhLaksana Dec 5, 2023
1f86c2b
dev-1620-extend-other-ontologies-for-asset-ontology: Added label
Michael-TeguhLaksana Dec 5, 2023
bf4a5fd
dev-1620-extend-other-ontologies-for-asset-ontology: Fix excel autofi…
Michael-TeguhLaksana Dec 5, 2023
0634c90
dev-1620-extend-other-ontologies-for-asset-ontology: Update ontodevice
Michael-TeguhLaksana Dec 5, 2023
bac7766
dev-1620-extend-other-ontologies-for-asset-ontology: Modify hierarchy
Michael-TeguhLaksana Dec 8, 2023
810fcff
Added concepts related to equipment booking to ontoassetmanagement TBox
Feb 26, 2024
ccc79fb
Initial commit of EquipmentBookingAgent based on RxnOptGoalAgent temp…
simonrihm Mar 5, 2024
6632b8e
Added methods to create sparql queries to get/modify/create/delete bo…
simonrihm Mar 6, 2024
cab30d2
Added all relevant files to install v0.0.1 of equipmentbookingagent p…
simonrihm Mar 7, 2024
690b246
Make Equipment-BookingSystem a 1-1 relationship, add some additional …
simonrihm Mar 7, 2024
e3312b8
Added a script that can instantiate a bookingsystem for specified equ…
simonrihm Mar 7, 2024
83c331c
Redid ontology changes via CSV file and TBoxGenerator.
simonrihm Mar 13, 2024
cae5315
Added utility script to create a booking system and add to existing e…
simonrihm Mar 14, 2024
0adc282
Implemented booking functionality via KG interactions and a response …
simonrihm Apr 3, 2024
3f010cb
Added utility script to combine multiple equipment to a TechnicalSyst…
simonrihm Apr 5, 2024
7ee6128
Display additional information when selecting specific equipment
simonrihm Apr 7, 2024
5cc263c
Created timetable overview page of all bookings on a specified day.
simonrihm Apr 8, 2024
2d4288b
Add interactive selection of date for overview and navigation via but…
simonrihm Apr 8, 2024
01ba360
Added an additional view listing all bookings of a piece of equipment…
simonrihm Apr 9, 2024
5368202
Use booking system label instead of equipment label to display as nam…
simonrihm Apr 23, 2024
cc66362
Only show lab users in booking UI
simonrihm Apr 24, 2024
a14e187
Clean up utility script to create new booking systems
simonrihm Jun 4, 2024
2e99ac7
Added functionality to add new lab users via GUI. Bumped version numb…
simonrihm Jan 15, 2025
fb65dbe
Added README
simonrihm Jan 15, 2025
49105f3
Roll back all ontology changes inherited from dev-1620 which was even…
simonrihm Jan 16, 2025
9440629
Merged main as rebase was not feasible due to abandoned feature branc…
simonrihm Jan 16, 2025
c9744d2
Added TWA branding to UI pages
simonrihm Jan 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions Agents/EquipmentBookingAgent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Equipment Booking Agent
The Equipment Booking Agent is a standalone application for booking equipment through a browser-based UI. This will require bookable assets as well as eligible persons to be instantiated and annotated with booking intervals.

## Instructions

### Installation
Add individual configuration parameters to conf/equipment_booking_agent_conf.py:
- SPARQL_QUERY_ENDPOINT: URL address of available SPARQL endpoint where assets and users are instantiated
- SPARQL_UPDATE_ENDPOINT: URL address of available SPARQL endpoint where bookings will be instantiated
- KG_USERNAME: if required, credentials to access the SPARQL endpoint
- KG_PASSWORD: if required, credentials to access the SPARQL endpoint

This agent can be built via pip install. Running entry_point.py spins up the agent on http://localhost:5000, waiting for the debugger to attach. To attach to the container and start debugging, please use the provided Python: Debug Flask within Docker debug configuration.


### Usage
Go to 'Book Equipment', select user, select equipment, and booking interval. If equipment is not available at the selected interval, you will be informed.
Go to 'Overview' for a daily list of all booked assets in 15 minute increments.
Go to 'Edit bookings' for a list of all active bookings for a certain equipment where they can be deleted.
Go to 'Add user' to add a new lab user that can make bookings.

The 'Back' button on each page brings you back to the main menu.


## Data model
**Legend**
Prefix | Namespace
--- | ---
[bot](https://w3c-lbd-cg.github.io/bot/) | `https://w3id.org/bot#`
[fibo](https://github.com/edmcouncil/fibo/tree/master/FND/AgentsAndPeople) | `https://spec.edmcouncil.org/fibo/ontology/FND/AgentsAndPeople/People/`
[ontoam](https://github.com/cambridge-cares/TheWorldAvatar/tree/main/JPS_Ontology/ontology/ontoassetmanagement) | `https://www.theworldavatar.com/kg/ontoassetmanagement/`
[ontobim](https://github.com/cambridge-cares/TheWorldAvatar/tree/main/JPS_Ontology/ontology/ontobim) | `https://www.theworldavatar.com/kg/ontobim/`
[ontodevice](https://github.com/cambridge-cares/TheWorldAvatar/tree/main/JPS_Ontology/ontology/ontodevice) | `https://www.theworldavatar.com/kg/ontodevice/`
[ontolab](https://github.com/cambridge-cares/TheWorldAvatar/tree/main/JPS_Ontology/ontology/ontolab) | `https://www.theworldavatar.com/kg/ontolab/`
[ontotechsystem](https://github.com/cambridge-cares/TheWorldAvatar/tree/main/JPS_Ontology/ontology/ontotechnicalsystem) | `https://www.theworldavatar.com/kg/ontotechnicalsystem/`
[ontotimeseries](https://github.com/cambridge-cares/TheWorldAvatar/tree/main/JPS_Ontology/ontology/ontotimeseries) | `https://www.theworldavatar.com/kg/ontotimeseries/`
[time](https://www.w3.org/TR/owl-time/) | `http://www.w3.org/2006/time#`


### Requirements
A bookable asset is required to which a booking system can be attached to. These can be of type ontodevice:Device, ontotechsystem:TechnicalSystem, or bot:Element. One example is shown in *Figure 1*. In the utils folder, utility scripts are available to add a booking system to an asset or combine existing devices to a system so they can be booked together.

*Figure 1. Bookable asset example ABox*
```mermaid
erDiagram
"RoomRepresentation_Instance" {rdf-type ontobim-IfcRoomRepresentation}
"RoomRepresentation_Instance" {rdfs-label High_Pressure_Catalysis_Facility}
"Room_Instance" ||--o{ "RoomRepresentation_Instance" : "bim:hasIfcRepresentation"
"Room_Instance" {rdf-type ontobim-Room}
"Room_Instance" ||--o{ "Asset_Instance" : "bot:containsElement"
"Asset_Instance" {rdfs-label Vigor_Glove_Box_Sg1200}
"Asset_Instance" {rdf-type ontodevice-Device}
"Asset_Instance" {rdf-type ontolab-GloveBox}
"Person_Instance" {rdf-type fibo-Person}
"Asset_Instance" ||--o{ "Person_Instance" : "oam:assignedTo"
"Asset_Instance" ||--o{ "BookingSystem_Instance" : "oam:hasBookingSystem"
"BookingSystem_Instance" {rdf-type oam-BookingSystem}
"BookingSystem_Instance" {rdfs-label GloveBox_Lab1}
"Person_Instance" ||--o{ "PersonName_Instance" : "omg:hasName"
"PersonName_Instance" {rdf-type fibo-PersonName}
"PersonName_Instance" {fibo-FirstName Max}
"PersonName_Instance" {fibo-LastName Mustermann}
"PersonName_Instance" {rdfs-label Max_Mustermann}
```

An eligible lab user is required to carry out the booking of an asset. These are of type fibo:Person and have been assigned the role of lab user. One example of a lab user is shown in *Figure 2*, additional lab users can be added via the user interface.

*Figure 2. Eligible user example ABox*
```mermaid
erDiagram
"Person_Instance" ||--o{ "PersonName_Instance" : "omg:hasName"
"PersonName_Instance" {rdf-type fibo-PersonName}
"PersonName_Instance" {rdfs-label Erika_Musterfrau}
"Person_Instance" ||--o{ "Role_Instance" : "omg:playsRole"
"Role_Instance" {rdf-type omg-FunctionalRole}
"Role_Instance" {rdfs-label Lab_User}
```

### Operating principle
Adding a booking to the system attaches a new booking instance to the booking system instance of the asset in question. This will look similar to the example in *Figure 3*.

*Figure 3. Booking example ABox*
```mermaid
erDiagram
"Asset_Instance" ||--o{ "BookingSystem_Instance" : "oam:hasBookingSystem"
"BookingSystem_Instance" {rdf-type oam-BookingSystem}
"BookingSystem_Instance" {rdfs-label GloveBox_Lab1}
"Booking_Instance" {rdf-type oam-Booking}
"BookingSystem_Instance" ||--o{ "Booking_Instance" : "oam:hasBooking"
"Booking_Instance" ||--o{ "Person_Instance" : "oam:hasBooker"
"Person_Instance" {rdf-type fibo-Person}
"BookingPeriod_Instance" {rdf-type oam-BookingPeriod}
"Booking_Instance" ||--o{ "BookingPeriod_Instance" : "oam:hasBookingPeriod"
"BookingPeriod_Instance" ||--o{ "PeriodBeginning_Instance" : "time:hasBeginning"
"BookingPeriod_Instance" ||--o{ "PeriodEnd_Instance" : "time:hasEnd"
"PeriodBeginning_Instance" {rdf-type time-Instant}
"PeriodEnd_Instance" {rdf-type time-Instant}
"TimePosition1_Instance" {rdf-type time-TimePosition}
"TimePosition1_Instance" {time-numericPosition _1708344000}
"TimePosition1_Instance" {time-hasTRS Unix_time}
"TimePosition2_Instance" {rdf-type time-TimePosition}
"TimePosition2_Instance" {time-numericPosition _1708545600}
"TimePosition2_Instance" {time-hasTRS Unix_time}
"PeriodBeginning_Instance" ||--o{ "TimePosition1_Instance" : "time:numericPosition"
"PeriodEnd_Instance" ||--o{ "TimePosition2_Instance" : "time:numericPosition"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .entry_point import create_app
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .equipment_booking_agent import EquipmentBookingAgent
Loading