From 1fa05a5055781930fac765e644070b23dd01741a Mon Sep 17 00:00:00 2001 From: Shwetambara Nazare Date: Tue, 30 Apr 2024 17:20:05 +0200 Subject: [PATCH] Changes to re-add the JSON rdfFormatter --- .../src/main/java/eu/europeana/api/format/RdfFormat.java | 3 ++- .../java/eu/europeana/api/record/io/FormatHandlerRegistry.java | 1 + .../eu/europeana/api/record/io/FormatHandlerRegistryV2.java | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/record-api-common/src/main/java/eu/europeana/api/format/RdfFormat.java b/record-api-common/src/main/java/eu/europeana/api/format/RdfFormat.java index 6a94c22..c72bb81 100755 --- a/record-api-common/src/main/java/eu/europeana/api/format/RdfFormat.java +++ b/record-api-common/src/main/java/eu/europeana/api/format/RdfFormat.java @@ -8,7 +8,8 @@ * @since 13 Oct 2023 */ public enum RdfFormat { - JSONLD("jsonld","json",null,"application/ld+json","application/json") + JSONLD("jsonld","json",null,"application/ld+json") + , JSON("json","json",null,"application/json") , XML("rdf","xml","utf-8","application/rdf+xml","application/xml","text/xml","rdf/xml") , TURTLE("ttl",null,"utf-8","text/turtle","application/turtle","application/x-turtle") , N3("n3",null,"utf-8","text/n3","text/rdf+n3","application/n3") diff --git a/record-api-model/src/main/java/eu/europeana/api/record/io/FormatHandlerRegistry.java b/record-api-model/src/main/java/eu/europeana/api/record/io/FormatHandlerRegistry.java index cbd753c..e582333 100755 --- a/record-api-model/src/main/java/eu/europeana/api/record/io/FormatHandlerRegistry.java +++ b/record-api-model/src/main/java/eu/europeana/api/record/io/FormatHandlerRegistry.java @@ -39,6 +39,7 @@ public FormatHandlerRegistry(JsonLdWriter jsonLdWriter, XmlRecordWriter xmlRecor this.jenaBasedNTWriter = jenaBasedNTWriter; put(RdfFormat.JSONLD, this.jsonLdWriter); + put(RdfFormat.JSON, this.jsonLdWriter); put(RdfFormat.XML, this.xmlRecordWriter); put(RdfFormat.TURTLE, this.jenaBasedTurtleWriter); put(RdfFormat.N3, this.jenaBasedN3Writer); diff --git a/record-api-model/src/main/java/eu/europeana/api/record/io/FormatHandlerRegistryV2.java b/record-api-model/src/main/java/eu/europeana/api/record/io/FormatHandlerRegistryV2.java index 264d289..be73984 100644 --- a/record-api-model/src/main/java/eu/europeana/api/record/io/FormatHandlerRegistryV2.java +++ b/record-api-model/src/main/java/eu/europeana/api/record/io/FormatHandlerRegistryV2.java @@ -36,6 +36,7 @@ public FormatHandlerRegistryV2(JsonV2Writer jsonV2Writer, this.jenaBasedTurtleWriter = jenaBasedTurtleWriter; put(RdfFormat.JSONLD, this.jsonLdWriter); + put(RdfFormat.JSON, this.jsonV2Writer); put(RdfFormat.XML, this.xmlRecordWriter); put(RdfFormat.TURTLE, this.jenaBasedTurtleWriter);