Skip to content

Latest commit

 

History

History
86 lines (54 loc) · 4.43 KB

README.md

File metadata and controls

86 lines (54 loc) · 4.43 KB

PKG API: A Tool for Personal Knowledge Graph Management

Code style: black Coverage Badge Python version

The PKG API is a tool for managing personal knowledge graphs (PKGs). It provides a simple solution for end users and service providers to administrate and interact with the users' PKGs through natural language statements and simple web forms. The representation of a statement inside the PKG is defined by the PKG vocabulary. Within the API, two key modules are present: one for processing natural language statements (NL2PKG), and another for generating and executing SPARQL queries against the PKG (PKG connector).

The PKG API is served as a RESTful API and we provide a user interface, PKG Client, that allows users to manage their PKG online.

Overview

PKG API

NL2PKG

This module is responsible for processing natural language statements. The processing is divided into two steps: (1) natural language understanding handled by annotators and (2) entity_linking.

Available annotators and entity linkers:

PKG connector

The PKG connector is responsible for executing SPARQL queries against the PKG. Utilities functions are responsible for generating SPARQL queries based on the intent of the user. For example, if a user wants to add a statement to the PKG, a tailored INSERT query is generated.

Server

The backend server is a Flask server. It is responsible for connecting the users and service providers to PKGs.

Starting the server

Before starting the server, make sure that the requirements are installed and that CORS is disabled in your web browser.

To start the server, run the following command:

flask --app pkg_api/server run --debug

Note the --debug flag is optional, but it is recommended to use it during development.

By default, the server will run locally on port 5000. In case you want to run the server on a different port, you can specify the port using the --port flag.

PKG Client

The user interface is a React application that communicates with the server to manage the PKG. More details on how to run PKG Client can be found here.

⚠️ Note that you need to update PKG_API_BASE_URL in the configuration in case the server is not running on the default port.

Demo

PKG_API_demo.mov

The code for the demo is available in this branch.

Conventions

We follow the IAI Python Style Guide.

Publication

If you use the PKG API, please cite the following paper:

@inproceedings{Bernard:2024:WWW,
  author = {Bernard, Nolwenn and Kostric, Ivica and \L{}ajewska, Weronika and Balog, Krisztian and Galus\v{c}\'{a}kov\'{a}, Petra and Setty, Vinay and Skj\ae{}veland, Martin G.},
  title = {{PKG API}: {A} Tool for Personal Knowledge Graph Management},
  booktitle = {Companion Proceedings of the ACM on Web Conference 2024},
  pages = {1051--1054},
  series = {WWW '24},
  year = {2024},
  doi = {10.1145/3589335.3651247},
}

Contributors

PKG API is developed and maintained by the IAI group at the University of Stavanger.