<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">KGCW2024 Challenge Report: RDFProcessingToolkit</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Claus</forename><surname>Stadler</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Institute for Applied Informatics (InfAI)</orgName>
								<address>
									<settlement>Leipzig</settlement>
								</address>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Simon</forename><surname>Bin</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Institute for Applied Informatics (InfAI)</orgName>
								<address>
									<settlement>Leipzig</settlement>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">KGCW2024 Challenge Report: RDFProcessingToolkit</title>
					</analytic>
					<monogr>
						<idno type="ISSN">1613-0073</idno>
					</monogr>
					<idno type="MD5">DFC9EB8EC108158206BD70F7538B8896</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2025-04-23T18:22+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<textClass>
				<keywords>
					<term>RML</term>
					<term>SPARQL</term>
					<term>RDF</term>
					<term>Knowledge Graph</term>
					<term>Big data</term>
					<term>Semantic Query Optimization</term>
					<term>Apache Spark</term>
					<term>Challenge</term>
				</keywords>
			</textClass>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>This is the report of the participation of the RDFProcessingToolkit (RPT) in the KGCW2024 Challenge at ESWC 2024. The RPT system processes RML specifications by translating them into a series of extended SPARQL CONSTRUCT queries. The necessary SPARQL extensions are provided as plugins for the Apache Jena framework. This year's challenge comprises a performance and a conformance track. For the performance track, a homogeneous environment was kindly provided by the workshop organizers in order to facilitate comparability of measurements. In this track, we mainly adapted the setup from our last year's participation. For the conformance track, we updated our system with support for the rml-core module of the upcoming RML revision. We also report on the issues and shortcomings we encountered as a base for future improvements.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">Introduction</head><p>This is the report of the participation of the RDFProcessingToolkit 1 (RPT) in the KGCW2024 Challenge. <ref type="bibr" target="#b1">2</ref> RPT is a command line toolkit that features several sub-commands for SPARQLbased processing of RDF data. RPT builds upon the Apache Jena Semantic Web framework <ref type="bibr" target="#b2">3</ref> and thus leverages its SPARQL engines and SPARQL extension systems. RPT supports the translation of an RML document to a set of extended SPARQL queries which can be subsequently executed on an appropriate engine. The most essential SPARQL extension is a special SERVICE clause which is used to specify how to load a data source as a sequence of SPARQL bindings. The SPARQL extensions that are necessary to execute RML in SPARQL are all registered with Jena's plugin system. The extensions can also be added as a standalone module to any Jena-based project. <ref type="bibr" target="#b3">4</ref> Our own special purpose SPARQL engine is based on the Sansa framework. <ref type="bibr">5</ref> This engine leverages Apache Spark 6 in order to parallelize the following two types of operations: Ingestion of CSV and JSON source data and execution of SPARQL algebra operations, such as JOIN and DISTINCT. The Sansa engine is not a general purpose SPARQL engine. By leveraging Spark's map-reduce processing model, it is best used for extract-transform-load (ETL) workloads, which includes RML mapping execution. RPT/Sansa [1] refers to the use of RPT with the Sansa engine.</p><p>The challenge was divided into an Performance and an Conformance part. The challenge description and output files were published on Zenodo [2]. The remainder of this report is structured as follows: In Section 2 we report on our setup for the participation in the performance challenge. In Section 3 we provide insights into how we added support for the core module of the upcoming revised RML specification. We conclude this report in Section 4.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Performance Track</head><p>In this section, we report on our setup and results for the performance track. Overall, since our last year's participation [3], there were no major updates to our system that targeted performance. However, we had a series of bug fixes and maintenance upgrades, the most significant one being the upgrade of the code base to Jena 5.</p><p>The tasks of the performance challenge were also the same as last year's. One notable addition was that the RML mapping files were also provided in the upcoming RML revision. However, we did not evaluate against those because we completed our work on the conformance part only after the performance evaluations.</p><p>A significant improvement over last year's organization was that uniform hardware (virtual machines) was kindly provided to all participants by the challenge organizers. This allowed evaluation of all participating systems on a similar hardware, so that the results are expected to be much more comparable than the year before. The specifications reported by the VM were: 4 virtual cores (Intel(R) Xeon(R) Gold 6161 CPU), 136GB VMware virtual disk, 16 GiB RAM.</p><p>The benchmark tool's implementation differed from last year's and we forked it in order to deal with the following issues:</p><p>• We needed to add support to allow for the configuration of the working directory of the docker container running our RPT tool. • We needed to make it possible to pass Java options to our docker container, especially for setting the maximum heap memory (-Xmx). • The benchmark tool failed to extract system information on SUSE Linux systems.</p><p>At the time of writing, the changes are tracked in our fork<ref type="foot" target="#foot_0">7</ref> and there is an open pull request to the benchmark tool. <ref type="bibr">8</ref> We employed the same two workarounds as last year: Instead of reading tabular data from an SQL database, we ingest the corresponding CSV files directly. Due to the lack of parallel ingestion of XML data in RPT/Sansa, we adjusted the affected task pipelines by adding an extra XML-to-JSON conversion step (which is counted towards the total time) and by manually changing the XPath expressions in the RML files to corresponding JSONPath ones. With this workaround, we could leverage RPT/Sansa's parallel data ingestion and produce estimated measures despite the lack of proper XML support. The performance results for RPT/Sansa are consistent with those from last year, albeit the execution times were generally higher due to the weaker hardware. The hardware specs from the year before were: 32 threads (AMD Ryzen 9 5950X 16-Core CPU), 4TB SSD, 128 GiB RAM (60GiB assigned to the JVM). Figure <ref type="figure" target="#fig_1">1</ref> shows a juxtaposition of this year's results for the GTFS-Madrid-Bench [4] with those of last year. The complete recent as well as past measurements for RPT/Sansa can be found in our in our evaluation results repository. <ref type="bibr">9</ref> Also, we incorrectly allocated only 5 GB of heap memory to our Java process, although 16 GB of RAM would have been available. However, it also shows that our system effectively leverages Apache Spark in order to run with limited resources. A noteworthy finding is related to the GTFS-Madrid-bench: The amount of RAM and disk space were insufficient to process the GTFS1000 task without compression. To get around this problem, we experimented with two approaches: (1) a hard disk volume compressed with lzo and (2) using Spark's built-in bzip2 compression. The following commands were used:</p><p># Commands to create and mount a compressed filesystem image fallocate -l 60G ./filesystem.btrfs mkfs.btrfs ./filesystem.btrfs mount -o loop,compress=lzo ./filesystem.btrfs /compressed-fs # Spark's built-in compression enabled via system properties JAVA_OPTS="-Dspark.hadoop.mapred.output.compress=true \ -Dspark.hadoop.mapred.output.compression.codec=org.apache.hadoop.io.compress.BZip2Codec" \ rpt sansa query converted-rml.rq --out-file data.nt.bz2</p><p>The file system compression setup turned out to be significantly faster: 4 178s vs 10 368s. The shorter duration was obtained by running Spark with a 5 GB JVM heap memory limit, whereas the longer one was obtained with a limit of 14 GB which means that more RAM was available when the compression was done in the JVM. The main reason for the better performance of file system level compression is most likely that lzo is designed to sacrifice compression ratio for speed and is thus generally faster than bzip2. 10 Also, we'd expect the implementation of a compression algorithm in the file system driver to be faster than in Java (even with JIT compilation). However, a more in-depth evaluation, such as by configuring Apache Spark with an lzo codec, is future work.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Conformance Track</head><p>The challenge of the conformance track is to establish conformance with the upcoming revised RML specification. 11 At the point of writing, the revision did not have a final official name, so we refer to it as RML2 in the following.  Some of the major changes introduced by RML2 are as follows:</p><p>• RML2 is now a model on its own and no longer an extension of R2RML. As a consequence, most ontology elements now reside in the namespace http://w3id.org/rml/. • The specification is now modular, with the modules for (a) the core (RML-Core), (b) sources and targets (RML-IO), (c) containers and collections (RML-CC), (d) RDF-Star generation (RML-Star), and (e) functions (RML-FNML). A logical views module is being worked on.</p><p>In this work, we only attempted to establish conformance with RML-Core. In order to add support for RML2, we needed to decide whether to rewrite our engine from scratch or whether to generalize the interfaces and classes used to capture the RML model. We decided to take the latter approach. An excerpt of the revised class hierarchy is shown in Figure <ref type="figure" target="#fig_2">2</ref>. We integrated the conformance test suite as unit tests using JUnit<ref type="foot" target="#foot_3">12</ref> and Testcontainers. <ref type="bibr">13</ref> One issue we encountered was that the benchmark tool would download version 0.9.0 of the conformance test suite rather than v1.0.0, which caused issues in running the PostgreSQL tests. As a remedy, we downloaded the version 1.0.0 manually. This also has been fixed in the meantime. Furthermore, we were not able to generate the results.zip for the test cases with the benchmark tool because it would terminate abnormally. The reason has yet to be investigated. Of the 238 test cases of rml-core, we were able to establish conformance in 236 cases. The failing tests cases were 9a-mysql and 9b-mysql. These test cases include a join between an int and varchar column. RPT first maps the MySQL types of the columns to xsd:int and xsd:string respectively, before executing the join in SPARQL. Since these types are incompatible in SPARQL, the join fails. While the test case is arguably not ideal, the solution to mitigate the issue in the future is to push the join to the database. Interestingly, the corresponding PostgreSQL test cases have the column types fixed because PostgreSQL refuses to execute such joins.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Conclusions and Future Work</head><p>A significant improvement in this year's performance setup was that the participants could evaluate their systems on a homogeneous environment. Although the benchmark tool is capable of collecting measurements for various performance metrics, it still lacks the functionality to generate summary reports. The performance results showed that our tool is robust under limited resources and in the course of our evaluation it turned out that lzo compression on the file system level clearly outperformed Spark's built-in bzip2 support. As future work we aim to add proper support for parallel ingestion of XML data. We will analyze to which extent the remaining RML2 modules can be translated to SPARQL elements. For example, while support for RML-FNML should be fairly easy to add, support for RML-IO will require an extra RDF vocabulary for describing how to transfer the results of SPARQL queries to specified destinations.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head></head><label></label><figDesc>KGCW'24: 5th International Workshop on Knowledge Graph Construction, May 27, 2024, Crete, GREcstadler@informatik.uni-leipzig.de (C. Stadler); sbin@informatik.uni-leipzig.de (S. Bin) 0000-0001-9948-6458 (C.Stadler)  </figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>Figure 1 :</head><label>1</label><figDesc>Figure 1: Comparison of results for RPT/Sansa between KGCW 2023 (left) and 2024 (right) for different scales of the GTFS-Madrid-Bench. The thick bars show the total run times of mapping task executions (the segments correspond to the different steps in the process), whereas the slim bars above and below indicate the relative byte size of the input and output data. The I symbol marks the peak RAM usage.</figDesc><graphic coords="3,89.29,84.19,416.71,124.53" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Figure 2 :</head><label>2</label><figDesc>Figure 2: UML showing an excerpt of how R2RML, RML1 and RML2 are aligned in our system.</figDesc></figure>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="7" xml:id="foot_0">https://github.com/AKSW/kg-construct-challenge-tool/tree/code-on-new</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="8" xml:id="foot_1">https://github.com/kg-construct/challenge-tool/pull/4</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="9" xml:id="foot_2">https://github.com/AKSW/RdfProcessingToolkit-Resources/tree/main/2024-05-27-KGCW-at-ESWC</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="12" xml:id="foot_3">https://junit.org</note>
			<note xmlns="http://www.tei-c.org/ns/1.0" place="foot" n="13" xml:id="foot_4">https://testcontainers.com/</note>
		</body>
		<back>

			<div type="acknowledgement">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Acknowledgments</head><p>The authors acknowledge the financial support by the German Federal Ministry for Economic Affairs and Climate Action in the project Coypu (project number 01MK21007A) and by the German Federal Ministry for Digital and Transport in the Project Moby Dex (project number 19F2266A).</p></div>
			</div>


			<div type="funding">
<div xmlns="http://www.tei-c.org/ns/1.0"><p>10 https://linuxaria.com/article/linux-compressors-comparison-on-centos-6-5-x86-64-lzo-vs-lz4-vs-gzip-vs-bzip2-vs-lzma 11 https://kg-construct.github.io/rml-resources/portal/</p></div>
			</div>

			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Scaling RML and SPARQL-based knowledge graph construction with Apache Spark</title>
		<author>
			<persName><forename type="first">C</forename><surname>Stadler</surname></persName>
		</author>
		<author>
			<persName><forename type="first">L</forename><surname>Bühmann</surname></persName>
		</author>
		<author>
			<persName><forename type="first">L.-P</forename><surname>Meyer</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Martin</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Proceedings of the 4th International Workshop on Knowledge Graph Construction</title>
				<meeting>the 4th International Workshop on Knowledge Graph Construction</meeting>
		<imprint>
			<publisher>ESWC</publisher>
			<date type="published" when="2023">2023</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<monogr>
		<author>
			<persName><forename type="first">D</forename><surname>Van Assche</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Chaves-Fraga</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Dimou</surname></persName>
		</author>
		<author>
			<persName><forename type="first">U</forename><surname>Şimşek</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Iglesias</surname></persName>
		</author>
		<idno type="DOI">10.5281/zenodo.10973433</idno>
		<title level="m">Challenge @ ESWC 2024</title>
				<imprint>
			<date type="published" when="2024">2024. 2024</date>
		</imprint>
	</monogr>
	<note>KGCW</note>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">KGCW2023 Challenge Report RDFProcessingToolkit/Sansa</title>
		<author>
			<persName><forename type="first">S</forename><surname>Bin</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Stadler</surname></persName>
		</author>
		<author>
			<persName><forename type="first">L</forename><surname>Bühmann</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">KGCW Challenge @ ESWC</title>
				<imprint>
			<date type="published" when="2023">2023</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">GTFS-Madrid-Bench: A benchmark for virtual knowledge graph access in the transport domain</title>
		<author>
			<persName><forename type="first">D</forename><surname>Chaves-Fraga</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Priyatna</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Cimmino</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Toledo</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Ruckhaus</surname></persName>
		</author>
		<author>
			<persName><forename type="first">O</forename><surname>Corcho</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Journal of Web Semantics</title>
		<imprint>
			<biblScope unit="volume">65</biblScope>
			<biblScope unit="page">100596</biblScope>
			<date type="published" when="2020">2020</date>
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
