Skip to content

Commit 5e9c088

Browse files
authored
Update README.md
1 parent 1b404d0 commit 5e9c088

1 file changed

Lines changed: 23 additions & 63 deletions

File tree

README.md

Lines changed: 23 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ HERMES REST API is a Spring Boot service that exposes the server-side capabiliti
44

55
## About the repository
66

7-
The repository is described on GitHub as **"HERMES AI Server Component"**. The codebase is written in Java, and the main Maven module is `hai`, a Spring Boot application that depends on Spring Web, Spring Data MongoDB, Apache Jena, and PLATINUm. The application entry point is `HaiRestApi`, which also declares the REST endpoints documented below. citeturn158797view0turn713210view0turn803605view0
7+
The repository is described on GitHub as **"HERMES AI Server Component"**. The codebase is written in Java, and the main Maven module is `hai`, a Spring Boot application that depends on Spring Web, Spring Data MongoDB, Apache Jena, and PLATINUm. The application entry point is `HaiRestApi`, which also declares the REST endpoints documented below.
88

99
## Repository structure
1010

@@ -24,15 +24,15 @@ HERMES_REST_API/
2424
└── target/
2525
```
2626

27-
This layout is based on the public repository tree, which shows the root placeholder `README.md`, the `hai/` Maven module, top-level `resources/`, and test-related folders. Inside `hai/src/main/resources`, the project includes `application.properties`, several RDF/OWL knowledge files, and a `platinum` resource directory. citeturn158797view0turn872002view0turn103635view0turn141464view0
27+
This layout is based on the public repository tree, which shows the root placeholder `README.md`, the `hai/` Maven module, top-level `resources/`, and test-related folders. Inside `hai/src/main/resources`, the project includes `application.properties`, several RDF/OWL knowledge files, and a `platinum` resource directory.
2828

2929
## Features
3030

31-
- REST endpoints for browsing HERMES knowledge topics and cultural entities. citeturn803605view0
32-
- Planning endpoint for generating personalized trips from selected topics and a requested duration. citeturn803605view0turn196169view0
33-
- Endpoint for posting a new cultural entity and attaching a topic-tagged textual description to the knowledge graph. citeturn803605view0turn196169view1
34-
- MongoDB-backed storage for incoming trip requests, generated POIs, planned trips, and posted entity requests. citeturn803605view0turn196169view0turn196169view1turn242977view0turn242977view1
35-
- Knowledge-graph support built on Apache Jena, with a configurable default RDF model loaded at startup or on first use. citeturn713210view0turn803605view0turn803605view1
31+
- REST endpoints for browsing HERMES knowledge topics and cultural entities.
32+
- Planning endpoint for generating personalized trips from selected topics and a requested duration.
33+
- Endpoint for posting a new cultural entity and attaching a topic-tagged textual description to the knowledge graph.
34+
- MongoDB-backed storage for incoming trip requests, generated POIs, planned trips, and posted entity requests.
35+
- Knowledge-graph support built on Apache Jena, with a configurable default RDF model loaded at startup or on first use.
3636

3737
## Tech stack
3838

@@ -42,7 +42,7 @@ This layout is based on the public repository tree, which shows the root placeho
4242
- Spring Data MongoDB
4343
- Apache Jena 5.0.0
4444
- PLATINUm 2.3.0
45-
- Maven Wrapper (`mvnw`) in the `hai/` module citeturn713210view0turn872002view0
45+
- Maven Wrapper (`mvnw`) in the `hai/` module
4646

4747
## Requirements
4848

@@ -58,7 +58,7 @@ The default application configuration expects:
5858
- `knowledge.model.path=${HOME}/HERMES_AI/resources/hermes_20240509.rdf`
5959
- `spring.data.mongodb.uri=mongodb+srv://${MONGO_CLOUD_USER}:${MONGO_CLOUD_PASS}@cluster0.zjmi0.mongodb.net/hermes_ai`
6060
- `spring.data.mongodb.database=hermes_ai`
61-
- `planner.platinum.home=${HOME}/HERMES_AI/resources/platinum` citeturn803605view1
61+
- `planner.platinum.home=${HOME}/HERMES_AI/resources/platinum`
6262

6363
## Getting started
6464

@@ -77,7 +77,7 @@ At minimum, check:
7777

7878
- the RDF knowledge model path
7979
- the MongoDB URI and database name
80-
- the PLATINUm home path citeturn803605view1
80+
- the PLATINUm home path
8181

8282
### 3. Build the application
8383

@@ -105,11 +105,11 @@ or
105105
java -jar target/hai-0.0.1-SNAPSHOT.jar
106106
```
107107

108-
The main class is `it.cnr.istc.hermes.hai.HaiRestApi`. citeturn713210view0turn803605view0
108+
The main class is `it.cnr.istc.hermes.hai.HaiRestApi`.
109109

110110
## API overview
111111

112-
The application exposes REST endpoints directly from `HaiRestApi`. The home endpoint is `/`, and the controller also registers a generic `/error` handler. Several knowledge endpoints are declared as `GET` methods but still accept a JSON request body containing a `uri` field. That is unusual for many HTTP clients, so in practice you may prefer to test them with tools such as cURL or Postman that allow bodies on `GET` requests. citeturn803605view0turn196169view2
112+
The application exposes REST endpoints directly from `HaiRestApi`. The home endpoint is `/`, and the controller also registers a generic `/error` handler. Several knowledge endpoints are declared as `GET` methods but still accept a JSON request body containing a `uri` field. That is unusual for many HTTP clients, so in practice you may prefer to test them with tools such as cURL or Postman that allow bodies on `GET` requests.
113113

114114
### Base endpoint
115115

@@ -131,14 +131,14 @@ Example response:
131131
OPS! Invalid or missing request parameters!
132132
```
133133

134-
Both endpoints are declared in `HaiRestApi`. citeturn803605view0
134+
Both endpoints are declared in `HaiRestApi`.
135135

136136
## Endpoint reference
137137

138138
### Knowledge endpoints
139139

140140
#### `GET /knowledge/topics`
141-
Returns a taxonomy of available trip topics. The result is a map where each parent topic is associated with its child topics. Topics are built from RDF resources and labels in the knowledge graph. citeturn803605view0turn196169view3
141+
Returns a taxonomy of available trip topics. The result is a map where each parent topic is associated with its child topics. Topics are built from RDF resources and labels in the knowledge graph.
142142

143143
Example response shape:
144144

@@ -152,7 +152,7 @@ Example response shape:
152152
```
153153

154154
#### `GET /knowledge/entities`
155-
Returns all cultural entities belonging to the `CulturalProperty` class, including both tangible and intangible entities. citeturn803605view0turn242977view2
155+
Returns all cultural entities belonging to the `CulturalProperty` class, including both tangible and intangible entities.
156156

157157
Example response shape:
158158

@@ -179,7 +179,7 @@ Request body:
179179
}
180180
```
181181

182-
The request uses the `KnowledgeQuery` model, which contains a required `uri` field. citeturn803605view0turn196169view2
182+
The request uses the `KnowledgeQuery` model, which contains a required `uri` field.
183183

184184
#### `GET /knowledge/descriptions`
185185
Returns the contextual descriptions associated with a specific cultural entity.
@@ -192,7 +192,7 @@ Request body:
192192
}
193193
```
194194

195-
The endpoint resolves the URI in the knowledge graph, extracts the cultural entity, and then fetches all of its descriptions. citeturn803605view0
195+
The endpoint resolves the URI in the knowledge graph, extracts the cultural entity, and then fetches all of its descriptions.
196196

197197
#### `GET /knowledge/entity/data`
198198
Returns detailed data for a specific cultural entity.
@@ -205,7 +205,7 @@ Request body:
205205
}
206206
```
207207

208-
For tangible entities, the returned object can include fields such as visiting time, open hours, coordinates, accessibility flags, price, group visit support, and address. citeturn803605view0turn242977view3
208+
For tangible entities, the returned object can include fields such as visiting time, open hours, coordinates, accessibility flags, price, group visit support, and address.
209209

210210
### Planning endpoint
211211

@@ -216,7 +216,7 @@ Generates a personalized trip from a user request. The server:
216216
2. finds cultural entities related to the requested topics,
217217
3. builds POIs around relevant tangible entities,
218218
4. invokes the PLATINUm-based planner when the total visit time exceeds the requested duration,
219-
5. returns a `PlannedTrip` object. citeturn803605view0turn196169view0turn242977view0turn242977view1
219+
5. returns a `PlannedTrip` object.
220220

221221
Request body example:
222222

@@ -244,7 +244,7 @@ Relevant `TripRequest` fields inferred from the model:
244244
- `userLocation` - optional `float[]`
245245
- `groupSize` - optional
246246
- `dVector` - optional `boolean[]`
247-
- `mVector` - optional `boolean[]` citeturn196169view0
247+
- `mVector` - optional `boolean[]`
248248

249249
Response highlights:
250250

@@ -254,12 +254,12 @@ Response highlights:
254254
- `hops` - ordered list of POIs
255255
- `request` - the originating trip request
256256
- `ranking`
257-
- `counter` citeturn242977view0
257+
- `counter`
258258

259259
### Knowledge update endpoint
260260

261261
#### `POST /knowledge/entity`
262-
Creates a new knowledge-graph resource for a cultural entity and links it to a generated description tagged with one or more topics. The request is also persisted in MongoDB, and the endpoint returns the URI of the created node. citeturn803605view0turn196169view1
262+
Creates a new knowledge-graph resource for a cultural entity and links it to a generated description tagged with one or more topics. The request is also persisted in MongoDB, and the endpoint returns the URI of the created node.
263263

264264
Request body example:
265265

@@ -289,51 +289,11 @@ Relevant `PostEntityRequest` fields inferred from the model:
289289
- `location` - optional `float[]`
290290
- `groupSize` - optional
291291
- `dVector` - optional `boolean[]`
292-
- `mVector` - optional `boolean[]` citeturn196169view1turn803605view0
292+
- `mVector` - optional `boolean[]`
293293

294294
Response example:
295295

296296
```text
297297
http://example.org/resource/GeneratedEntity123
298298
```
299299

300-
### Service data endpoints
301-
302-
#### `GET /service/trips`
303-
Returns all planned trips stored in MongoDB. citeturn803605view0turn242977view0
304-
305-
#### `GET /service/pois`
306-
Returns all generated POIs stored in MongoDB. A POI contains a tangible cultural entity, a set of relevant descriptions, linked entities, ranking data, and usage counters. citeturn803605view0turn242977view1
307-
308-
## Data model summary
309-
310-
### `Topic`
311-
A lightweight object with:
312-
313-
- `id`: knowledge-base URI
314-
- `label`: human-readable topic label citeturn196169view3
315-
316-
### `KnowledgeQuery`
317-
A simple request model used by knowledge lookup endpoints:
318-
319-
- `uri`: required resource identifier citeturn196169view2
320-
321-
### `TripRequest`
322-
Represents the input used to generate a trip. Required fields are `userId`, `duration`, and a non-empty `topics` list. citeturn196169view0
323-
324-
### `PlannedTrip`
325-
Stores a generated itinerary, including requested duration, ordered POI hops, the original request, ranking, and a usage counter. citeturn242977view0
326-
327-
### `Poi`
328-
Represents a generated point of interest built around a tangible cultural entity, enriched with topic-relevant descriptions and linked entities. citeturn242977view1
329-
330-
## Notes and caveats
331-
332-
- The repository root `README.md` is currently just `# HERMES REST API TODO`, so replacing it with this file would immediately improve repository documentation. citeturn884965view0
333-
- The `src` entry at repository root is a symbolic link to `hai/src/main/java`. citeturn512769view0
334-
- Several read endpoints use `GET` together with a request body. Some clients, proxies, and API gateways do not handle GET bodies consistently, so this is worth documenting for users or revisiting in a future API revision. citeturn803605view0turn196169view2
335-
- The controller contains a `TODO` comment indicating that entity creation is not yet complete with all expected data properties. citeturn803605view0
336-
337-
## License
338-
339-
No license file was visible in the repository pages I inspected, so this README intentionally does not declare one. Add a license section once a repository license is published. citeturn158797view0

0 commit comments

Comments
 (0)