Geranium is a system to empower the access to the Politecnico di Torino research activities (available within the IRIS portal) using semantic technologies and deep learning techniques applied on graphs.
The system consists of three main components:
- KG Generator: the goal of this component is to produce a KG from the JSON representation of IRIS data.
- Back-end: the goal of this component is to provide RESTful APIs to access data within the KG.
- Front-end: the goal of this component is to visualize and enable an interactive exploration of the results obtained from the back-end.
To generate the KG from the JSON representation of IRIS data, you can run the map.py
script.
The script offers many options, which can be reviewed by using the help option:
$ cd process
$ python map.py -h
The options for this script are the the following:
-b <json_file> : builds a rdf file starting from a provided json file
-o <output_file> : used to specify the output filename. If not specified, one including the timestamp is automatically provided
-n <number_of_topics> : used to specify the number of topics to extract with TellMeFirst from each abstract
-d : turn on debug messages
-f <file_format> : used to specify the file format (XML by default)
Install Python backend using conda environment
$ conda create -n geranium python=3.6
$ conda activate geranium
$ conda install requests
$ conda install -c conda-forge rdflib
$ conda install -c conda-forge uvicorn
$ conda install -c conda-forge fastapi
$ pip install config
$ pip install langdetect
While in the conda environment:
uvicorn main:app --reload --host 0.0.0.0 --port 5000
- type: publications
- topic: "Encoded label of topic"
- limit: "Number of lines"
- offset: "Offset within the response"
http://localhost:5000/api?type=publications&topic=Carbon%20nanotube&lines=10000&offset=0
- type: authors
- topic: "Encoded label of topic"
- limit: "Number of lines"
- offset: "Offset within the response"
http://localhost:5000/api?type=authors&topic=Carbon%20nanotube&lines=10000&offset=0
- type: publication
- limit: "Number of lines"
- offset: "Offset within the response"
- url: "Encoded url of a publication"
- type: author
- topic: "Encoded label of topic"
- limit: "Number of lines"
- offset: "Offset within the response"
- url: "Encoded url of a researcher"
- type: topics
- limit: "Number of lines"
- offset: "Offset within the response"
http://localhost:5000/api?type=topics&lines=100000&offset=0
- type: abstract
- topic: DBpedia URI of the topic
http://localhost:5000/api?type=abstract&topic=http://dbpedia.org/resource/2D_computer_graphics
The following commands are written for Debian 9.9, NodeJS v.12.6.0 and should be executed in sequence. Skip those unnecessary for your working environment, if needed.
$ sudo apt install nodejs
$ sudo npm install -g ionic
- Clone the repository
- Navigate to website folder
- Run
$ npm i
- Navigate to website folder
- Run
$ ionic serve
If compiling process is successful (Compiled successfully
in console) a browser window will be automatically opened at the address of the local server. If not try the following address in your browser: localhost:8100
.
To stop the development server press Ctrl-C.
- Docker and Docker Compose must be installed on your pc.
- Place your *.rdf file to: geranium/process/.
- Open your terminal application and go to the geranium/ folder.
- Next type 'docker-compose up -d'.
- Wait for the containers to be up and running.
- Open your web browser and go to http://localhost:9081
- Geranium home: http://localhost:9081
- Backend documentation: http://localhost:5000/api/docs
- Same backend endpoints listed above.
The online Docker version of the platform has been implemented by adding two reverse proxies (Apache).
<VirtualHost *:80>
ServerName geranium.nexacenter.org
Redirect permanent / https://geranium.nexacenter.org/
</VirtualHost>
<VirtualHost *:443>
ServerName geranium.nexacenter.org
ProxyPass / http://0.0.0.0:9081/
ProxyPassReverse / http://0.0.0.0:9081/
# ssl config following
</VirtualHost>
The website is reachable via the https://geranium.nexacenter.org/.
<VirtualHost *:80>
ServerName api.geranium.nexacenter.org
Redirect permanent / https://api.geranium.nexacenter.org/
</VirtualHost>
<VirtualHost *:443>
ServerName api.geranium.nexacenter.org
ProxyPass / http://0.0.0.0:9085/
ProxyPassReverse / http://0.0.0.0:9085/
# ssl config following
</VirtualHost>
The API is reachable via the https://api.geranium.nexacenter.org/ prefix.
-
Blazegraph is used as triplestore database and it is reachable only via the Docker Compose services.
-
The blazegraph-service starts immediatly. Instead the backend-service and the frontend-service start only if a .rdf file exists inside the process folder. If not an error message is displayed to the terminal application.
-
After a new .rdf file is inserted into the process folder, it is necessary to reload the backend-service and blazegraph-service containers.