Skip to content
Permalink
Browse files

fix(api-v2): Change link value comment (#1582)

  • Loading branch information
benjamingeer committed Feb 7, 2020
1 parent bbb42f6 commit faa2e552c2c93d71874518caa6763bf02dbbb6c0
@@ -1005,22 +1005,44 @@ object SharedTestDataADM {
}

def createLinkValueRequest(resourceIri: IRI,
targetResourceIri: IRI): String = {
s"""{
| "@id" : "$resourceIri",
| "@type" : "anything:Thing",
| "anything:hasOtherThingValue" : {
| "@type" : "knora-api:LinkValue",
| "knora-api:linkValueHasTargetIri" : {
| "@id" : "$targetResourceIri"
| }
| },
| "@context" : {
| "xsd" : "http://www.w3.org/2001/XMLSchema#",
| "knora-api" : "http://api.knora.org/ontology/knora-api/v2#",
| "anything" : "http://0.0.0.0:3333/ontology/0001/anything/v2#"
| }
|}""".stripMargin
targetResourceIri: IRI,
valueHasComment: Option[String] = None): String = {
valueHasComment match {
case Some(comment) =>
s"""{
| "@id" : "$resourceIri",
| "@type" : "anything:Thing",
| "anything:hasOtherThingValue" : {
| "@type" : "knora-api:LinkValue",
| "knora-api:linkValueHasTargetIri" : {
| "@id" : "$targetResourceIri"
| },
| "knora-api:valueHasComment" : "$comment"
| },
| "@context" : {
| "xsd" : "http://www.w3.org/2001/XMLSchema#",
| "knora-api" : "http://api.knora.org/ontology/knora-api/v2#",
| "anything" : "http://0.0.0.0:3333/ontology/0001/anything/v2#"
| }
|}""".stripMargin

case None =>
s"""{
| "@id" : "$resourceIri",
| "@type" : "anything:Thing",
| "anything:hasOtherThingValue" : {
| "@type" : "knora-api:LinkValue",
| "knora-api:linkValueHasTargetIri" : {
| "@id" : "$targetResourceIri"
| }
| },
| "@context" : {
| "xsd" : "http://www.w3.org/2001/XMLSchema#",
| "knora-api" : "http://api.knora.org/ontology/knora-api/v2#",
| "anything" : "http://0.0.0.0:3333/ontology/0001/anything/v2#"
| }
|}""".stripMargin
}
}

def updateIntValueRequest(resourceIri: IRI,
@@ -1430,23 +1452,46 @@ object SharedTestDataADM {

def updateLinkValueRequest(resourceIri: IRI,
valueIri: IRI,
targetResourceIri: IRI): String = {
s"""{
| "@id" : "$resourceIri",
| "@type" : "anything:Thing",
| "anything:hasOtherThingValue" : {
| "@id" : "$valueIri",
| "@type" : "knora-api:LinkValue",
| "knora-api:linkValueHasTargetIri" : {
| "@id" : "$targetResourceIri"
| }
| },
| "@context" : {
| "xsd" : "http://www.w3.org/2001/XMLSchema#",
| "knora-api" : "http://api.knora.org/ontology/knora-api/v2#",
| "anything" : "http://0.0.0.0:3333/ontology/0001/anything/v2#"
| }
|}""".stripMargin
targetResourceIri: IRI,
comment: Option[String] = None): String = {
comment match {
case Some(definedComment) =>
s"""{
| "@id" : "$resourceIri",
| "@type" : "anything:Thing",
| "anything:hasOtherThingValue" : {
| "@id" : "$valueIri",
| "@type" : "knora-api:LinkValue",
| "knora-api:linkValueHasTargetIri" : {
| "@id" : "$targetResourceIri"
| },
| "knora-api:valueHasComment" : "$definedComment"
| },
| "@context" : {
| "xsd" : "http://www.w3.org/2001/XMLSchema#",
| "knora-api" : "http://api.knora.org/ontology/knora-api/v2#",
| "anything" : "http://0.0.0.0:3333/ontology/0001/anything/v2#"
| }
|}""".stripMargin

case None =>
s"""{
| "@id" : "$resourceIri",
| "@type" : "anything:Thing",
| "anything:hasOtherThingValue" : {
| "@id" : "$valueIri",
| "@type" : "knora-api:LinkValue",
| "knora-api:linkValueHasTargetIri" : {
| "@id" : "$targetResourceIri"
| }
| },
| "@context" : {
| "xsd" : "http://www.w3.org/2001/XMLSchema#",
| "knora-api" : "http://api.knora.org/ontology/knora-api/v2#",
| "anything" : "http://0.0.0.0:3333/ontology/0001/anything/v2#"
| }
|}""".stripMargin
}
}

def updateStillImageFileValueRequest(resourceIri: IRI,

0 comments on commit faa2e55

Please sign in to comment.