diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 00000000..cff1fe79
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 3bd7f31c..9f12a696 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -1,4 +1,3 @@
-
diff --git a/fetch-test-cases.bat b/fetch-test-cases.bat
new file mode 100644
index 00000000..c0586723
--- /dev/null
+++ b/fetch-test-cases.bat
@@ -0,0 +1,61 @@
+@echo off
+
+set "targetDir=target"
+
+echo Creating target directory...
+if not exist "%targetDir%" mkdir "%targetDir%"
+if errorlevel 1 goto error
+
+cd "%targetDir%"
+if errorlevel 1 goto error
+
+echo Cloning https://github.com/kg-construct/rml-core
+git clone https://github.com/kg-construct/rml-core
+if errorlevel 1 goto error
+
+echo Cloning rhttps://github.com/kg-construct/rml-cc
+git clone https://github.com/kg-construct/rml-cc
+if errorlevel 1 goto error
+
+echo Cloning https://github.com/kg-construct/rml-io
+git clone https://github.com/kg-construct/rml-io
+if errorlevel 1 goto error
+
+echo Cloning rhttps://github.com/kg-construct/rml-fnml
+git clone https://github.com/kg-construct/rml-fnml
+if errorlevel 1 goto error
+
+echo Cloning https://github.com/kg-construct/rml-lv
+git clone https://github.com/kg-construct/rml-lv
+if errorlevel 1 goto error
+
+echo Cloning rhttps://github.com/kg-construct/rml-star
+git clone https://github.com/kg-construct/rml-star
+if errorlevel 1 goto error
+
+echo All repositories cloned successfully into the target directory!
+
+echo Copying test-case directories to ..\src\test\resources
+xcopy .\rml-core\test-cases ..\src\test\resources\rml-core /E /I /Y
+xcopy .\rml-cc\test-cases ..\src\test\resources\rml-cc /E /I /Y
+xcopy .\target\rml-io\test-cases ..\src\test\resources\rml-io /E /I /Y
+xcopy .\rml-lv\test-cases ..\src\test\resources\rml-lv /E /I /Y
+xcopy .\rml-fnml\test-cases ..\src\test\resources\rml-fnml /E /I /Y
+xcopy .\rml-star\test-cases ..\src\test\resources\rml-star /E /I /Y
+
+rmdir /S /Q .\rml-core
+rmdir /S /Q .\rml-cc
+rmdir /S /Q .\rml-io
+rmdir /S /Q .\rml-lv
+rmdir /S /Q .\rml-fnml
+rmdir /S /Q .\rml-star
+
+goto end
+
+:error
+echo Error occurred.
+echo Check the repository URLs and your internet connection.
+echo or verify that you have permissions to create and write to the target directory.
+
+:end
+pause
\ No newline at end of file
diff --git a/fetch-test-cases.sh b/fetch-test-cases.sh
new file mode 100755
index 00000000..fb070632
--- /dev/null
+++ b/fetch-test-cases.sh
@@ -0,0 +1,72 @@
+#!/usr/bin/env bash
+set -Eeuo pipefail
+
+# --- config ---
+target_dir="target"
+resources_dir="src/test/resources"
+shapes_resources_dir="src/main/resources/shapes"
+repos=(
+ "rml-core"
+ "rml-cc"
+ "rml-io"
+ "rml-fnml"
+ "rml-lv"
+ "rml-star"
+)
+
+trap 'echo; echo "Error occurred."; echo "• Check the repository URLs and your internet connection."; echo "• Verify you have permissions to create/write to \"$target_dir\"."; exit 1' ERR
+
+# Check prerequisites
+command -v git >/dev/null 2>&1 || { echo "git is required but not found in PATH."; exit 1; }
+
+echo "Creating $target_dir directory..."
+mkdir -p "$target_dir"
+
+echo "Entering $target_dir..."
+cd "$target_dir"
+
+# Clone all repositories
+for repo in "${repos[@]}"; do
+ echo "Cloning https://github.com/kg-construct/$repo ..."
+ git clone "https://github.com/kg-construct/$repo"
+done
+
+echo "All repositories cloned successfully into $target_dir"
+
+# Copy test-cases into ../src/test/resources/
+echo "Copying test-case directories to ../$resources_dir ..."
+for repo in "${repos[@]}"; do
+ src="$repo/test-cases"
+ dest="../$resources_dir/$repo"
+ if [[ -d "$src" ]]; then
+ mkdir -p "$dest"
+ # -a to preserve attrs; -r for recursive; --no-target-directory not needed here
+ cp -a "$src/." "$dest/"
+ echo "• Copied $src -> $dest"
+ else
+ echo "• Skipped $repo (no test-cases directory found)"
+ fi
+done
+
+# Copy shapes into ../src/main/resources/
+echo "Copying shapes directories to ../$shapes_resources_dir ..."
+for repo in "${repos[@]}"; do
+ src="$repo/shapes"
+ dest="../$shapes_resources_dir/$repo"
+ if [[ -d "$src" ]]; then
+ mkdir -p "$dest"
+ # -a to preserve attrs; -r for recursive; --no-target-directory not needed here
+ cp -a "$src/." "$dest/"
+ echo "• Copied $src -> $dest"
+ else
+ echo "• Skipped $repo (no shapes directory found)"
+ fi
+done
+
+# Remove cloned repositories
+echo "Cleaning up cloned repositories..."
+for repo in "${repos[@]}"; do
+ rm -rf "./$repo"
+done
+
+echo "Done."
diff --git a/pom.xml b/pom.xml
index c728053b..6dc54d76 100644
--- a/pom.xml
+++ b/pom.xml
@@ -2,7 +2,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
- com.github.kg-construct
+ io.github.kg-construct
BURP
0.1.2
Basic and Unassuming RML Processor
@@ -220,6 +220,12 @@
test
+ org.junit.jupiter
+ junit-jupiter-params
+ 5.10.2
+ test
+
+
org.testcontainers
junit-jupiter
1.19.5
diff --git a/src/main/java/burp/Main.java b/src/main/java/burp/Main.java
index d318529e..d7ac6597 100644
--- a/src/main/java/burp/Main.java
+++ b/src/main/java/burp/Main.java
@@ -68,11 +68,13 @@ public static int doMain(String[] args) {
}
}
- private static Dataset generate(List triplesmaps, String baseIRI) {
+ private static Dataset generate(List triplesmaps, String givenBaseIRI) {
Dataset ds = DatasetFactory.create();
// Execute the triples maps
for (TriplesMap tm : triplesmaps) {
+ String baseIRI = tm.baseIRI == null ? givenBaseIRI : tm.baseIRI;
+
// Let sm be the subject map of the triples map
SubjectMap sm = tm.subjectMap;
diff --git a/src/main/java/burp/ls/CSVSource.java b/src/main/java/burp/ls/CSVSource.java
index cf81acd4..6910aaf1 100644
--- a/src/main/java/burp/ls/CSVSource.java
+++ b/src/main/java/burp/ls/CSVSource.java
@@ -1,18 +1,16 @@
package burp.ls;
import java.io.FileReader;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
+import java.io.StringWriter;
+import java.util.*;
+import java.util.stream.Collectors;
import com.opencsv.CSVParserBuilder;
import com.opencsv.CSVReader;
import com.opencsv.CSVReaderBuilder;
import burp.model.Iteration;
+import com.opencsv.CSVWriter;
class CSVSource extends FileBasedLogicalSource {
@@ -23,7 +21,7 @@ class CSVSource extends FileBasedLogicalSource {
public Iterator iterator() {
try {
if (iterations == null) {
- iterations = new ArrayList();
+ iterations = new ArrayList<>();
FileReader fr = new FileReader(getDecompressedFile(), encoding);
@@ -64,7 +62,8 @@ public Iterator iterator() {
class CSVIteration extends Iteration {
- private Map map = new HashMap();
+ // Use a LinkedHashMap to preserve a correspondence between keys and values
+ private final Map map = new LinkedHashMap<>();
protected CSVIteration(String[] header, String[] rec, Set