From cd0509f5b1f3ca87fb4684e1b5c531a1bde124e4 Mon Sep 17 00:00:00 2001 From: michielrogissart-cognizone Date: Wed, 6 Sep 2023 09:29:46 +0200 Subject: [PATCH] T18011 JenaUtils.read support jsonld --- .../src/main/java/zone/cogni/libs/jena/utils/JenaUtils.java | 4 ++++ cogni-sem/src/main/java/zone/cogni/sem/jena/JenaUtils.java | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/cogni-libs/src/main/java/zone/cogni/libs/jena/utils/JenaUtils.java b/cogni-libs/src/main/java/zone/cogni/libs/jena/utils/JenaUtils.java index ab12b0f5..6448fe7c 100644 --- a/cogni-libs/src/main/java/zone/cogni/libs/jena/utils/JenaUtils.java +++ b/cogni-libs/src/main/java/zone/cogni/libs/jena/utils/JenaUtils.java @@ -254,6 +254,10 @@ private static String getRdfSyntax(org.springframework.core.io.Resource resource // .ttl is extension for text/turtle return "TURTLE"; } + if("jsonld".equals(extension)) { + // .jsonld is extension for application/ld+json + return "JSONLD"; + } // any other extension falls back to RDF XML return null; diff --git a/cogni-sem/src/main/java/zone/cogni/sem/jena/JenaUtils.java b/cogni-sem/src/main/java/zone/cogni/sem/jena/JenaUtils.java index bb71d144..4e826764 100644 --- a/cogni-sem/src/main/java/zone/cogni/sem/jena/JenaUtils.java +++ b/cogni-sem/src/main/java/zone/cogni/sem/jena/JenaUtils.java @@ -50,6 +50,7 @@ import java.util.function.Supplier; import java.util.stream.Collectors; +@Deprecated public class JenaUtils { private static final Logger log = LoggerFactory.getLogger(JenaUtils.class); @@ -272,6 +273,10 @@ private static String getRdfSyntax(Resource resource) { // .ttl is extension for text/turtle return "TURTLE"; } + if("jsonld".equals(extension)) { + // .jsonld is extension for application/ld+json + return "JSONLD"; + } // any other extension falls back to RDF XML return null;