From 68de1c65d06a2f711b65f93b952e723bc2a3808e Mon Sep 17 00:00:00 2001 From: Marcin Procyk Date: Wed, 10 Apr 2024 08:46:40 +0200 Subject: [PATCH] chore: Update apache-jena-fuseki to v5.0.0-1 (#3176) --- docker-compose.yml | 4 +- .../impl/TriplestoreServiceLiveZSpec.scala | 95 ------------------- project/Dependencies.scala | 9 +- 3 files changed, 8 insertions(+), 100 deletions(-) delete mode 100644 integration/src/test/scala/org/knora/webapi/store/triplestore/impl/TriplestoreServiceLiveZSpec.scala diff --git a/docker-compose.yml b/docker-compose.yml index 2f780f9694..9d21f3e76b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,9 @@ services: - knora-net db: - image: daschswiss/apache-jena-fuseki:2.1.5 # should be the same version as in Dependencies.scala, also make sure to use the same version when deploying it (i.e. version in ops-deploy)! + # should be the same version as in Dependencies.scala, + # make sure to use the same version in ops-deploy repository when deploying new DSP releases! + image: daschswiss/apache-jena-fuseki:5.0.0-1 ports: - "3030:3030" volumes: diff --git a/integration/src/test/scala/org/knora/webapi/store/triplestore/impl/TriplestoreServiceLiveZSpec.scala b/integration/src/test/scala/org/knora/webapi/store/triplestore/impl/TriplestoreServiceLiveZSpec.scala deleted file mode 100644 index b6d6d4e78c..0000000000 --- a/integration/src/test/scala/org/knora/webapi/store/triplestore/impl/TriplestoreServiceLiveZSpec.scala +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright © 2021 - 2024 Swiss National Data and Service Center for the Humanities and/or DaSCH Service Platform contributors. - * SPDX-License-Identifier: Apache-2.0 - */ - -package org.knora.webapi.store.triplestore.impl - -import zio._ -import zio.test._ - -import dsp.errors.NotFoundException -import org.knora.webapi.config.AppConfigForTestContainers -import org.knora.webapi.messages.StringFormatter -import org.knora.webapi.store.triplestore.api.TriplestoreService -import org.knora.webapi.store.triplestore.api.TriplestoreService.Queries.Select -import org.knora.webapi.testcontainers.FusekiTestContainer - -/** - * This spec is used to test [[org.knora.webapi.store.triplestore.impl.TriplestoreServiceLive]]. - */ -object TriplestoreServiceLiveZSpec extends ZIOSpecDefault { - - /** - * Defines a layer which encompasses all dependencies that are needed for - * running the tests. `bootstrap` overrides the base layer of ZIOApp. - */ - val testLayer: ULayer[TriplestoreService] = - ZLayer.make[TriplestoreService]( - TriplestoreServiceLive.layer, - AppConfigForTestContainers.fusekiOnlyTestcontainer, - FusekiTestContainer.layer, - StringFormatter.test, - ) - - def spec: Spec[Any, Nothing] = - suite("TriplestoreServiceLiveSpec")( - test("successfully call a request that triggers a TriplestoreResponseException") { - val searchStringOfDeath = - """|PREFIX knora-base: - |PREFIX rdfs: - | - |SELECT DISTINCT ?resource (GROUP_CONCAT(IF(BOUND(?valueObject), STR(?valueObject), ""); separator="") AS ?valueObjectConcat) - |WHERE { - | { - | SELECT DISTINCT ?matchingSubject - | WHERE { - | ?matchingSubject 'fiche_CLSR AND GR AND MS AND 6 AND E129b_[Le AND sommeil AND et AND la AND mort…]*' . - | } - | } - | OPTIONAL { - | ?matchingSubject a ?valueObjectType . - | ?valueObjectType rdfs:subClassOf *knora-base:Value . - | FILTER(?valueObjectType != knora-base:LinkValue && ?valueObjectType != knora-base:ListValue) - | ?containingResource ?property ?matchingSubject . - | ?property rdfs:subPropertyOf* knora-base:hasValue . - | FILTER NOT EXISTS { ?matchingSubject knora-base:isDeleted true } - | # this variable will only be bound if the search matched a value object - | BIND(?matchingSubject AS ?valueObject) - | } - | OPTIONAL { - | # get all list nodes that match the search term - | ?matchingSubject a knora-base:ListNode . - | # get sub-node(s) of that node(s) (recursively) - | ?matchingSubject knora-base:hasSubListNode* ?subListNode . - | # get all values that point to the node(s) and sub-node(s) - | ?listValue knora-base:valueHasListNode ?subListNode . - | # get all resources that have that values - | ?subjectWithListValue ?predicate ?listValue . - | FILTER NOT EXISTS { ?matchingSubject knora-base:isDeleted true } - | # this variable will only be bound if the search matched a list node - | BIND(?listValue AS ?valueObject) - | } - | # If the first OPTIONAL clause was executed, ?matchingSubject is a value object, and ?containingResource will be set as ?valueObject. - | # If the second OPTIONAL clause was executed, ?matchingSubject is a list node, and ?listValue will be set as ?valueObject. - | # Otherwise, ?matchingSubject is a resource (its rdfs:label matched the search pattern). - | BIND( COALESCE( ?containingResource, ?subjectWithListValue, ?matchingSubject) AS ?resource) - | ?resource a ?resourceClass . - | ?resourceClass rdfs:subClassOf* knora-base:Resource . - | FILTER NOT EXISTS { - | ?resource knora-base:isDeleted true . - | } - |} - |GROUP BY ?resource ORDER BY ?resource - |OFFSET 0 - |LIMIT 25""".stripMargin - - for { - // TODO: Need to first load testdata. Only then this query should trigger a 500 error in Fuseki. - // _ <- TriplestoreService.sparqlHttpSelect(searchStringOfDeath, false).exit.repeatN(100) - // _ <- Clock.ClockLive.sleep(10.seconds) - result <- TriplestoreService.query(Select(searchStringOfDeath)).exit - } yield assertTrue(result.is(_.failure) == NotFoundException("The requested data was not found")) - }, - ).provideLayer(testLayer) @@ TestAspect.sequential -} diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 04175c873b..0a5fde9ff0 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -10,10 +10,11 @@ import sbt.* import scala.collection.immutable.Seq object Dependencies { - - val fusekiImage = - "daschswiss/apache-jena-fuseki:2.1.5" // should be the same version as in docker-compose.yml, also make sure to use the same version when deploying it (i.e. version in ops-deploy)! - val sipiImage = "daschswiss/sipi:v3.12.2" // base image the knora-sipi image is created from + // should be the same version as in docker-compose.yml, + // make sure to use the same version in ops-deploy repository when deploying new DSP releases! + val fusekiImage = "daschswiss/apache-jena-fuseki:5.0.0-1" + // base image the knora-sipi image is created from + val sipiImage = "daschswiss/sipi:v3.12.2" val ScalaVersion = "2.13.13"