diff --git a/integration/src/test/scala/org/knora/webapi/responders/v2/ResourcesResponderV2Spec.scala b/integration/src/test/scala/org/knora/webapi/responders/v2/ResourcesResponderV2Spec.scala index 6dcead0ba4..d12b3d2cc2 100644 --- a/integration/src/test/scala/org/knora/webapi/responders/v2/ResourcesResponderV2Spec.scala +++ b/integration/src/test/scala/org/knora/webapi/responders/v2/ResourcesResponderV2Spec.scala @@ -1048,10 +1048,8 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender { ), "http://0.0.0.0:3333/ontology/0001/anything/v2#hasListItem".toSmartIri -> Seq( CreateValueInNewResourceV2( - valueContent = HierarchicalListValueContentV2( - ontologySchema = ApiV2Complex, - valueHasListNode = "http://rdfh.ch/lists/0001/treeList03", - ), + valueContent = + HierarchicalListValueContentV2(ApiV2Complex, "http://rdfh.ch/lists/0001/treeList03", None, None), ), ), "http://0.0.0.0:3333/ontology/0001/anything/v2#hasColor".toSmartIri -> Seq( @@ -1555,8 +1553,10 @@ class ResourcesResponderV2Spec extends CoreSpec with ImplicitSender { "http://0.0.0.0:3333/ontology/0001/anything/v2#hasListItem".toSmartIri -> Seq( CreateValueInNewResourceV2( valueContent = HierarchicalListValueContentV2( - ontologySchema = ApiV2Complex, - valueHasListNode = "http://rdfh.ch/lists/0001/nonexistent-list-node", + ApiV2Complex, + "http://rdfh.ch/lists/0001/nonexistent-list-node", + None, + None, ), ), ), diff --git a/integration/src/test/scala/org/knora/webapi/responders/v2/SearchResponderV2SpecFullData.scala b/integration/src/test/scala/org/knora/webapi/responders/v2/SearchResponderV2SpecFullData.scala index bfeda2a9f4..cac9a6ea0c 100644 --- a/integration/src/test/scala/org/knora/webapi/responders/v2/SearchResponderV2SpecFullData.scala +++ b/integration/src/test/scala/org/knora/webapi/responders/v2/SearchResponderV2SpecFullData.scala @@ -45,10 +45,7 @@ class SearchResponderV2SpecFullData(implicit stringFormatter: StringFormatter) { deletionInfo = None, ) val listValueTemplateReadOtherValue: ReadOtherValueV2 = ReadOtherValueV2( - valueContent = HierarchicalListValueContentV2( - ontologySchema = InternalSchema, - valueHasListNode = "", - ), + valueContent = HierarchicalListValueContentV2(InternalSchema, "", None, None), valueIri = "", valueHasUUID = UuidUtil.decode("d34d34d3-4d34-d34d-3496-2b2dfef6a5b9"), permissions = @@ -285,10 +282,8 @@ class SearchResponderV2SpecFullData(implicit stringFormatter: StringFormatter) { values = Map( booksHasTextType.toSmartIri -> Vector( listValueTemplateReadOtherValue.copy( - valueContent = HierarchicalListValueContentV2( - ontologySchema = InternalSchema, - valueHasListNode = "http://rdfh.ch/lists/0001/ynm02-03", - ), + valueContent = + HierarchicalListValueContentV2(InternalSchema, "http://rdfh.ch/lists/0001/ynm02-03", None, None), valueIri = "http://rdfh.ch/0001/book-instance-02/values/has-list-value-01", valueHasUUID = UuidUtil.decode("d34d34d3-4d34-d34d-3496-2b2dfef6a5b9"), ), @@ -306,10 +301,8 @@ class SearchResponderV2SpecFullData(implicit stringFormatter: StringFormatter) { values = Map( booksHasTextType.toSmartIri -> Vector( listValueTemplateReadOtherValue.copy( - valueContent = HierarchicalListValueContentV2( - ontologySchema = InternalSchema, - valueHasListNode = "http://rdfh.ch/lists/0001/ynm02-04", - ), + valueContent = + HierarchicalListValueContentV2(InternalSchema, "http://rdfh.ch/lists/0001/ynm02-04", None, None), valueIri = "http://rdfh.ch/0001/book-instance-03/values/has-list-value-02", valueHasUUID = UuidUtil.decode("d34d3496-2b2d-fef6-a5b9-efdf6a7b5ab3"), ), @@ -322,10 +315,8 @@ class SearchResponderV2SpecFullData(implicit stringFormatter: StringFormatter) { values = Map( booksHasTextType.toSmartIri -> Vector( listValueTemplateReadOtherValue.copy( - valueContent = HierarchicalListValueContentV2( - ontologySchema = InternalSchema, - valueHasListNode = "http://rdfh.ch/lists/0001/ynm02-05", - ), + valueContent = + HierarchicalListValueContentV2(InternalSchema, "http://rdfh.ch/lists/0001/ynm02-05", None, None), valueIri = "http://rdfh.ch/0001/book-instance-04/values/has-list-value-03", valueHasUUID = UuidUtil.decode("d34962b2-dfef-6a5b-9efd-a76f7a7b6ead"), ), diff --git a/integration/src/test/scala/org/knora/webapi/responders/v2/ValuesResponderV2Spec.scala b/integration/src/test/scala/org/knora/webapi/responders/v2/ValuesResponderV2Spec.scala index cea05a3f2b..3ac150df90 100644 --- a/integration/src/test/scala/org/knora/webapi/responders/v2/ValuesResponderV2Spec.scala +++ b/integration/src/test/scala/org/knora/webapi/responders/v2/ValuesResponderV2Spec.scala @@ -1845,10 +1845,7 @@ class ValuesResponderV2Spec extends CoreSpec with ImplicitSender { resourceIri = resourceIri, resourceClassIri = "http://0.0.0.0:3333/ontology/0001/anything/v2#Thing".toSmartIri, propertyIri = propertyIri, - valueContent = HierarchicalListValueContentV2( - ontologySchema = ApiV2Complex, - valueHasListNode = valueHasListNode, - ), + valueContent = HierarchicalListValueContentV2(ApiV2Complex, valueHasListNode, None, None), ), requestingUser = anythingUser1, apiRequestID = randomUUID, @@ -1889,10 +1886,7 @@ class ValuesResponderV2Spec extends CoreSpec with ImplicitSender { resourceIri = resourceIri, resourceClassIri = "http://0.0.0.0:3333/ontology/0001/anything/v2#Thing".toSmartIri, propertyIri = propertyIri, - valueContent = HierarchicalListValueContentV2( - ontologySchema = ApiV2Complex, - valueHasListNode = valueHasListNode, - ), + valueContent = HierarchicalListValueContentV2(ApiV2Complex, valueHasListNode, None, None), ), requestingUser = anythingUser1, apiRequestID = randomUUID, @@ -1914,10 +1908,7 @@ class ValuesResponderV2Spec extends CoreSpec with ImplicitSender { resourceIri = resourceIri, resourceClassIri = "http://0.0.0.0:3333/ontology/0001/anything/v2#Thing".toSmartIri, propertyIri = propertyIri, - valueContent = HierarchicalListValueContentV2( - ontologySchema = ApiV2Complex, - valueHasListNode = valueHasListNode, - ), + valueContent = HierarchicalListValueContentV2(ApiV2Complex, valueHasListNode, None, None), ), requestingUser = anythingUser1, apiRequestID = randomUUID, @@ -1940,10 +1931,7 @@ class ValuesResponderV2Spec extends CoreSpec with ImplicitSender { resourceIri = resourceIri, resourceClassIri = resourceClassIri, propertyIri = propertyIri, - valueContent = HierarchicalListValueContentV2( - ontologySchema = ApiV2Complex, - valueHasListNode = valueHasListNode, - ), + valueContent = HierarchicalListValueContentV2(ApiV2Complex, valueHasListNode, None, None), ), requestingUser = anythingUser1, apiRequestID = randomUUID, @@ -3739,10 +3727,7 @@ class ValuesResponderV2Spec extends CoreSpec with ImplicitSender { resourceClassIri = "http://0.0.0.0:3333/ontology/0001/anything/v2#Thing".toSmartIri, propertyIri = propertyIri, valueIri = listValueIri.get, - valueContent = HierarchicalListValueContentV2( - ontologySchema = ApiV2Complex, - valueHasListNode = valueHasListNode, - ), + valueContent = HierarchicalListValueContentV2(ApiV2Complex, valueHasListNode, None, None), ), anythingUser1, randomUUID, @@ -3783,10 +3768,7 @@ class ValuesResponderV2Spec extends CoreSpec with ImplicitSender { resourceClassIri = "http://0.0.0.0:3333/ontology/0001/anything/v2#Thing".toSmartIri, propertyIri = propertyIri, valueIri = listValueIri.get, - valueContent = HierarchicalListValueContentV2( - ontologySchema = ApiV2Complex, - valueHasListNode = valueHasListNode, - ), + valueContent = HierarchicalListValueContentV2(ApiV2Complex, valueHasListNode, None, None), ), anythingUser1, randomUUID, @@ -3809,10 +3791,7 @@ class ValuesResponderV2Spec extends CoreSpec with ImplicitSender { resourceClassIri = "http://0.0.0.0:3333/ontology/0001/anything/v2#Thing".toSmartIri, propertyIri = propertyIri, valueIri = listValueIri.get, - valueContent = HierarchicalListValueContentV2( - ontologySchema = ApiV2Complex, - valueHasListNode = valueHasListNode, - ), + valueContent = HierarchicalListValueContentV2(ApiV2Complex, valueHasListNode, None, None), ), anythingUser1, randomUUID, 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 79716f4289..a513528d6b 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 @@ -2281,8 +2281,8 @@ object TimeValueContentV2 { case class HierarchicalListValueContentV2( ontologySchema: OntologySchema, valueHasListNode: IRI, - listNodeLabel: Option[String] = None, - comment: Option[String] = None, + listNodeLabel: Option[String], + comment: Option[String], ) extends ValueContentV2 { override def valueType: SmartIri = { implicit val stringFormatter: StringFormatter = StringFormatter.getGeneralInstance @@ -2366,7 +2366,7 @@ object HierarchicalListValueContentV2 { .fail(BadRequestException(s"List node IRI <$listValueAsListNode> is not a Knora data IRI")) .when(!listValueAsListNode.isKnoraDataIri) comment <- JsonLDUtil.getComment(jsonLDObject) - } yield HierarchicalListValueContentV2(ApiV2Complex, listValueAsListNode.toString, comment) + } yield HierarchicalListValueContentV2(ApiV2Complex, listValueAsListNode.toString, None, comment) } } diff --git a/webapi/src/main/scala/org/knora/webapi/responders/v2/SearchResponderV2.scala b/webapi/src/main/scala/org/knora/webapi/responders/v2/SearchResponderV2.scala index a40b863314..8664595a51 100644 --- a/webapi/src/main/scala/org/knora/webapi/responders/v2/SearchResponderV2.scala +++ b/webapi/src/main/scala/org/knora/webapi/responders/v2/SearchResponderV2.scala @@ -52,7 +52,6 @@ import org.knora.webapi.messages.v2.responder.ontologymessages.ReadPropertyInfoV import org.knora.webapi.messages.v2.responder.resourcemessages.* import org.knora.webapi.slice.admin.domain.model.KnoraProject.ProjectIri import org.knora.webapi.slice.admin.domain.model.User -import org.knora.webapi.slice.admin.domain.service.ProjectService import org.knora.webapi.slice.ontology.repo.service.OntologyCache import org.knora.webapi.slice.resourceinfo.domain.IriConverter import org.knora.webapi.store.triplestore.api.TriplestoreService