From e8d9a82473d04bfa1b6147fcf1f79e2321bc66ee Mon Sep 17 00:00:00 2001 From: Raitis Veinbahs Date: Wed, 24 Apr 2024 14:29:13 +0200 Subject: [PATCH] refactor: Remove unused trait IOValueV2 --- .../webapi/models/filemodels/FileModels.scala | 9 ++------- .../resourcemessages/ResourceMessagesV2.scala | 7 +------ .../valuemessages/ValueMessagesV2.scala | 17 ++++------------- 3 files changed, 7 insertions(+), 26 deletions(-) diff --git a/integration/src/test/scala/org/knora/webapi/models/filemodels/FileModels.scala b/integration/src/test/scala/org/knora/webapi/models/filemodels/FileModels.scala index 8412a29df4..6553d945f1 100644 --- a/integration/src/test/scala/org/knora/webapi/models/filemodels/FileModels.scala +++ b/integration/src/test/scala/org/knora/webapi/models/filemodels/FileModels.scala @@ -241,18 +241,13 @@ object ChangeFileRequest { valueIri: String, className: Option[String] = None, ontologyName: String = "knora-api", - ): ChangeFileRequest = { - val classNameWithDefaults = className match { - case Some(v) => v - case None => FileModelUtil.getDefaultClassName(fileType) - } + ): ChangeFileRequest = new ChangeFileRequest( fileType = fileType, internalFilename = internalFilename, resourceIRI = resourceIri, valueIRI = valueIri, - className = classNameWithDefaults, + className = className.getOrElse(FileModelUtil.getDefaultClassName(fileType)), ontologyName = ontologyName, ) {} - } } diff --git a/webapi/src/main/scala/org/knora/webapi/messages/v2/responder/resourcemessages/ResourceMessagesV2.scala b/webapi/src/main/scala/org/knora/webapi/messages/v2/responder/resourcemessages/ResourceMessagesV2.scala index 56fd2d46d5..4a5f656d75 100644 --- a/webapi/src/main/scala/org/knora/webapi/messages/v2/responder/resourcemessages/ResourceMessagesV2.scala +++ b/webapi/src/main/scala/org/knora/webapi/messages/v2/responder/resourcemessages/ResourceMessagesV2.scala @@ -352,11 +352,6 @@ sealed trait ResourceV2 { * The resource's `rdfs:label`. */ def label: String - - /** - * A map of property IRIs to [[IOValueV2]] objects. - */ - def values: Map[SmartIri, Seq[IOValueV2]] } /** @@ -599,7 +594,7 @@ case class CreateValueInNewResourceV2( customValueUUID: Option[UUID] = None, customValueCreationDate: Option[Instant] = None, permissions: Option[String] = None, -) extends IOValueV2 +) /** * Represents a Knora resource to be created. diff --git a/webapi/src/main/scala/org/knora/webapi/messages/v2/responder/valuemessages/ValueMessagesV2.scala b/webapi/src/main/scala/org/knora/webapi/messages/v2/responder/valuemessages/ValueMessagesV2.scala index 8f95b82909..855608e316 100644 --- a/webapi/src/main/scala/org/knora/webapi/messages/v2/responder/valuemessages/ValueMessagesV2.scala +++ b/webapi/src/main/scala/org/knora/webapi/messages/v2/responder/valuemessages/ValueMessagesV2.scala @@ -265,7 +265,7 @@ case class GenerateSparqlForValueInNewResourceV2( customValueUUID: Option[UUID], customValueCreationDate: Option[Instant], permissions: String, -) extends IOValueV2 +) /** * Represents a response to a [[GenerateSparqlToCreateMultipleValuesRequestV2]], providing a string that can be @@ -283,14 +283,6 @@ case class GenerateSparqlToCreateMultipleValuesResponseV2( hasStandoffLink: Boolean, ) -/** - * The value of a Knora property in the context of some particular input or output operation. - * Any implementation of `IOValueV2` is an API operation-specific wrapper of a `ValueContentV2`. - */ -trait IOValueV2 { - def valueContent: ValueContentV2 -} - /** * Provides information about the deletion of a resource or value. * @@ -322,7 +314,7 @@ case class DeletionInfo(deleteDate: Instant, maybeDeleteComment: Option[String]) /** * Represents a Knora value as read from the triplestore. */ -sealed trait ReadValueV2 extends IOValueV2 { +sealed trait ReadValueV2 { /** * The IRI of the value. @@ -611,7 +603,7 @@ case class CreateValueV2( valueCreationDate: Option[Instant] = None, permissions: Option[String] = None, ingestState: AssetIngestState = AssetInTemp, -) extends IOValueV2 +) /** * Constructs [[CreateValueV2]] instances based on JSON-LD input. @@ -935,8 +927,7 @@ case class UpdateValueContentV2( permissions: Option[String] = None, valueCreationDate: Option[Instant] = None, newValueVersionIri: Option[SmartIri] = None, -) extends IOValueV2 - with UpdateValueV2 +) extends UpdateValueV2 /** * New permissions for a value.