Skip to content
Permalink
Browse files
chore(deps): upgrade titanium-json-ld to v1.2.0 & jakarta-json to v2.…
…0.1 (DEV-335) (#1993)

* chore(deps): upgrade titanium to v1.0.0 and jakarta to v2.0.0

* chore(deps): remove javax.json replaced by jakarta.json

* chore(deps): upgrade titanium to v1.2.0 and jakarta to v2.0.1
  • Loading branch information
mpro7 committed Feb 4, 2022
1 parent 01c63eb commit ad01bf996de77d72934671de2479a206ca80e365
@@ -104,10 +104,8 @@ def dependencies():
# provides akka jackson (json) support
"de.heikoseeberger:akka-http-circe_2.13:1.36.0",
"com.fasterxml.jackson.module:jackson-module-scala_2.13:2.12.3",
"javax.json:javax.json-api:1.1.4",
# TODO: DEV-335 upgrade titanium to 1.1.0 and jakarta-json to 2.0.1
"com.apicatalog:titanium-json-ld:0.8.5",
"org.glassfish:jakarta.json:1.1.6",
"com.apicatalog:titanium-json-ld:1.2.0",
"org.glassfish:jakarta.json:2.0.1",

# swagger (api documentation)
"com.github.swagger-akka-http:swagger-akka-http_2.13:1.2.0",
@@ -210,6 +208,5 @@ BASE_TEST_DEPENDENCIES_WITH_JSON = BASE_TEST_DEPENDENCIES + [
BASE_TEST_DEPENDENCIES_WITH_JSON_LD = BASE_TEST_DEPENDENCIES + [
"@maven//:io_spray_spray_json_2_13",
"@maven//:com_apicatalog_titanium_json_ld",
"@maven//:javax_json_javax_json_api",
"@maven//:org_glassfish_jakarta_json",
]
@@ -64,7 +64,6 @@ scala_library(
"@maven//:com_fasterxml_jackson_core_jackson_databind",
"@maven//:com_github_andrewoma_dexx_collection",
"@maven//:com_apicatalog_titanium_json_ld",
"@maven//:javax_json_javax_json_api",
"@maven//:org_glassfish_jakarta_json",
"@maven//:com_github_swagger_akka_http_swagger_akka_http_2_13",
"@maven//:com_google_gwt_gwt_servlet",
@@ -32,7 +32,7 @@ scala_library(
"@maven//:dev_zio_zio_2_13",
"@maven//:dev_zio_zio_prelude_2_13",
"@maven//:io_spray_spray_json_2_13",
"@maven//:javax_json_javax_json_api",
"@maven//:org_glassfish_jakarta_json",
"@maven//:net_sf_saxon_Saxon_HE",
"@maven//:org_apache_commons_commons_lang3",
"@maven//:org_apache_commons_commons_text",
@@ -5,21 +5,20 @@

package org.knora.webapi.messages.util.rdf

import java.io.{StringReader, StringWriter}
import java.util
import java.util.UUID

import com.apicatalog.jsonld._
import com.apicatalog.jsonld.document._
import javax.json._
import javax.json.stream.JsonGenerator
import jakarta.json._
import jakarta.json.stream.JsonGenerator
import org.apache.commons.lang3.builder.HashCodeBuilder
import org.knora.webapi._
import org.knora.webapi.exceptions._
import org.knora.webapi.messages.IriConversions._
import org.knora.webapi.messages.store.triplestoremessages.StringLiteralV2
import org.knora.webapi.messages.{OntologyConstants, SmartIri, StringFormatter}

import java.io.{StringReader, StringWriter}
import java.util
import java.util.UUID
import scala.jdk.CollectionConverters._
import scala.util.control.Exception._

@@ -29,7 +28,7 @@ The classes in this file provide a Scala API for formatting and parsing JSON-LD,
between JSON-LD documents and RDF models. These classes also provide Knora-specific JSON-LD functionality
to facilitate reading data from Knora API requests and constructing Knora API responses.
The implementation uses the javax.json API and a Java implementation of the JSON-LD API
The implementation uses the jakarta.json API and a Java implementation of the JSON-LD API
<https://www.w3.org/TR/json-ld11-api/> (currently <https://github.com/filip26/titanium-json-ld>).
*/
@@ -62,7 +61,7 @@ object JsonLDKeywords {
sealed trait JsonLDValue extends Ordered[JsonLDValue] {

/**
* Converts this JSON-LD value to a `javax.json` [[JsonValue]].
* Converts this JSON-LD value to a `jakarta.json` [[JsonValue]].
*/
def toJavaxJsonValue: JsonValue
}
@@ -1338,7 +1337,7 @@ object JsonLDUtil {
* @return a [[JsonLDDocument]].
*/
def parseJsonLD(jsonLDString: String, flatten: Boolean = false): JsonLDDocument = {
// Parse the string into a javax.json.JsonStructure.
// Parse the string into a jakarta.json.JsonStructure.
val stringReader = new StringReader(jsonLDString)
val jsonReader: JsonReader = Json.createReader(stringReader)
val jsonStructure: JsonStructure = jsonReader.read()
@@ -1350,7 +1349,7 @@ object JsonLDUtil {
val emptyContext = JsonDocument.of(Json.createObjectBuilder().build())
val compactedJsonObject: JsonObject = JsonLd.compact(titaniumDocument, emptyContext).get

// Convert the resulting javax.json.JsonObject to a JsonLDDocument.
// Convert the resulting jakarta.json.JsonObject to a JsonLDDocument.
val jsonLDDocument: JsonLDDocument = javaxJsonObjectToJsonLDDocument(compactedJsonObject)

// Was flat JSON-LD requested?
@@ -30,7 +30,7 @@ scala_library(
"@maven//:dev_zio_zio_2_13",
"@maven//:dev_zio_zio_prelude_2_13",
"@maven//:io_spray_spray_json_2_13",
"@maven//:javax_json_javax_json_api",
"@maven//:org_glassfish_jakarta_json",
"@maven//:org_scala_lang_modules_scala_xml_2_13",
"@maven//:org_slf4j_slf4j_api",
"@maven//:org_springframework_security_spring_security_core",
@@ -107,7 +107,6 @@ scala_test(
"//webapi:test_library",
"@maven//:org_eclipse_rdf4j_rdf4j_client",
"@maven//:org_xmlunit_xmlunit_core",
"@maven//:javax_json_javax_json_api",
] + BASE_TEST_DEPENDENCIES_WITH_JSON,
)

0 comments on commit ad01bf9

Please sign in to comment.