diff --git a/webapi/src/main/scala/org/knora/webapi/slice/resources/repo/service/ResourcesRepoLive.scala b/webapi/src/main/scala/org/knora/webapi/slice/resources/repo/service/ResourcesRepoLive.scala index 837daa0b09..385da3bf07 100644 --- a/webapi/src/main/scala/org/knora/webapi/slice/resources/repo/service/ResourcesRepoLive.scala +++ b/webapi/src/main/scala/org/knora/webapi/slice/resources/repo/service/ResourcesRepoLive.scala @@ -21,10 +21,13 @@ import java.time.Instant import java.util.UUID import dsp.constants.SalsahGui.IRI +import dsp.valueobjects.UuidUtil import org.knora.webapi.messages.twirl.NewLinkValueInfo import org.knora.webapi.messages.twirl.NewValueInfo import org.knora.webapi.messages.twirl.TypeSpecificValueInfo import org.knora.webapi.messages.twirl.queries.sparql +import org.knora.webapi.messages.util.CalendarNameGregorian +import org.knora.webapi.messages.util.DatePrecisionDay import org.knora.webapi.slice.resourceinfo.domain.InternalIri import org.knora.webapi.store.triplestore.api.TriplestoreService import org.knora.webapi.store.triplestore.api.TriplestoreService.Queries.Update @@ -125,8 +128,9 @@ object ResourcesRepoLive { .isA(iri(newValueInfo.valueTypeIri)) .andHas(KnoraBaseVocab.isDeleted, Rdf.literalOf(false)) .andHas(KnoraBaseVocab.valueHasString, Rdf.literalOf(newValueInfo.valueHasString)) - .andHas(KnoraBaseVocab.valueHasUUID, Rdf.literalOf(newValueInfo.valueUUID.toString)) + .andHas(KnoraBaseVocab.valueHasUUID, Rdf.literalOf(UuidUtil.base64Encode(newValueInfo.valueUUID))) .andHas(KnoraBaseVocab.attachedToUser, iri(newValueInfo.valueCreator)) + .andHas(KnoraBaseVocab.hasPermissions, Rdf.literalOf(newValueInfo.valuePermissions)) .andHas(KnoraBaseVocab.valueHasOrder, Rdf.literalOf(newValueInfo.valueHasOrder)) .andHas( KnoraBaseVocab.valueCreationDate, @@ -153,15 +157,15 @@ object ResourcesRepoLive { valuePattern.andHas(KnoraBaseVocab.valueHasDecimal, Rdf.literalOf(valueHasDecimal)) case TypeSpecificValueInfo.BooleanValueInfo(valueHasBoolean) => valuePattern.andHas(KnoraBaseVocab.valueHasBoolean, Rdf.literalOf(valueHasBoolean)) - case TypeSpecificValueInfo.UriValueInfo(valueHasUri) => ??? - case TypeSpecificValueInfo.DateValueInfo( - valueHasStartJDN, - valueHasEndJDN, - valueHasStartPrecision, - valueHasEndPrecision, - valueHasCalendar, - ) => - ??? + case TypeSpecificValueInfo.UriValueInfo(valueHasUri) => + valuePattern.andHas(KnoraBaseVocab.valueHasUri, Rdf.literalOf(valueHasUri)) + case TypeSpecificValueInfo.DateValueInfo(startJDN, endJDN, startPrecision, endPrecision, calendar) => + valuePattern + .andHas(KnoraBaseVocab.valueHasStartJDN, Rdf.literalOf(startJDN)) + .andHas(KnoraBaseVocab.valueHasEndJDN, Rdf.literalOf(endJDN)) + .andHas(KnoraBaseVocab.valueHasStartPrecision, Rdf.literalOf(startPrecision.toString())) + .andHas(KnoraBaseVocab.valueHasEndPrecision, Rdf.literalOf(endPrecision.toString())) + .andHas(KnoraBaseVocab.valueHasCalendar, Rdf.literalOf(calendar.toString())) case TypeSpecificValueInfo.ColorValueInfo(valueHasColor) => ??? case TypeSpecificValueInfo.GeomValueInfo(valueHasGeometry) => ??? case TypeSpecificValueInfo.StillImageFileValueInfo( @@ -229,9 +233,16 @@ object KnoraBaseVocab { val valueHasOrder = iri(kb + "valueHasOrder") val valueCreationDate = iri(kb + "valueCreationDate") - val valueHasInteger = iri(kb + "valueHasInteger") - val valueHasBoolean = iri(kb + "valueHasBoolean") - val valueHasDecimal = iri(kb + "valueHasDecimal") + val valueHasInteger = iri(kb + "valueHasInteger") + val valueHasBoolean = iri(kb + "valueHasBoolean") + val valueHasDecimal = iri(kb + "valueHasDecimal") + val valueHasUri = iri(kb + "valueHasUri") + val valueHasStartJDN = iri(kb + "valueHasStartJDN") + val valueHasEndJDN = iri(kb + "valueHasEndJDN") + val valueHasStartPrecision = iri(kb + "valueHasStartPrecision") + val valueHasEndPrecision = iri(kb + "valueHasEndPrecision") + val valueHasCalendar = iri(kb + "valueHasCalendar") + } object Run extends ZIOAppDefault { @@ -293,6 +304,42 @@ object Run extends ZIOAppDefault { valueHasString = "42.42", comment = None, ), + // uri value + NewValueInfo( + resourceIri = resourceIri, + propertyIri = "fooUriProp", + valueIri = "fooUriValueIri", + valueTypeIri = "UriValue", + valueUUID = UUID.randomUUID(), + value = TypeSpecificValueInfo.UriValueInfo("http://example.com"), + valuePermissions = permissions, + valueCreator = userIri, + creationDate = creationDate, + valueHasOrder = 4, + valueHasString = "http://example.com", + comment = None, + ), + // date value + NewValueInfo( + resourceIri = resourceIri, + propertyIri = "fooDateProp", + valueIri = "fooDateValueIri", + valueTypeIri = "DateValue", + valueUUID = UUID.randomUUID(), + value = TypeSpecificValueInfo.DateValueInfo( + 0, + 0, + DatePrecisionDay, + DatePrecisionDay, + CalendarNameGregorian, + ), + valuePermissions = permissions, + valueCreator = userIri, + creationDate = creationDate, + valueHasOrder = 5, + valueHasString = "2024-01-01T10:00:00.673298Z", + comment = None, + ), ) val resourceDefinition = ResourceReadyToCreate( diff --git a/webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/createNewResource.scala.txt b/webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/createNewResource.scala.txt index 01362fb2e6..7734b617a3 100644 --- a/webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/createNewResource.scala.txt +++ b/webapi/src/main/twirl/org/knora/webapi/messages/twirl/queries/sparql/v2/createNewResource.scala.txt @@ -26,30 +26,42 @@ PREFIX rdf: PREFIX rdfs: -PREFIX owl: PREFIX xsd: PREFIX knora-base: INSERT DATA { GRAPH <@dataNamedGraph> { <@resourceIri> rdf:type <@resourceClassIri> ; + rdfs:label """@resourceLabel""" ; knora-base:isDeleted false ; knora-base:attachedToUser <@creatorIri> ; knora-base:attachedToProject <@projectIri> ; - rdfs:label """@resourceLabel""" ; knora-base:hasPermissions "@permissions" ; knora-base:creationDate "@creationDate"^^xsd:dateTime . + @* Attach the value to the resource. *@ + @for(newValueInfo <- newValueInfos) { # Value: @newValueInfo.valueIri # Property: @newValueInfo.propertyIri + <@newValueInfo.resourceIri> <@newValueInfo.propertyIri> <@newValueInfo.valueIri> . @* Construct the value. *@ <@newValueInfo.valueIri> rdf:type <@newValueInfo.valueTypeIri> ; knora-base:isDeleted false ; knora-base:valueHasString """@newValueInfo.valueHasString""" ; knora-base:valueHasUUID "@{UuidUtil.base64Encode(newValueInfo.valueUUID)}" . + @* Insert the value's comment, if given. *@ + @newValueInfo.comment.map { commentStr => + <@newValueInfo.valueIri> knora-base:valueHasComment """@commentStr""" . + } + + <@newValueInfo.valueIri> knora-base:attachedToUser <@newValueInfo.valueCreator> ; + knora-base:hasPermissions "@newValueInfo.valuePermissions"^^xsd:string ; + knora-base:valueHasOrder @newValueInfo.valueHasOrder ; + knora-base:valueCreationDate "@newValueInfo.creationDate"^^xsd:dateTime . + @newValueInfo.value match { case linkValue: LinkValueInfo => { @@ -217,19 +229,6 @@ INSERT DATA { <@newValueInfo.valueIri> knora-base:valueHasGeonameCode """@geonameValue.valueHasGeonameCode""" . } } - - @* Insert the value's comment, if given. *@ - @newValueInfo.comment.map { commentStr => - <@newValueInfo.valueIri> knora-base:valueHasComment """@commentStr""" . - } - - <@newValueInfo.valueIri> knora-base:attachedToUser <@newValueInfo.valueCreator> ; - knora-base:hasPermissions "@newValueInfo.valuePermissions"^^xsd:string ; - knora-base:valueHasOrder @newValueInfo.valueHasOrder ; - knora-base:valueCreationDate "@newValueInfo.creationDate"^^xsd:dateTime . - - @* Attach the value to the resource. *@ - <@newValueInfo.resourceIri> <@newValueInfo.propertyIri> <@newValueInfo.valueIri> . } diff --git a/webapi/src/test/scala/org/knora/webapi/slice/resources/repo/service/ResourcesRepoLiveSpec.scala b/webapi/src/test/scala/org/knora/webapi/slice/resources/repo/service/ResourcesRepoLiveSpec.scala index 28833bf13f..a9bcdc61e2 100644 --- a/webapi/src/test/scala/org/knora/webapi/slice/resources/repo/service/ResourcesRepoLiveSpec.scala +++ b/webapi/src/test/scala/org/knora/webapi/slice/resources/repo/service/ResourcesRepoLiveSpec.scala @@ -5,6 +5,7 @@ package org.knora.webapi.slice.resources.repo.service +import org.apache.jena.update.UpdateFactory import zio.* import zio.test.* @@ -14,264 +15,252 @@ import java.util.UUID import dsp.valueobjects.UuidUtil import org.knora.webapi.messages.OntologyConstants import org.knora.webapi.messages.StringFormatter -import org.knora.webapi.messages.twirl.NewLinkValueInfo import org.knora.webapi.messages.twirl.NewValueInfo import org.knora.webapi.messages.twirl.TypeSpecificValueInfo import org.knora.webapi.slice.resourceinfo.domain.InternalIri import org.knora.webapi.store.triplestore.api.TriplestoreService.Queries.Update object ResourcesRepoLiveSpec extends ZIOSpecDefault { - def spec: Spec[Environment & (TestEnvironment & Scope), Any] = tests.provide(StringFormatter.test) - val tests: Spec[StringFormatter, Nothing] = - suite("ResourcesRepoLiveSpec")( - test("Create new resource query without values") { - val tripleQuotes = "\"\"\"" + private def assertUpdateQueriesEqual(expected: Update, actual: Update) = { + val parsedExpected = UpdateFactory.create(expected.sparql) + val parsedActual = UpdateFactory.create(actual.sparql) + if (parsedExpected.equalTo(parsedActual)) { + assertTrue(true) + } else { + val expectedStr = parsedExpected.toString() + val actualStr = parsedActual.toString() + assertTrue(expectedStr == actualStr) + } + } - val graphIri = InternalIri("fooGraph") - val projectIri = "fooProject" - val userIri = "fooUser" - val resourceIri = "fooResource" - val resourceClassIri = "fooClass" - val label = "fooLabel" - val creationDate = Instant.parse("2024-01-01T10:00:00.673298Z") - val permissions = "fooPermissions" + def spec: Spec[Environment & (TestEnvironment & Scope), Any] = tests.provide(StringFormatter.test) - val resourceDefinition = ResourceReadyToCreate( - resourceIri = resourceIri, - resourceClassIri = resourceClassIri, - resourceLabel = label, - creationDate = creationDate, - permissions = permissions, - newValueInfos = Seq.empty, - linkUpdates = Seq.empty, - ) + val graphIri = InternalIri("foo:Graph") + val projectIri = "foo:ProjectIri" + val userIri = "foo:UserIri" + val resourceIri = "foo:ResourceInstanceIri" + val resourceClassIri = "foo:ClassIri" + val label = "foo Label" + val creationDate = Instant.parse("2024-01-01T10:00:00.673298Z") + val permissions = "fooPermissionsString" + val valueIri = "foo:ValueIri" + val valueCreator = "foo:valueCreatorIri" + val valuePermissions = "fooValuePermissions" + val valueCreationDate = Instant.parse("2024-01-01T12:00:00.673298Z") - val expected = - Update(s"""| - |PREFIX rdf: - |PREFIX rdfs: - |PREFIX owl: - |PREFIX xsd: - |PREFIX knora-base: - | - |INSERT DATA { - | GRAPH <${graphIri.value}> { - | <$resourceIri> rdf:type <$resourceClassIri> ; - | knora-base:isDeleted false ; - | knora-base:attachedToUser <$userIri> ; - | knora-base:attachedToProject <$projectIri> ; - | rdfs:label $tripleQuotes$label$tripleQuotes ; - | knora-base:hasPermissions "$permissions" ; - | knora-base:creationDate "$creationDate"^^xsd:dateTime . - | - | - | - | - | - | } - |} - |""".stripMargin) - val result = ResourcesRepoLive.createNewResourceQuery( - dataGraphIri = graphIri, - resourceToCreate = resourceDefinition, - projectIri = projectIri, - creatorIri = userIri, - ) + val resourceDefinition = ResourceReadyToCreate( + resourceIri = resourceIri, + resourceClassIri = resourceClassIri, + resourceLabel = label, + creationDate = creationDate, + permissions = permissions, + newValueInfos = Seq.empty, + linkUpdates = Seq.empty, + ) - assertTrue(expected.sparql == result.sparql) - }, - test("Create new resource query with values") { - val graphIri = InternalIri("fooGraph") - val projectIri = "fooProject" - val userIri = "fooUser" - val resourceIri = "fooResource" - val resourceClassIri = "fooClass" - val label = "fooLabel" - val creationDate = Instant.parse("2024-01-01T10:00:00.673298Z") - val permissions = "fooPermissions" + val createResourceWithoutValuesTest = test("Create a new resource query without values") { + val expected = + Update(s"""| + |PREFIX rdf: + |PREFIX rdfs: + |PREFIX xsd: + |PREFIX knora-base: + | + |INSERT DATA { + | GRAPH <${graphIri.value}> { + | <$resourceIri> rdf:type <$resourceClassIri> ; + | rdfs:label "$label" ; + | knora-base:isDeleted false ; + | knora-base:attachedToUser <$userIri> ; + | knora-base:attachedToProject <$projectIri> ; + | knora-base:hasPermissions "$permissions" ; + | knora-base:creationDate "$creationDate"^^xsd:dateTime . + | } + |} + |""".stripMargin) + val result = ResourcesRepoLive + .createNewResourceQueryWithBuilder( + dataGraphIri = graphIri, + resourceToCreate = resourceDefinition, + projectIri = projectIri, + creatorIri = userIri, + ) - val valueIri = "fooValue" - val valueCreator = "fooCreator" - val valuePermissions = "fooValuePermissions" - val valueCreationDate = Instant.parse("2024-01-01T10:00:00.673298Z") + val reference = ResourcesRepoLive.createNewResourceQuery( + dataGraphIri = graphIri, + resourceToCreate = resourceDefinition, + projectIri = projectIri, + creatorIri = userIri, + ) - val uuid = UUID.randomUUID() - val uuidEncoded = UuidUtil.base64Encode(uuid) + assertUpdateQueriesEqual(expected, result) && assertUpdateQueriesEqual(reference, result) + } - val resourceDefinition = ResourceReadyToCreate( + val createResourceWithValueSuite = suite("Create new resource with values")( + test("Create a new resource with an integer value") { + val uuid = UUID.randomUUID() + val uuidEncoded = UuidUtil.base64Encode(uuid) + val propertyIri = "foo:Property" + val values = List( + NewValueInfo( resourceIri = resourceIri, - resourceClassIri = resourceClassIri, - resourceLabel = label, - creationDate = creationDate, - permissions = permissions, - newValueInfos = Seq( - NewValueInfo( - resourceIri = resourceIri, - propertyIri = "fooProperty", - valueIri = valueIri, - valueTypeIri = OntologyConstants.KnoraBase.IntValue, - valueUUID = uuid, - value = TypeSpecificValueInfo.IntegerValueInfo(42), - valuePermissions = valuePermissions, - valueCreator = valueCreator, - creationDate = valueCreationDate, - valueHasOrder = 1, - valueHasString = "42", - comment = None, - ), - ), - linkUpdates = Seq.empty, - ) + propertyIri = "foo:Property", + valueIri = valueIri, + valueTypeIri = OntologyConstants.KnoraBase.IntValue, + valueUUID = uuid, + value = TypeSpecificValueInfo.IntegerValueInfo(42), + valuePermissions = valuePermissions, + valueCreator = valueCreator, + creationDate = valueCreationDate, + valueHasOrder = 1, + valueHasString = "42", + comment = None, + ), + ) - val expected = - Update(s"""| - |PREFIX rdf: - |PREFIX rdfs: - |PREFIX owl: - |PREFIX xsd: - |PREFIX knora-base: - | - |INSERT DATA { - | GRAPH { - | rdf:type ; - | knora-base:isDeleted false ; - | knora-base:attachedToUser ; - | knora-base:attachedToProject ; - | rdfs:label \"\"\"fooLabel\"\"\" ; - | knora-base:hasPermissions \"fooPermissions\" ; - | knora-base:creationDate \"2024-01-01T10:00:00.673298Z\"^^xsd:dateTime . - | - | - | # Value: fooValue - | # Property: fooProperty - | - | - | rdf:type ; - | knora-base:isDeleted false ; - | knora-base:valueHasString \"\"\"42\"\"\" ; - | knora-base:valueHasUUID \"$uuidEncoded\" . - | - | - | knora-base:valueHasInteger 42 . - | - | - | - | - | - | knora-base:attachedToUser ; - | knora-base:hasPermissions \"fooValuePermissions\"^^xsd:string ; - | knora-base:valueHasOrder 1 ; - | knora-base:valueCreationDate \"2024-01-01T10:00:00.673298Z\"^^xsd:dateTime . - | - | - | . - | - | - | - | - | } - |} - |""".stripMargin) - val result = ResourcesRepoLive.createNewResourceQuery( - dataGraphIri = graphIri, - resourceToCreate = resourceDefinition, - projectIri = projectIri, - creatorIri = userIri, - ) + val resource = resourceDefinition.copy(newValueInfos = values) - assertTrue(expected.sparql == result.sparql) - }, - test("Create new resource query with links") { - val graphIri = InternalIri("fooGraph") - val projectIri = "fooProject" - val userIri = "fooUser" - val resourceIri = "fooResource" - val resourceClassIri = "fooClass" - val label = "fooLabel" - val creationDate = Instant.parse("2024-01-01T10:00:00.673298Z") - val permissions = "fooPermissions" + val expected = + Update(s"""| + |PREFIX rdf: + |PREFIX rdfs: + |PREFIX xsd: + |PREFIX knora-base: + | + |INSERT DATA { + | GRAPH <${graphIri.value}> { + | <$resourceIri> rdf:type <$resourceClassIri> ; + | rdfs:label "$label" ; + | knora-base:isDeleted false ; + | knora-base:attachedToUser <$userIri> ; + | knora-base:attachedToProject <$projectIri> ; + | knora-base:hasPermissions "$permissions" ; + | knora-base:creationDate "$creationDate"^^xsd:dateTime ; + | <$propertyIri> <$valueIri> . + | rdf:type ; + | knora-base:isDeleted false ; + | knora-base:valueHasString "42" ; + | knora-base:valueHasUUID "$uuidEncoded" ; + | knora-base:attachedToUser <$valueCreator> ; + | knora-base:hasPermissions "$valuePermissions" ; + | knora-base:valueHasOrder 1 ; + | knora-base:valueCreationDate "$valueCreationDate"^^xsd:dateTime ; + | knora-base:valueHasInteger 42 . + | } + |} + |""".stripMargin) - val linkPropertyIri = "fooLinkProperty" - val linkTargetIri = "fooLinkTarget" - val linkValueIri = "fooLinkValue" - val linkCreator = "fooLinkCreator" - val linkPermissions = "fooLinkPermissions" - val valueUuid = UuidUtil.makeRandomBase64EncodedUuid + val result = ResourcesRepoLive.createNewResourceQueryWithBuilder( + dataGraphIri = graphIri, + resourceToCreate = resource, + projectIri = projectIri, + creatorIri = userIri, + ) + val reference = ResourcesRepoLive.createNewResourceQuery( + dataGraphIri = graphIri, + resourceToCreate = resource, + projectIri = projectIri, + creatorIri = userIri, + ) - val resourceDefinition = ResourceReadyToCreate( - resourceIri = resourceIri, - resourceClassIri = resourceClassIri, - resourceLabel = label, - creationDate = creationDate, - permissions = permissions, - newValueInfos = Seq.empty, - linkUpdates = Seq( - NewLinkValueInfo( - linkPropertyIri = linkPropertyIri, - newLinkValueIri = linkValueIri, - linkTargetIri = linkTargetIri, - newReferenceCount = 1, - newLinkValueCreator = linkCreator, - newLinkValuePermissions = linkPermissions, - valueUuid = valueUuid, - ), - ), - ) + assertUpdateQueriesEqual(expected, result) && assertUpdateQueriesEqual(reference, result) + }, + ) + + val tests: Spec[StringFormatter, Nothing] = + suite("ResourcesRepoLiveSpec")( + createResourceWithoutValuesTest, + createResourceWithValueSuite, + // test("Create new resource query with links") { + // val graphIri = InternalIri("fooGraph") + // val projectIri = "fooProject" + // val userIri = "fooUser" + // val resourceIri = "fooResource" + // val resourceClassIri = "fooClass" + // val label = "fooLabel" + // val creationDate = Instant.parse("2024-01-01T10:00:00.673298Z") + // val permissions = "fooPermissions" + + // val linkPropertyIri = "fooLinkProperty" + // val linkTargetIri = "fooLinkTarget" + // val linkValueIri = "fooLinkValue" + // val linkCreator = "fooLinkCreator" + // val linkPermissions = "fooLinkPermissions" + // val valueUuid = UuidUtil.makeRandomBase64EncodedUuid + + // val resourceDefinition = ResourceReadyToCreate( + // resourceIri = resourceIri, + // resourceClassIri = resourceClassIri, + // resourceLabel = label, + // creationDate = creationDate, + // permissions = permissions, + // newValueInfos = Seq.empty, + // linkUpdates = Seq( + // NewLinkValueInfo( + // linkPropertyIri = linkPropertyIri, + // newLinkValueIri = linkValueIri, + // linkTargetIri = linkTargetIri, + // newReferenceCount = 1, + // newLinkValueCreator = linkCreator, + // newLinkValuePermissions = linkPermissions, + // valueUuid = valueUuid, + // ), + // ), + // ) - val expected = - Update(s"""| - |PREFIX rdf: - |PREFIX rdfs: - |PREFIX owl: - |PREFIX xsd: - |PREFIX knora-base: - | - |INSERT DATA { - | GRAPH { - | rdf:type ; - | knora-base:isDeleted false ; - | knora-base:attachedToUser ; - | knora-base:attachedToProject ; - | rdfs:label \"\"\"fooLabel\"\"\" ; - | knora-base:hasPermissions "fooPermissions" ; - | knora-base:creationDate "2024-01-01T10:00:00.673298Z"^^xsd:dateTime . - | - | - | - | - | - | - | . - | - | - | rdf:type knora-base:LinkValue ; - | rdf:subject ; - | rdf:predicate ; - | rdf:object ; - | knora-base:valueHasString "fooLinkTarget" ; - | knora-base:valueHasRefCount 1 ; - | knora-base:isDeleted false ; - | knora-base:valueCreationDate "2024-01-01T10:00:00.673298Z"^^xsd:dateTime ; - | knora-base:attachedToUser ; - | knora-base:hasPermissions "fooLinkPermissions" ; - | knora-base:valueHasUUID "$valueUuid" . - | - | - | . - | - | } - |} - |""".stripMargin) - val result = ResourcesRepoLive.createNewResourceQuery( - dataGraphIri = graphIri, - resourceToCreate = resourceDefinition, - projectIri = projectIri, - creatorIri = userIri, - ) + // val expected = + // Update(s"""| + // |PREFIX rdf: + // |PREFIX rdfs: + // |PREFIX xsd: + // |PREFIX knora-base: + // | + // |INSERT DATA { + // | GRAPH { + // | rdf:type ; + // | rdfs:label \"\"\"fooLabel\"\"\" ; + // | knora-base:isDeleted false ; + // | knora-base:attachedToUser ; + // | knora-base:attachedToProject ; + // | knora-base:hasPermissions "fooPermissions" ; + // | knora-base:creationDate "2024-01-01T10:00:00.673298Z"^^xsd:dateTime . + // | + // | + // | + // | + // | + // | + // | . + // | + // | + // | rdf:type knora-base:LinkValue ; + // | rdf:subject ; + // | rdf:predicate ; + // | rdf:object ; + // | knora-base:valueHasString "fooLinkTarget" ; + // | knora-base:valueHasRefCount 1 ; + // | knora-base:isDeleted false ; + // | knora-base:valueCreationDate "2024-01-01T10:00:00.673298Z"^^xsd:dateTime ; + // | knora-base:attachedToUser ; + // | knora-base:hasPermissions "fooLinkPermissions" ; + // | knora-base:valueHasUUID "$valueUuid" . + // | + // | + // | . + // | + // | } + // |} + // |""".stripMargin) + // val result = ResourcesRepoLive.createNewResourceQuery( + // dataGraphIri = graphIri, + // resourceToCreate = resourceDefinition, + // projectIri = projectIri, + // creatorIri = userIri, + // ) - assertTrue(expected.sparql == result.sparql) - }, + // assertTrue(expected.sparql == result.sparql) + // }, ) }