Skip to content

Commit 36a32c5

Browse files
committed
updated README.md
1 parent 8894044 commit 36a32c5

File tree

1 file changed

+51
-71
lines changed

1 file changed

+51
-71
lines changed

README.md

Lines changed: 51 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,97 @@
11
# MApp-KG (Old Knowledge Graph Repository)
22

3-
The *MApp-KG* is developed as a Java-based Spring Boot service using the RDF4J framework to build the hook with a GraphDB repository instance.
3+
MApp-KG is a Java-based Spring Boot service that utilizes the RDF4J framework to interact with a **GraphDB repository instance**.
44

5-
## Description
5+
## 📌 Description
66

7-
This software component provides an API for querying, updating, and extracting knowledge from a graph database.
7+
This component provides a **REST API** for querying, updating, and extracting knowledge from a graph database.
88

9-
## Used Technologies
9+
## 🛠️ Used Technologies
1010

1111
| Component | Description | Version |
1212
|-------------|---------------------------------------------------------------------------------------|---------|
13-
| Spring Boot | Collection of Java libraries for creating REST APIs | 2.7.1 |
14-
| RDF4J | Java library for manipulating RDF graphs | 3.0.0 |
15-
| GraphDB | GraphDB is an enterprise-ready Semantic Graph Database, compliant with W3C Standards. | 10.1.0 |
13+
| **Spring Boot** | Java framework for creating REST APIs | 2.7.1 |
14+
| **RDF4J** | Java library for manipulating RDF graphs | 3.0.0 |
15+
| **GraphDB** | Enterprise-ready **Semantic Graph Database**, compliant with W3C standards | 10.1.0 |
1616

17-
## How to Configure
17+
## ⚙️ Configuration
1818

19-
Configure the GraphDB connection by setting the proper values for `db.url`, `db.username`, and `db.password` in `src/main/resources/application.properties` and `src/main/resources/application-gessi.properties` (if you use docker) or and `src/main/resources/application-localhost.properties` (if you use localhost).
19+
To configure the **GraphDB connection**, set the appropriate values for:
2020

21-
Configure the RML file path by setting the proper value for `rml.path` to use a custom RML file for schema integration.
21+
- `db.url`
22+
- `db.username`
23+
- `db.password`
2224

23-
## How to Build
25+
These values should be updated in the respective properties files:
2426

25-
To build the project, run the following command:
27+
- **Docker deployment**: `src/main/resources/application-gessi.properties`
28+
- **Localhost deployment**: `src/main/resources/application-localhost.properties`
29+
30+
To set a custom **RML file path**, configure `rml.path` accordingly.
31+
32+
---
33+
34+
## 🚀 How to Build
35+
36+
To build the project, run:
2637

2738
```sh
2839
mvn clean install package
2940
```
3041

31-
## How to Use
42+
## ▶️ How to Run
3243

33-
To run the service using Java from the generated package (`.jar`), run the following command:
44+
### **Run using Java**
3445

3546
```sh
3647
java -jar target/repo-0.0.1-SNAPSHOT.jar
3748
```
3849

39-
To deploy the service in a Docker container, follow these steps:
50+
### **Deploy using Docker**
4051

41-
### Build Docker Image
52+
#### **Step 1: Build Docker Image**
4253
```sh
43-
docker build -t kg_repository .
54+
docker build -t mapp-kg .
4455
```
4556

46-
### Run Docker Container
57+
#### **Step 2: Run Docker Container**
4758
```sh
48-
docker run -d -p 3003:3003 --name KG_Repository kg_repository
59+
docker run -d -p 3003:3003 --name MApp-KG \
60+
-e DB_USERNAME=my_db_user \
61+
-e DB_PASSWORD=my_db_password \
62+
-e REPO_NAME=my_repo_name \
63+
mapp-kg
4964
```
5065

51-
## How to Deploy (New Method)
66+
---
67+
68+
## 🌍 How to Deploy (New Method)
5269

53-
### Step 1: Pull Image
70+
### **Step 1: Pull Image from Repository**
5471
```sh
5572
docker pull mtiessler/kg_repository:latest
5673
```
5774

58-
### Step 2: Build Image (if needed)
75+
### **Step 2: Build Image (if needed)**
5976
```sh
6077
docker build -t mtiessler/kg_repository:latest .
6178
```
6279

63-
### Step 3: Create `kg_repository.env` File
64-
This file contains the credentials required to access the SPARQL database.
65-
The `.env` file must be in the same directory where the commands are executed.
80+
### **Step 3: Create `.env` File**
81+
82+
Create a file named `kg_repository.env` in the same directory where you execute the Docker commands. This file should contain:
6683

6784
```
6885
DB_USERNAME=username
6986
DB_PASSWORD=password
7087
```
7188

72-
## Features
73-
74-
The API of the MAPP-KG is available in the [Postman Collection](https://www.postman.com/gessi-fib-upc/gessi-nlp4se/collection/ak3s503/mapp-kg-old-app-repo?action=share&source=copy-link&creator=32448387)
75-
76-
### Main Data Import Methods:
77-
- **Add Mobile Apps (JSON format)**: Store a list of mobile apps using a JSON Array of mobile apps as the body of the HTTP request. See the Swagger documentation for the schema.
78-
- **Add Mobile Apps (RDF format)**: Store all triples within a given RDF file.
79-
- **Add Mobile Apps (RML-based)**: Store all mobile apps extracted from a JSON file using a given RML mapping instance.
80-
81-
### Inductive Knowledge Generation:
82-
- **Extract Features**: Send a `POST` request to `/derivedNLFeatures` with textual data (descriptions, summaries, changelogs, and/or reviews) to extract potential app features.
83-
- **Query parameters:**
84-
- `documentType`: Type of document to be processed (DESCRIPTION, SUMMARY, CHANGELOG, REVIEWS, USER_ANNOTATED, ALL).
85-
- `batch-size`: Number of documents processed at once.
86-
- `from`: Offset to start processing from the nth document.
87-
- (Optional) `maxSubj`: Subjectivity threshold (reviews above this won't be processed).
88-
- **Feature Similarity Matching**: Send a `POST` request to `/computeFeatureSimilarity` to find and match synonyms between app features.
89-
- Accepts a `threshold` parameter (between 0 and 1, default is 0.5).
90-
- **Undo Feature Synonymy**: Send a `DELETE` request to `/deleteFeatureSimilarities` to undo feature synonymy computed with `/computeFeatureSimilarity`.
91-
92-
## File Structure
93-
94-
- `src/main/java/upc/edu/gessi/repo`
95-
- **AppGraphRepoApplication.java**: Main class.
96-
- **Controller Package**: Handles HTTP requests.
97-
- `GraphDBController.java`: Logic for storing and retrieving data from the GraphDB repository.
98-
- `InductiveKnowledgeController.java`: Auxiliary repository handling extended knowledge generation.
99-
- **Domain Package**: Contains domain-specific entities.
100-
- **Service Package**: Business logic and database interaction.
101-
- `GraphDBService.java`: Main service containing methods for querying and updating the database.
102-
- `NLFeatureService.java`: Auxiliary service that communicates with a remote NL service for feature extraction.
103-
- **Utils Package**: Auxiliary functions.
104-
105-
## RDF Graph Example
106-
107-
You can find an RDF graph instance already populated with app info in [statements.zip](https://github.com/gessi-chatbots/app_data_repository/tree/master/data).
108-
109-
The data was originally obtained using the [App Data Scanner Service](https://github.com/gessi-chatbots/app_data_scanner_service).
110-
111-
App info includes:
112-
- Package name
113-
- Description
114-
- Summary
115-
- Changelog
116-
- Reviews
117-
- Annotated features
89+
---
90+
91+
## 🔗 API Documentation
92+
93+
The API of MApp-KG is available in the **Postman Collection**:
94+
[Postman Collection - MApp-KG](https://www.postman.com/gessi-fib-upc/gessi-nlp4se/collection/ak3s503/mapp-kg-old-app-repo?action=share&source=copy-link&creator=32448387)
95+
96+
---
97+

0 commit comments

Comments
 (0)