Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Patch dependency updates #3456

Merged
merged 20 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@

# Scala Steward: Reformat with scalafmt 3.8.3
a5523a0b097ee63e511bff6abf018d5ac6740288

# Scala Steward: Reformat with scalafmt 3.8.4
fb8d6ba614e93997749443355c7e59cdb12edf58
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = "3.8.3"
version = "3.8.4"
runner.dialect = scala3
maxColumn = 120
align.preset = most
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ object FileModelUtil {
}
val lines = ontologies.toList
.map(x => s""" "${x._1}": "${x._2}\"""")
.reduce({ (a, b) => a + ",\n" + b })
.reduce((a, b) => a + ",\n" + b)
s"""|"@context" : {
|$lines
| }
Expand Down
20 changes: 9 additions & 11 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,22 @@ object Dependencies {

val ScalaVersion = "3.3.4"

val PekkoActorVersion = "1.1.2"
val PekkoActorVersion = "1.1.3"
val PekkoHttpVersion = "1.1.0"

val MonocleVersion = "3.3.0"

// rdf and graph libraries
// topbraid/shacl is not yet compatible with jena 5 so we need to use jena 4 for now
// see: https://github.com/TopQuadrant/shacl/pull/177
val JenaVersion = "4.10.0"
val Rdf4jVersion = "5.1.0"
val TopbraidShaclVersion = "1.4.3"
val TopbraidShaclVersion = "1.4.4"
val JenaVersion = "5.2.0" // should be aligned with the version topbraid-shacl uses

val ZioConfigVersion = "4.0.2"
val ZioConfigVersion = "4.0.3"
val ZioLoggingVersion = "2.4.0"
val ZioNioVersion = "2.0.2"
val ZioMetricsConnectorsVersion = "2.3.1"
val ZioPreludeVersion = "1.0.0-RC36"
val ZioSchemaVersion = "0.2.0"
val ZioVersion = "2.1.13"
val ZioVersion = "2.1.14"

// ZIO
val zio = "dev.zio" %% "zio" % ZioVersion
Expand All @@ -47,7 +44,7 @@ object Dependencies {
val zioNio = "dev.zio" %% "zio-nio" % ZioNioVersion
val zioMacros = "dev.zio" %% "zio-macros" % ZioVersion
val zioPrelude = "dev.zio" %% "zio-prelude" % ZioPreludeVersion
val zioSttp = "com.softwaremill.sttp.client3" %% "zio" % "3.10.1"
val zioSttp = "com.softwaremill.sttp.client3" %% "zio" % "3.10.2"

// refined
val refined = Seq(
Expand Down Expand Up @@ -75,6 +72,7 @@ object Dependencies {
val pekkoStream = "org.apache.pekko" %% "pekko-stream" % PekkoActorVersion

// rdf and graph libraries
val jenaCore = "org.apache.jena" % "jena-core" % JenaVersion
val jenaText = "org.apache.jena" % "jena-text" % JenaVersion
val rdf4jClient = "org.eclipse.rdf4j" % "rdf4j-client" % Rdf4jVersion
val rdf4jShacl = "org.eclipse.rdf4j" % "rdf4j-shacl" % Rdf4jVersion
Expand All @@ -96,7 +94,7 @@ object Dependencies {
val jwtSprayJson = "com.github.jwt-scala" %% "jwt-zio-json" % "10.0.1"
// jwtSprayJson -> 9.0.2 is the latest version that's compatible with spray-json; if it wasn't for spray, this would be Scala 3 compatible
val springSecurityCore =
"org.springframework.security" % "spring-security-core" % "6.3.5" exclude (
"org.springframework.security" % "spring-security-core" % "6.3.6" exclude (
"commons-logging",
"commons-logging",
) exclude ("org.springframework", "spring-aop")
Expand Down Expand Up @@ -129,7 +127,7 @@ object Dependencies {
// found/added by the plugin but deleted anyway
val commonsLang3 = "org.apache.commons" % "commons-lang3" % "3.17.0"

val tapirVersion = "1.11.10"
val tapirVersion = "1.11.12"

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.6
sbt.version=1.10.7
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.3.0")
addSbtPlugin("com.github.sbt" % "sbt-javaagent" % "0.1.8")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.2.2")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.3")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0")
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ object StringFormatter {
private def getOrCacheSmartIri(iriStr: IRI, creationFun: () => SmartIri): SmartIri =
smartIriCache.computeIfAbsent(
iriStr,
JavaUtil.function({ (_: Object) => creationFun() }),
JavaUtil.function((_: Object) => creationFun()),
)

val live: ZLayer[AppConfig, Nothing, StringFormatter] = ZLayer.fromFunction { (appConfig: AppConfig) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ sealed trait JenaNode extends RdfNode {
}

case class JenaBlankNode(node: jena.graph.Node) extends JenaNode with BlankNode {
override def id: String = node.getBlankNodeId.getLabelString
override def id: String = node.getBlankNodeLabel

override def stringValue: String = id
}
Expand Down Expand Up @@ -126,7 +126,7 @@ object JenaContextFactory {
/**
* Converts a named graph IRI to a [[jena.graph.Node]].
*/
def contextIriToNode(context: IRI): jena.graph.Node =
private def contextIriToNode(context: IRI): jena.graph.Node =
jena.graph.NodeFactory.createURI(context)

/**
Expand Down Expand Up @@ -359,7 +359,7 @@ object JenaNodeFactory {
* @return a [[DatatypeLiteral]].
*/
def makeDatatypeLiteral(value: String, datatype: IRI): DatatypeLiteral =
JenaDatatypeLiteral(jena.graph.NodeFactory.createLiteral(value, typeMapper.getTypeByName(datatype)))
JenaDatatypeLiteral(jena.graph.NodeFactory.createLiteralDT(value, typeMapper.getTypeByName(datatype)))

/**
* Constructs a string with a language tag.
Expand All @@ -368,7 +368,7 @@ object JenaNodeFactory {
* @param language the language tag.
*/
def makeStringWithLanguage(value: String, language: String): StringWithLanguage =
JenaStringWithLanguage(jena.graph.NodeFactory.createLiteral(value, language))
JenaStringWithLanguage(jena.graph.NodeFactory.createLiteralLang(value, language))

/**
* Constructs a statement.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,41 +96,40 @@ object CreateOntologyRequestV2 {
apiRequestID: UUID,
requestingUser: User,
): ZIO[StringFormatter, Throwable, CreateOntologyRequestV2] = ZIO.serviceWithZIO[StringFormatter] {
implicit sf: StringFormatter =>
for {
isShared <- ZIO
.fromEither(jsonLDDocument.body.getBoolean(KnoraApiV2Complex.IsShared))
.mapBoth(BadRequestException(_), _.exists(identity))
ontologyName <-
ZIO.attempt {
jsonLDDocument.body.requireStringWithValidation(
KnoraApiV2Complex.OntologyName,
ValuesValidator.validateProjectSpecificOntologyName(_).getOrElse(_),
)
}
label <-
ZIO.attempt(
jsonLDDocument.body.requireStringWithValidation(Rdfs.Label, Iri.toSparqlEncodedString(_).getOrElse(_)),
)
comment <-
ZIO.attempt(
jsonLDDocument.body.maybeStringWithValidation(Rdfs.Comment, Iri.toSparqlEncodedString(_).getOrElse(_)),
implicit sf: StringFormatter => for {
isShared <- ZIO
.fromEither(jsonLDDocument.body.getBoolean(KnoraApiV2Complex.IsShared))
.mapBoth(BadRequestException(_), _.exists(identity))
ontologyName <-
ZIO.attempt {
jsonLDDocument.body.requireStringWithValidation(
KnoraApiV2Complex.OntologyName,
ValuesValidator.validateProjectSpecificOntologyName(_).getOrElse(_),
)
projectIri <- ZIO.attempt {
jsonLDDocument.body.requireIriInObject(
KnoraApiV2Complex.AttachedToProject,
sf.toSmartIriWithErr,
)
}
} yield CreateOntologyRequestV2(
ontologyName = ontologyName,
projectIri = projectIri,
isShared = isShared,
label = label,
comment = comment,
apiRequestID = apiRequestID,
requestingUser = requestingUser,
)
}
label <-
ZIO.attempt(
jsonLDDocument.body.requireStringWithValidation(Rdfs.Label, Iri.toSparqlEncodedString(_).getOrElse(_)),
)
comment <-
ZIO.attempt(
jsonLDDocument.body.maybeStringWithValidation(Rdfs.Comment, Iri.toSparqlEncodedString(_).getOrElse(_)),
)
projectIri <- ZIO.attempt {
jsonLDDocument.body.requireIriInObject(
KnoraApiV2Complex.AttachedToProject,
sf.toSmartIriWithErr,
)
}
} yield CreateOntologyRequestV2(
ontologyName = ontologyName,
projectIri = projectIri,
isShared = isShared,
label = label,
comment = comment,
apiRequestID = apiRequestID,
requestingUser = requestingUser,
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2186,14 +2186,11 @@ case class StillImageExternalFileValueContentV2(
case ApiV2Complex =>
JsonLDObject(
toJsonLDObjectMapInComplexSchema(makeFileUrl) ++ Map(
StillImageFileValueHasIIIFBaseUrl -> JsonLDUtil
.makeUriObject(
{
val uri = externalUrl.value.toURI
if (uri.getPort == -1) URI.create(s"${uri.getScheme}://${uri.getHost}").toURL
else URI.create(s"${uri.getScheme}://${uri.getHost}:${uri.getPort}").toURL
},
),
StillImageFileValueHasIIIFBaseUrl -> JsonLDUtil.makeUriObject {
val uri = externalUrl.value.toURI
if (uri.getPort == -1) URI.create(s"${uri.getScheme}://${uri.getHost}").toURL
else URI.create(s"${uri.getScheme}://${uri.getHost}:${uri.getPort}").toURL
},
StillImageFileValueHasExternalUrl -> JsonLDUtil.makeUriObject(externalUrl.value),
),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,16 @@ object IriLocker {
val newLock = lockMap.merge(
iri,
IriLock(apiRequestID, 1),
JavaUtil.biFunction({ (currentLock, _) =>
JavaUtil.biFunction((currentLock, _) =>
// The lock is already in use. Who has it?
if (currentLock.apiRequestID == apiRequestID) {
// We already have it, so increment the entry count.
currentLock.copy(entryCount = currentLock.entryCount + 1)
} else {
// Another API request has it, so leave it as is.
currentLock
}
}),
},
),
)
// Do we have the lock?
if (newLock.apiRequestID == apiRequestID) {
Expand Down Expand Up @@ -174,7 +174,7 @@ object IriLocker {
private def decrementOrReleaseLock(iri: IRI, apiRequestID: UUID): Unit = {
val _ = lockMap.compute(
iri,
JavaUtil.biFunction({ (_, maybeCurrentLock) =>
JavaUtil.biFunction((_, maybeCurrentLock) =>
Option(maybeCurrentLock) match {
case Some(currentLock) =>
if (currentLock.apiRequestID == apiRequestID) {
Expand All @@ -198,8 +198,8 @@ object IriLocker {
throw ApplicationLockException(
s"API request $apiRequestID was supposed to have an update lock on $iri, but the lock is unused",
)
}
}),
},
),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1628,14 +1628,13 @@ final case class ResourcesResponderV2(
)

// If there is a version history for deletion of the event, create a delete resource event for it.
(deletionRep, resourceAtValueChanges) = fullReps.tail.partition { case (resHist, resource) =>
resource
.asInstanceOf[ReadResourceV2]
.deletionInfo
.exists(deletionInfo =>
deletionInfo.deleteDate == resHist.versionDate,
)
}
(deletionRep, resourceAtValueChanges) =
fullReps.tail.partition { case (resHist, resource) =>
resource
.asInstanceOf[ReadResourceV2]
.deletionInfo
.exists(deletionInfo => deletionInfo.deleteDate == resHist.versionDate)
}
resourceDeleteEvent = getResourceDeletionEvents(deletionRep)

// For each value version, form an event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -997,10 +997,9 @@ final case class SearchResponderV2Live(
mainResourceVar: QueryVariable,
): SparqlSelectResult = {
// Make a Map of merged results per main resource IRI.
val prequeryRowsMergedMap: Map[IRI, VariableResultsRow] = prequeryResponseNotMerged.results.bindings.groupBy {
row =>
// Get the rows for each main resource IRI.
row.rowMap(mainResourceVar.variableName)
val prequeryRowsMergedMap: Map[IRI, VariableResultsRow] = prequeryResponseNotMerged.results.bindings.groupBy { row =>
// Get the rows for each main resource IRI.
row.rowMap(mainResourceVar.variableName)
}.map { case (resourceIri: IRI, rows: Seq[VariableResultsRow]) =>
// Make a Set of all the column names in the rows to be merged.
val columnNamesToMerge: Set[String] = rows.flatMap(_.rowMap.keySet).toSet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -778,8 +778,7 @@ object OntologyHelpers {
OntologyConstants.KnoraBase.IsAudioSegmentOfValue.toSmartIri
case subProps if subProps.contains(OntologyConstants.KnoraBase.IsVideoSegmentOf.toSmartIri) =>
OntologyConstants.KnoraBase.IsVideoSegmentOfValue.toSmartIri
case subProps
if subProps.size == 1 => // if subPropertyOf is neither isPartOf nor HasLinkTo it inherits from a custom link property
case subProps if subProps.size == 1 => // if subPropertyOf is neither isPartOf nor HasLinkTo it inherits from a custom link property
internalPropertyDef.subPropertyOf.head.fromLinkPropToLinkValueProp
case _ =>
throw BadRequestException(
Expand Down
Loading
Loading