Summary • MinSKG • Usage • Examples • License
RDFtex is a framework that employs custom LaTeX commands and a preprocessor program to implement a bidirectional knowledge exchange with scientific knowledge graphs (SciKGs). To implement the said knowledge exchange, RDFtex provides two main functionalities:
- The import functionality allows to import research contributions from a specified SciKG in LaTeX documents via custom import commands.
- The export functionality allows to export original research contributions from LaTeX documents to a SciKG via custom export commands.
This repository contains the proof-of-concept implementation of RDFtex and other sources as proposed in our TPDL 2022 RDFtex paper and its extended version currently in preparation.
Currently, RDFtex can only interact with the MinSKG, a minimal SciKG that serves as a makeshift for an actual SciKG. The MinSKG is populated with all publications that are used as references for the RDFtex paper. The contextual information of the publications, i.e., the metadata, was added automatically by parsing their entries from the bibtex file using a simple script. The contentual information, i.e, their contributions, was added manually.
The MinSKG supports five types of contributions for importing and exporting. Each of them are represented using type-specific properties. The following list specifies the supported contributions and their properties (as IRIs):
- Definitions
https://example.org/scikg/terms/typehttps://example.org/scikg/terms/definition_content
- Datasets
https://example.org/scikg/terms/typehttps://example.org/scikg/terms/dataset_namehttps://example.org/scikg/terms/dataset_descriptionhttps://example.org/scikg/terms/dataset_domainhttps://example.org/scikg/terms/dataset_url
- Figures
https://example.org/scikg/terms/typehttps://example.org/scikg/terms/figure_descriptionhttps://example.org/scikg/terms/figure_urlhttps://example.org/scikg/terms/figure_mime
- Simple experimental results
https://example.org/scikg/terms/typehttps://example.org/scikg/terms/expresult_descriptionhttps://example.org/scikg/terms/expresult_resulthttps://example.org/scikg/terms/expresult_samplesize
- Software
https://example.org/scikg/terms/typehttps://example.org/scikg/terms/software_namehttps://example.org/scikg/terms/software_descriptionhttps://example.org/scikg/terms/software_url
The file minskg.ttl contains the MinSKG, as employed for the preparation of the research paper, serialized in the Turtle format.
RDFtex operates on .rdf.tex files that allow the usage of the custom RDFtex commands for importing and exporting contributions. To preprocess the .rdf.tex files of a LaTeX project files and produce a PDF based on the automatically generated .tex files, there are several options.
The recommended and easiest way to run RDFtex is to use Docker, which also ensures reproducibility. In this case, you only have to install:
- Docker
- Docker Compose
Out of the box, RDFtex is configured to run RDFtex on the exemplary .rdf.tex files in the example-basic folder. If you want to start a new LaTeX project that employs RDFtex, create a new folder in the tex folder and adjust the constants in the constants.py file accordingly.
If you want to run RDFtex on an existing LaTeX project, move your LaTeX project folder into the tex folder and adjust the constants in the constants.py file file accordingly. Then, create copies of each .tex file in the folder with the .rdf.tex file extension.
Running the software without Docker might cause problems depending on the host system. If you still want to execute the software without Docker you have to install:
- Python 3.11
- The Python dependencies listed in requirements.txt
- Latexmk
-
Run
docker compose run latexmkin a command line to start up alatexmkcontainer that listens for changes made to.texfiles. -
Run
docker compose run --service-ports minskgin another command line to the MinSKG server. -
Run
docker compose run rdftex-watchin another command line to start up a preprocessor container that listens for changes made to.rdf.texfiles.latexmkwill then detect the changes and thus recompile the PDF. -
Whenever you edit and save any
.rdf.texfile, the preprocessor first generate the.texfiles.latexmkwill then detect the changes and thus recompile the PDF.
-
Run
docker-compose run latexmkin a command line to start up alatexmkcontainer that listens for changes made to.texfiles. -
Run
docker compose run --service-ports minskgin another command line to the MinSKG server. -
Run
docker-compose run rdftexin another command line to start up a container for the preprocessor and attach to its command line. -
Whenever you edit any
.rdf.texfile and save, runpython3 preprocessor.pyin the container command line to trigger the preprocessor and generate the.texfiles.
-
Run
latexmk -pvc -pdf -xelatex -cd /tex/example.texin a command line to listen for changes made to.texfiles. -
Open another command line and navigate to the src folder.
-
Whenever you edit any
.rdf.texfile and save, runpython3 preprocessor.pyin the new command line to trigger the preprocessor and generate the.texfiles.
⚠ Attention ⚠: Rerunning the benchmarks might overwrite the plots in the benchmark-results folder.
To run the benchmark used in the paper to assess the runtime of the preprocessing on the LaTeX project specified in the constants.py file, run python3 benchmark.py runtime or python3 benchmark.py response_times after steps 1 and 2 of the semi-automatic build process. The plots showing the benchmark results, can be found in the benchmark-results folder.
The contribution entities used to assess the query response times of the MinSKG SPARQL interface and the ORKG SPARQL interface can be found in the benchmark.py file.
The tex folder contains two example projects that employ RDFtex:
- example-basic: A project with one import and export for each supported contribution type, which totals five imports and five exports.
- example-many: A derivation of the example-basic project, where each import and export is included 20 times, resulting in 100 imports and 100 exports. Use this project only for benchmarking.
The examples use the LNCS LaTeX template to showcase RDFtex's compatibility with typical LaTeX publication templates.
The exports RDF document resulting from the preprocessing of the TPDL 2022 RDFtex paper can be found here.
The exports RDF document resulting from the preprocessing of the extended RDFtex paper currently in preparation can be found at here.
See LICENSE