Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -2614,7 +2614,7 @@ object ValuesEndpointsE2ESpec extends E2EZSpec { self =>
},
test("update a text value with a comment") {
val resourceIri: IRI = AThing.iri
val valueAsString: String = "this is a text value that has an updated comment"
val valueAsString: String = "this is a text value that has a 'thoroughly' updated comment"
val valueHasComment: String = "this is an updated comment"
val propertyIri: SmartIri = "http://0.0.0.0:3333/ontology/0001/anything/v2#hasText".toSmartIri

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1206,11 +1206,12 @@ object TextValueContentV2 {
)
}

private def objectSparqlStringOption(r: Resource, property: String) = for {
private def objectSparqlStringOption(r: Resource, property: String): Either[String, Option[String]] = for {
str <- r.objectStringOption(property)
iri <- str match
case Some(s) => Right(Iri.toSparqlEncodedString(s))
case None => Right(None)
case Some(s) if s.strip.isEmpty => Right(None)
case None => Right(None)
case Some(s) => Right(Some(s))
} yield iri

def from(r: Resource): ZIO[MessageRelay, IRI, TextValueContentV2] = for {
Expand All @@ -1228,7 +1229,6 @@ object TextValueContentV2 {
textValue <-
getTextValue(maybeValueAsString, maybeTextValueAsXml, maybeValueHasLanguage, maybeMappingResponse, comment)
.mapError(_.getMessage)

} yield textValue
}

Expand Down