Skip to content

Commit

Permalink
fix: Fix comment on list values (DEV-3647) (#3247)
Browse files Browse the repository at this point in the history
  • Loading branch information
seakayone authored May 17, 2024
1 parent 7ba8c8e commit cb933b7
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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,
),
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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"),
),
Expand All @@ -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"),
),
Expand All @@ -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"),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cb933b7

Please sign in to comment.