diff --git a/plugins/t-filesToRdf/src/main/java/com/linkedpipes/plugin/transformer/filesToRdf/FilesToRdf.java b/plugins/t-filesToRdf/src/main/java/com/linkedpipes/plugin/transformer/filesToRdf/FilesToRdf.java index 23ae43561..82aeb96cb 100644 --- a/plugins/t-filesToRdf/src/main/java/com/linkedpipes/plugin/transformer/filesToRdf/FilesToRdf.java +++ b/plugins/t-filesToRdf/src/main/java/com/linkedpipes/plugin/transformer/filesToRdf/FilesToRdf.java @@ -8,6 +8,8 @@ import com.linkedpipes.etl.executor.api.v1.component.SequentialExecution; import com.linkedpipes.etl.executor.api.v1.service.ProgressReport; import org.eclipse.rdf4j.rio.*; +import org.eclipse.rdf4j.rio.helpers.JSONLDSettings; +import org.eclipse.rdf4j.rio.jsonld.JSONLDParser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -87,6 +89,11 @@ private void loadFiles() throws LpException { private void loadEntry(FilesDataUnit.Entry entry) throws LpException { RDFFormat format = getFormat(entry.getFileName()); RDFParser parser = createParser(format); + + if (parser instanceof JSONLDParser jsonLdParser) { + jsonLdParser.set(JSONLDSettings.SECURE_MODE, false); + } + try (InputStream fileStream = new FileInputStream(entry.toFile())) { parser.parse(fileStream, "http://localhost/base/"); } catch (IOException | RDFHandlerException | RDFParseException ex) { diff --git a/plugins/t-filesToRdfChunked/src/main/java/com/linkedpipes/plugin/transformer/filesToRdf/FilesToRdfChunkedTransformer.java b/plugins/t-filesToRdfChunked/src/main/java/com/linkedpipes/plugin/transformer/filesToRdf/FilesToRdfChunkedTransformer.java index 2bac8bd66..191cd4dbe 100644 --- a/plugins/t-filesToRdfChunked/src/main/java/com/linkedpipes/plugin/transformer/filesToRdf/FilesToRdfChunkedTransformer.java +++ b/plugins/t-filesToRdfChunked/src/main/java/com/linkedpipes/plugin/transformer/filesToRdf/FilesToRdfChunkedTransformer.java @@ -12,6 +12,8 @@ import org.eclipse.rdf4j.rio.RDFParser; import org.eclipse.rdf4j.rio.Rio; import org.eclipse.rdf4j.rio.helpers.AbstractRDFHandler; +import org.eclipse.rdf4j.rio.helpers.JSONLDSettings; +import org.eclipse.rdf4j.rio.jsonld.JSONLDParser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -96,8 +98,18 @@ protected RDFFormat getFormat(String fileName) throws LpException { } protected void loadFile(File file, RDFFormat format) throws LpException { + RDFParser parser; + try { + parser = createParser(format); + } catch(RuntimeException ex) { + throw new LpException("Can't create parser for a file: {}", file, ex); + } + + if (parser instanceof JSONLDParser jsonLdParser) { + jsonLdParser.set(JSONLDSettings.SECURE_MODE, false); + } + try (InputStream stream = new FileInputStream(file)) { - RDFParser parser = createParser(format); parser.parse(stream, "http://localhost/base/"); } catch (RuntimeException | IOException ex) { throw new LpException("Can't load file: {}", file, ex); diff --git a/plugins/t-filesToRdfGraph/src/main/java/com/linkedpipes/plugin/transformer/filesToRdfGraph/FilesToRdfGraph.java b/plugins/t-filesToRdfGraph/src/main/java/com/linkedpipes/plugin/transformer/filesToRdfGraph/FilesToRdfGraph.java index cd645532c..01fe4be48 100644 --- a/plugins/t-filesToRdfGraph/src/main/java/com/linkedpipes/plugin/transformer/filesToRdfGraph/FilesToRdfGraph.java +++ b/plugins/t-filesToRdfGraph/src/main/java/com/linkedpipes/plugin/transformer/filesToRdfGraph/FilesToRdfGraph.java @@ -8,6 +8,8 @@ import com.linkedpipes.etl.executor.api.v1.component.SequentialExecution; import com.linkedpipes.etl.executor.api.v1.service.ProgressReport; import org.eclipse.rdf4j.rio.*; +import org.eclipse.rdf4j.rio.helpers.JSONLDSettings; +import org.eclipse.rdf4j.rio.jsonld.JSONLDParser; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -78,6 +80,11 @@ private void loadFiles() throws LpException { private void loadEntry(FilesDataUnit.Entry entry) throws LpException { RDFFormat format = getFormat(entry.getFileName()); RDFParser parser = createParser(format); + + if (parser instanceof JSONLDParser jsonLdParser) { + jsonLdParser.set(JSONLDSettings.SECURE_MODE, false); + } + try (InputStream fileStream = new FileInputStream(entry.toFile())) { parser.parse(fileStream, "http://localhost/base/"); } catch (Exception ex) {