ckanext-fedorkg
is a CKAN plugin that adds support to query open research knowledge graphs via SPARQL queries.
FedORKG uses DeTrusty as federated query engine.
The visual query editor connecting the frontend and DeTrusty is implemented using the JavaScript library YASGUI.
Note
This feature is experimental.
Powered by the LLM o1-mini
, FedORKG is able to answer natural language questions over the federation by relying on the LLM to translate the question into a SPARQL query.
Check steps 3 and 4 in the post-install setup on how to configure this feature.
Path variables used below:
$CKAN_STORAGE_PATH
(i.e., where CKAN stores files), e.g.,/var/lib/ckan
$CKAN_INI
(i.e., the CKAN configuration file), e.g.,/etc/ckan/default/ckan.ini
As usual for CKAN extensions, you can install ckanext-fedorkg
as follows:
git clone [email protected]:SDM-TIB/ckanext-fedorkg.git
pip install -e ./ckanext-fedorkg
pip install -r ./ckanext-fedorkg/requirements.txt
- Copy your file for the source descriptions of DeTrusty to the following location:
$CKAN_STORAGE_PATH/fedorkg/rdfmts.ttl
- Add
fedorkg
to the list of plugins in your$CKAN_INI
:ckan.plugins = ... fedorkg
[!NOTE] If you have
ckanext-scheming
installed, you have to mentionfedorkg
before the scheming extension in your$CKAN_INI
. Otherwise the scheming extension overrides the changes of the FedORKG plugin. - Copy your file containing the instructions to be included in the prompt to the following location:
$CKAN_STORAGE_PATH/fedorkg/prompt.txt
- Provide your OpenAI API code in an environment variable called
OPENAI_API_KEY
. - Make sure that the CKAN background job workers are running. Without them, the federation management features of FedORKG, i.e., adding and deleting knowledge graphs, will not work.
- Initialize the database table for the FedORKG federation management news:
ckan -c $CKAN_INI fedorkg initdb
- Start the FedORKG source description SPARQL endpoint the background:
ckan -c $CKAN_INI fedorkg start &> $CKAN_STORAGE_PATH/fedorkg/fedorkg-metadata.log &
ckanext.fedorkg.query
the default query shown to the users- Default: SELECT DISTINCT ?c WHERE { ?s a ?c }
ckanext.fedorkg.query.name
a human-readable name for the default query- Default: Covered Concepts
ckanext.fedorkg.timeout
query execution timeout in seconds- Default: 60
ckanext-fedorkg
offers the following commands, assuming $CKAN_INI
is the path of your CKAN configuration file:
initdb
: initializes the database table for the federation management news.ckan -c $CKAN_INI fedorkg initdb
start
: starts the SPARQL endpoint serving the source description required for query decomposition and query planning.ckan -c $CKAN_INI fedorkg start
version
: shows the current version ofckanext-fedorkg
and DeTrusty.ckan -c $CKAN_INI fedorkg version
If you are interested in what has changed, check out the changelog.
ckanext-fedorkg
is licensed under GPL-3.0, see the license file.
The translations can be managed with the Makefile
.
However, CKAN and its dependencies must be installed in the same environment for the commands to work.
- Philipp D. Rohde, Enrique Iglesias, Maria-Esther Vidal: FedORKG: Accessing Federations of Open Research Knowledge Graphs. In: 1. NFDI4Energy Conference. DOI 10.5281/zenodo.10591442