From ce0dfa914106e25ee7ec530caeb6ac0039e4d338 Mon Sep 17 00:00:00 2001 From: Blake Regalia Date: Thu, 5 Dec 2024 16:02:24 -0800 Subject: [PATCH] dev: simplify filter --- .../kotlin/org/openmbee/flexo/mms/GuardedPatch.kt | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/main/kotlin/org/openmbee/flexo/mms/GuardedPatch.kt b/src/main/kotlin/org/openmbee/flexo/mms/GuardedPatch.kt index 3f32a0b..6ed3e7a 100644 --- a/src/main/kotlin/org/openmbee/flexo/mms/GuardedPatch.kt +++ b/src/main/kotlin/org/openmbee/flexo/mms/GuardedPatch.kt @@ -13,16 +13,6 @@ import org.openmbee.flexo.mms.server.LdpMutateResponse import org.openmbee.flexo.mms.server.SparqlUpdateRequest -fun quadDataFilter(subjectIri: String): (Quad)->Boolean { - return { - if(it.subject.isURI && it.subject.uri == subjectIri && it.predicate.uri.contains(FORBIDDEN_PREDICATES_REGEX)) { - throw Http400Exception("User not allowed to use IRIs in the namespace <${it.predicate.uri}>") - } - - true - } -} - fun quadPatternFilter(subjectIri: String): (Quad)->Boolean { return { if(it.subject.isVariable) { @@ -65,14 +55,13 @@ suspend fun LdpDcLayer1Context deleteBgpString = asSparqlGroup(update.quads, dataFilter) - is UpdateDataInsert -> insertBgpString = asSparqlGroup(update.quads, dataFilter) + is UpdateDataDelete -> deleteBgpString = asSparqlGroup(update.quads, patternFilter) + is UpdateDataInsert -> insertBgpString = asSparqlGroup(update.quads, patternFilter) is UpdateDeleteWhere -> { deleteBgpString = asSparqlGroup(update.quads, patternFilter) whereString = deleteBgpString