Skip to content

Commit

Permalink
add value handling
Browse files Browse the repository at this point in the history
  • Loading branch information
seakayone committed Nov 18, 2024
1 parent 8426a20 commit 28a7483
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ class ValuesRouteV2E2ESpec extends E2ESpec {
private val customValueIri: IRI = s"http://rdfh.ch/0001/a-thing/values/$customValueUUID"

"The values v2 endpoint" should {

"get the latest versions of values, given their UUIDs" in {
// The UUIDs of values in TestDing.
val testDingValues: Map[String, String] = Map(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,7 @@ class ValuesResponderV2Spec extends CoreSpec with ImplicitSender {
}

"The values responder" should {

"create an integer value" in {
// Add the value.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import java.time.Instant
import java.util.UUID
import scala.language.implicitConversions
import scala.util.Try

import dsp.errors.AssertionException
import dsp.errors.BadRequestException
import dsp.errors.NotFoundException
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ final case class ValuesResponderV2(
/**
* Creates an ordinary value (i.e. not a link), using an existing transaction, assuming that pre-update checks have already been done.
*
* @param resourceInfo information about the the resource in which to create the value.
* @param resourceInfo information about the resource in which to create the value.
* @param propertyIri the property that should point to the value.
* @param value an [[ValueContentV2]] describing the value.
* @param maybeValueIri the optional custom IRI supplied for the value.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package org.knora.webapi.slice.resources.repo.model

import java.time.Instant
import java.util.UUID

import org.knora.webapi.messages.util.CalendarNameV2
import org.knora.webapi.messages.util.DatePrecisionV2
import org.knora.webapi.slice.admin.domain.model.KnoraProject.CopyrightAttribution
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import org.eclipse.rdf4j.sparqlbuilder.rdf.RdfPredicateObjectList
import zio.*

import java.time.Instant

import dsp.valueobjects.UuidUtil
import org.knora.webapi.slice.common.repo.rdf.Vocabulary.KnoraBase as KB
import org.knora.webapi.slice.resourceinfo.domain.InternalIri
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,20 @@ DELETE {
case None => {}
}

@fileValueContentV2.fileValue.copyrightAttribution match {
case Some(copyrightAttribution) => {
<@newValueIri> knora-base:hasCopyrightAttribution """@copyrightAttribution.value""" .
}
case None => {}
}

@fileValueContentV2.fileValue.license match {
case Some(license) => {
<@newValueIri> knora-base:hasLicense """@license.value""" .
}
case None => {}
}

@fileValueContentV2 match {
case stillImageFileValue: StillImageFileValueContentV2 => {
<@newValueIri> knora-base:dimX @stillImageFileValue.dimX ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,20 @@ DELETE {
case None => {}
}

@fileValueContentV2.fileValue.copyrightAttribution match {
case Some(copyrightAttribution) => {
<@newValueIri> knora-base:hasCopyrightAttribution """@copyrightAttribution.value""" .
}
case None => {}
}

@fileValueContentV2.fileValue.license match {
case Some(license) => {
<@newValueIri> knora-base:hasLicense """@license.value""" .
}
case None => {}
}

@fileValueContentV2 match {
case stillImageFileValue: StillImageFileValueContentV2 => {
<@newValueIri> knora-base:dimX @stillImageFileValue.dimX ;
Expand Down

0 comments on commit 28a7483

Please sign in to comment.