Skip to content

Commit

Permalink
Merge branch 'main' into wip/build-queries-with-query-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
BalduinLandolt committed Jul 15, 2024
2 parents ad6a7f9 + 63f8426 commit 413d5fa
Show file tree
Hide file tree
Showing 15 changed files with 398 additions and 99 deletions.
42 changes: 42 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# Changelog

## [30.18.1](https://github.com/dasch-swiss/dsp-api/compare/v30.18.0...v30.18.1) (2024-07-15)


### Bug Fixes

* Do not fail when updating class with external ontologies (DEV-3879) ([#3321](https://github.com/dasch-swiss/dsp-api/issues/3321)) ([752a7fe](https://github.com/dasch-swiss/dsp-api/commit/752a7fef337dd612907109b854fb84eb483229d9))

## [30.18.0](https://github.com/dasch-swiss/dsp-api/compare/v30.17.1...v30.18.0) (2024-07-15)


### Maintenance

* Add e2e test for v2 lists endpoints ([#3315](https://github.com/dasch-swiss/dsp-api/issues/3315)) ([17d7441](https://github.com/dasch-swiss/dsp-api/commit/17d74416be7e58cfc488b18e57088a5dc7760243))
* Add sqlite to localdev setup ([#3304](https://github.com/dasch-swiss/dsp-api/issues/3304)) ([e5650a7](https://github.com/dasch-swiss/dsp-api/commit/e5650a7fc4429dd05160b9c4f4b71d787b0a96c6))
* Dependency updates ([#3319](https://github.com/dasch-swiss/dsp-api/issues/3319)) ([44eee9b](https://github.com/dasch-swiss/dsp-api/commit/44eee9b024f39e469fde08b2fedb177211a79bc4))
* Determine the year automatically for copyright headers ([#3316](https://github.com/dasch-swiss/dsp-api/issues/3316)) ([e25456c](https://github.com/dasch-swiss/dsp-api/commit/e25456c7129c603284e5899d94cfbd0f1994d4c8))
* Major dependency updates ([#3300](https://github.com/dasch-swiss/dsp-api/issues/3300)) ([63b202d](https://github.com/dasch-swiss/dsp-api/commit/63b202db319776e02caf16c7cd93372b632ea73f))
* Migrate ListRouteV2 to tapir (DEV-3852) ([#3307](https://github.com/dasch-swiss/dsp-api/issues/3307)) ([9b3d6c7](https://github.com/dasch-swiss/dsp-api/commit/9b3d6c738a34f0b6f2753591acc629ac15133fd2))
* Migrate to `AuthenticationRouteV2` tapir ([#3310](https://github.com/dasch-swiss/dsp-api/issues/3310)) ([c62f460](https://github.com/dasch-swiss/dsp-api/commit/c62f46046eff01d90ed268d304bd7d5658a535d1))
* Minor dependency updates ([#3299](https://github.com/dasch-swiss/dsp-api/issues/3299)) ([34afc96](https://github.com/dasch-swiss/dsp-api/commit/34afc96633fcc5e19d9ef4cc14c0f6c7eb909b5e))
* Minor dependency updates ([#3318](https://github.com/dasch-swiss/dsp-api/issues/3318)) ([1d5fd19](https://github.com/dasch-swiss/dsp-api/commit/1d5fd1991ea675e8c36c190fc40054c94f25e4cc))
* Patch dependency updates ([#3298](https://github.com/dasch-swiss/dsp-api/issues/3298)) ([ae22613](https://github.com/dasch-swiss/dsp-api/commit/ae226132bbc0a0e61fe67e09b31cbcad8348e8ee))
* Patch dependency updates ([#3317](https://github.com/dasch-swiss/dsp-api/issues/3317)) ([26dba9a](https://github.com/dasch-swiss/dsp-api/commit/26dba9a3815696d5754b6e80846283651da11778))
* Small refactoring ([#3311](https://github.com/dasch-swiss/dsp-api/issues/3311)) ([6822d16](https://github.com/dasch-swiss/dsp-api/commit/6822d16090fd6456f6ab68e1f6f1ac519f8c7f3a))


### Documentation

* Update documentation ([#3308](https://github.com/dasch-swiss/dsp-api/issues/3308)) ([d2f2120](https://github.com/dasch-swiss/dsp-api/commit/d2f2120394249789ee5e8144ba2ed9d69353eed3))


### Enhancements

* Add feature flag to disable lastModificationDate check (DEV-3870) ([#3313](https://github.com/dasch-swiss/dsp-api/issues/3313)) ([9c1a2c5](https://github.com/dasch-swiss/dsp-api/commit/9c1a2c5ee3e551e0e09220ddc2f152e832124834))


### Bug Fixes

* Add missing /v2/[lists|node]/:listIri to ApiRoutes ([#3314](https://github.com/dasch-swiss/dsp-api/issues/3314)) ([da1d61d](https://github.com/dasch-swiss/dsp-api/commit/da1d61d78ed87936d491424bbd9af69860aaad0e))
* Do not ignore the cardinality check result when updating the cardinalties (DEV-3841) ([#3306](https://github.com/dasch-swiss/dsp-api/issues/3306)) ([1f0d221](https://github.com/dasch-swiss/dsp-api/commit/1f0d221d803597c634d2d9901ad0dd6aff37f413))
* Fix query tracking tags (== is faulty), set previous bucket sizes (DEV-3776) ([#3305](https://github.com/dasch-swiss/dsp-api/issues/3305)) ([04b2a05](https://github.com/dasch-swiss/dsp-api/commit/04b2a055a6016023622cadbab378658263331f35))

## [30.17.1](https://github.com/dasch-swiss/dsp-api/compare/v30.17.0...v30.17.1) (2024-07-01)


Expand Down
7 changes: 4 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,15 @@ lazy val buildTime = Instant.now.toString

lazy val aggregatedProjects: Seq[ProjectReference] = Seq(webapi, sipi, integration)

lazy val year = java.time.LocalDate.now().getYear
lazy val buildSettings = Seq(
organization := "org.knora",
version := (ThisBuild / version).value,
headerLicense := Some(
HeaderLicense.Custom(
"""|Copyright © 2021 - 2024 Swiss National Data and Service Center for the Humanities and/or DaSCH Service Platform contributors.
|SPDX-License-Identifier: Apache-2.0
|""".stripMargin,
s"""|Copyright © 2021 - $year Swiss National Data and Service Center for the Humanities and/or DaSCH Service Platform contributors.
|SPDX-License-Identifier: Apache-2.0
|""".stripMargin,
),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ trait TestStartupUtils extends LazyLogging {
rdfDataObjects: List[RdfDataObject],
): ZIO[TriplestoreService with OntologyCache, Throwable, Unit] =
for {
_ <- ZIO.logInfo("Loading test data started ...")
_ <- ZIO.logInfo(s"Loading test data: ${rdfDataObjects.map(_.name).mkString}")
tss <- ZIO.service[TriplestoreService]
_ <- tss.resetTripleStoreContent(rdfDataObjects).timeout(480.seconds)
_ <- ZIO.logInfo("... loading test data done.")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
/*
* 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.slice.lists
import zio.test.*

import org.knora.webapi.E2EZSpec
import org.knora.webapi.messages.store.triplestoremessages.RdfDataObject
import org.knora.webapi.slice.admin.domain.model.ListProperties.ListIri

object ListsV2E2Spec extends E2EZSpec {

private def v2listsListIri(iri: ListIri) = s"/v2/lists/${urlEncode(iri.value)}"
private def v2nodeListIri(iri: ListIri) = s"/v2/node/${urlEncode(iri.value)}"

private val knownRootNode = ListIri.unsafeFrom("http://rdfh.ch/lists/0001/notUsedList")
private val knownSubNode = ListIri.unsafeFrom("http://rdfh.ch/lists/0001/notUsedList01")

override def rdfDataObjects: List[RdfDataObject] =
List(
RdfDataObject(
path = "test_data/project_data/anything-data.ttl",
name = "http://www.knora.org/data/0001/anything",
),
)

override def e2eSpec: Spec[env, Any] = suite("the lists API v2 for")(
suite("/v2/lists/:listIri should")(
test("return 404 for an unknown list") {
for {
response <- sendGetRequest(v2listsListIri(ListIri.unsafeFrom("http://rdfh.ch/lists/0001/unknown")))
} yield assertTrue(response.status.code == 404)
},
test("return 404 for an existing sub node") {
for {
response <- sendGetRequest(v2listsListIri(knownSubNode))
} yield assertTrue(response.status.code == 404)
},
test("return a known list") {
for {
response <- sendGetRequest(v2listsListIri(knownRootNode))
bodyStr <- response.body.asString
} yield {
assertTrue(
response.status.code == 200,
bodyStr == """{
| "rdfs:label": "a list that is not used",
| "knora-api:attachedToProject": {
| "@id": "http://rdfh.ch/projects/0001"
| },
| "knora-api:hasSubListNode": [
| {
| "rdfs:label": "node 1",
| "knora-api:hasRootNode": {
| "@id": "http://rdfh.ch/lists/0001/notUsedList"
| },
| "knora-api:hasSubListNode": [
| {
| "rdfs:label": "child of node 1",
| "knora-api:hasRootNode": {
| "@id": "http://rdfh.ch/lists/0001/notUsedList"
| },
| "knora-api:listNodePosition": 0,
| "@type": "knora-api:ListNode",
| "@id": "http://rdfh.ch/lists/0001/notUsedList011"
| },
| {
| "rdfs:label": "List012",
| "knora-api:hasRootNode": {
| "@id": "http://rdfh.ch/lists/0001/notUsedList"
| },
| "knora-api:listNodePosition": 1,
| "@type": "knora-api:ListNode",
| "@id": "http://rdfh.ch/lists/0001/notUsedList012"
| },
| {
| "rdfs:label": "List013",
| "knora-api:hasRootNode": {
| "@id": "http://rdfh.ch/lists/0001/notUsedList"
| },
| "knora-api:listNodePosition": 2,
| "@type": "knora-api:ListNode",
| "@id": "http://rdfh.ch/lists/0001/notUsedList013"
| },
| {
| "rdfs:label": "List014",
| "knora-api:hasRootNode": {
| "@id": "http://rdfh.ch/lists/0001/notUsedList"
| },
| "knora-api:hasSubListNode": [
| {
| "rdfs:label": "first child of node 014",
| "knora-api:hasRootNode": {
| "@id": "http://rdfh.ch/lists/0001/notUsedList"
| },
| "knora-api:listNodePosition": 0,
| "@type": "knora-api:ListNode",
| "@id": "http://rdfh.ch/lists/0001/notUsedList0141"
| },
| {
| "rdfs:label": "second child of node 014",
| "knora-api:hasRootNode": {
| "@id": "http://rdfh.ch/lists/0001/notUsedList"
| },
| "knora-api:listNodePosition": 0,
| "@type": "knora-api:ListNode",
| "@id": "http://rdfh.ch/lists/0001/notUsedList0142"
| }
| ],
| "knora-api:listNodePosition": 3,
| "@type": "knora-api:ListNode",
| "@id": "http://rdfh.ch/lists/0001/notUsedList014"
| },
| {
| "rdfs:label": "List015",
| "knora-api:hasRootNode": {
| "@id": "http://rdfh.ch/lists/0001/notUsedList"
| },
| "knora-api:listNodePosition": 4,
| "@type": "knora-api:ListNode",
| "@id": "http://rdfh.ch/lists/0001/notUsedList015"
| }
| ],
| "knora-api:listNodePosition": 0,
| "@type": "knora-api:ListNode",
| "@id": "http://rdfh.ch/lists/0001/notUsedList01"
| },
| {
| "rdfs:label": "node 2",
| "knora-api:hasRootNode": {
| "@id": "http://rdfh.ch/lists/0001/notUsedList"
| },
| "knora-api:listNodePosition": 1,
| "@type": "knora-api:ListNode",
| "@id": "http://rdfh.ch/lists/0001/notUsedList02"
| },
| {
| "rdfs:label": "node 3",
| "knora-api:hasRootNode": {
| "@id": "http://rdfh.ch/lists/0001/notUsedList"
| },
| "knora-api:hasSubListNode": {
| "rdfs:label": "child of node 3",
| "knora-api:hasRootNode": {
| "@id": "http://rdfh.ch/lists/0001/notUsedList"
| },
| "knora-api:listNodePosition": 0,
| "@type": "knora-api:ListNode",
| "@id": "http://rdfh.ch/lists/0001/notUsedList031"
| },
| "knora-api:listNodePosition": 2,
| "@type": "knora-api:ListNode",
| "@id": "http://rdfh.ch/lists/0001/notUsedList03"
| }
| ],
| "knora-api:isRootNode": true,
| "rdfs:comment": "a list that is not in used in ontology or data",
| "@type": "knora-api:ListNode",
| "@id": "http://rdfh.ch/lists/0001/notUsedList",
| "@context": {
| "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
| "knora-api": "http://api.knora.org/ontology/knora-api/v2#",
| "owl": "http://www.w3.org/2002/07/owl#",
| "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
| "xsd": "http://www.w3.org/2001/XMLSchema#"
| }
|}""".stripMargin,
)
}
},
),
suite("/v2/lists/:listIri should")(
test("return 404 for an unknown list") {
for {
response <- sendGetRequest(v2nodeListIri(ListIri.unsafeFrom("http://rdfh.ch/lists/0001/unknown")))
} yield assertTrue(response.status.code == 404)
},
test("return 404 for an existing root node") {
for {
response <- sendGetRequest(v2nodeListIri(knownRootNode))
} yield assertTrue(response.status.code == 404)
},
test("return 200 for an existing sub node") {
for {
response <- sendGetRequest(v2nodeListIri(knownSubNode))
bodyStr <- response.body.asString
} yield assertTrue(
response.status.code == 200,
bodyStr == """{
| "rdfs:label": "node 1",
| "knora-api:hasRootNode": {
| "@id": "http://rdfh.ch/lists/0001/notUsedList"
| },
| "knora-api:listNodePosition": 0,
| "@type": "knora-api:ListNode",
| "@id": "http://rdfh.ch/lists/0001/notUsedList01",
| "@context": {
| "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
| "knora-api": "http://api.knora.org/ontology/knora-api/v2#",
| "owl": "http://www.w3.org/2002/07/owl#",
| "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
| "xsd": "http://www.w3.org/2001/XMLSchema#"
| }
|}""".stripMargin,
)
},
),
)

}
8 changes: 4 additions & 4 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ object Dependencies {
val PekkoActorVersion = "1.0.3"
val PekkoHttpVersion = "1.0.1"
val JenaVersion = "5.0.0"
val Rdf4jVersion = "5.0.0"
val Rdf4jVersion = "5.0.1"

val ZioConfigVersion = "4.0.2"
val ZioLoggingVersion = "2.3.0"
val ZioNioVersion = "2.0.2"
val ZioMetricsConnectorsVersion = "2.3.1"
val ZioPreludeVersion = "1.0.0-RC27"
val ZioSchemaVersion = "0.2.0"
val ZioVersion = "2.1.5"
val ZioVersion = "2.1.6"

// ZIO
val zio = "dev.zio" %% "zio" % ZioVersion
Expand Down Expand Up @@ -97,7 +97,7 @@ object Dependencies {
val rdf4jClient = "org.eclipse.rdf4j" % "rdf4j-client" % Rdf4jVersion
val rdf4jShacl = "org.eclipse.rdf4j" % "rdf4j-shacl" % Rdf4jVersion
val rdf4jSparql = "org.eclipse.rdf4j" % "rdf4j-sparqlbuilder" % Rdf4jVersion
val saxonHE = "net.sf.saxon" % "Saxon-HE" % "12.4"
val saxonHE = "net.sf.saxon" % "Saxon-HE" % "12.5"
val scalaGraph =
"org.scala-graph" %% "graph-core" % "2.0.1" cross CrossVersion.for3Use2_13
val titaniumJSONLD = "com.apicatalog" % "titanium-json-ld" % "1.4.0"
Expand All @@ -115,7 +115,7 @@ object Dependencies {
// found/added by the plugin but deleted anyway
val commonsLang3 = "org.apache.commons" % "commons-lang3" % "3.14.0"

val tapirVersion = "1.10.10"
val tapirVersion = "1.10.13"

val tapir = Seq(
"com.softwaremill.sttp.tapir" %% "tapir-pekko-http-server" % tapirVersion,
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.10.0
sbt.version=1.10.1
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ addSbtPlugin("io.kamon" % "sbt-aspectj-runner" % "1.1.2")
addSbtPlugin("org.playframework.twirl" % "sbt-twirl" % "2.0.7")
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.2.0")
addSbtPlugin("com.github.sbt" % "sbt-javaagent" % "0.1.8")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.12")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.1.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1")
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
30.17.1
30.18.1
3 changes: 3 additions & 0 deletions webapi/src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -456,5 +456,8 @@ app {
features {
allow-erase-projects = false
allow-erase-projects = ${?ALLOW_ERASE_PROJECTS}

disable-last-modification-date-check = false
disable-last-modification-date-check = ${?DISABLE_LAST_MODIFICATION_DATE_CHECK}
}
}
Loading

0 comments on commit 413d5fa

Please sign in to comment.