From cb8063a202be7efa0905889afcc2d973a1b7f616 Mon Sep 17 00:00:00 2001 From: Martynas Date: Sun, 24 Nov 2024 23:24:31 +0100 Subject: [PATCH] Optimized authorization query --- src/main/webapp/WEB-INF/web.xml | 156 ++++++++++++-------------------- 1 file changed, 56 insertions(+), 100 deletions(-) diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 77d50ef6e..27c714494 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -28,106 +28,62 @@ PREFIX sioc: DESCRIBE ?auth FROM WHERE - { { ?auth acl:mode $Mode - { ?auth acl:accessTo $this } - UNION - { ?auth acl:accessTo $Container - SERVICE $endpoint - { GRAPH $Container - { { $Container a def:Root } - UNION - { $Container a dh:Container } - } - FILTER NOT EXISTS { GRAPH $this - { $this ?thisP ?thisO } - } - } - } - UNION - { { ?auth acl:accessToClass ?Type } - UNION - { ?auth acl:accessToClass ?Class . - ?Type (rdfs:subClassOf)* ?Class - } - SERVICE $endpoint - { { GRAPH $this - { $this a ?Type } - } - UNION - { GRAPH $Container - { { $Container a def:Root } - UNION - { $Container a dh:Container } - $Container a ?Type - } - FILTER NOT EXISTS { GRAPH $this - { $this ?thisP ?thisO } - } - } - UNION - { GRAPH ?g - { $this a ; - a ?Type - } - } - } - } - { { ?auth acl:agent $agent} - UNION - { ?auth acl:agentGroup ?Group . - ?Group foaf:member $agent - } - } - } - UNION - { ?auth acl:mode $Mode - { ?auth acl:agentClass foaf:Agent } - UNION - { ?auth acl:agentClass $AuthenticatedAgentClass } - { ?auth acl:accessTo $this } - UNION - { ?auth acl:accessTo $Container - SERVICE $endpoint - { GRAPH $Container - { { $Container a def:Root } - UNION - { $Container a dh:Container } - } - FILTER NOT EXISTS { GRAPH $this - { ?this ?thisP ?thisO } - } - } - } - UNION - { { ?auth acl:accessToClass ?Type } - UNION - { ?auth acl:accessToClass ?Class . - ?Type (rdfs:subClassOf)* ?Class - } - SERVICE $endpoint - { { GRAPH $this - { $this a ?Type } - } - UNION - { GRAPH $Container - { { $Container a def:Root } - UNION - { $Container a dh:Container } - $Container a ?Type - } - FILTER NOT EXISTS { GRAPH $this - { $this ?thisP ?thisO } - } - } - UNION - { GRAPH ?g - { $this a ; - a ?Type - } - } - } - } - } + { + { ?auth acl:agent $agent} + UNION + { ?auth acl:agentGroup ?Group . + ?Group foaf:member $agent + } + UNION + { ?auth acl:agentClass foaf:Agent } + UNION + { ?auth acl:agentClass $AuthenticatedAgentClass } + + ?auth acl:mode $Mode . + + { ?auth acl:accessTo $this } + UNION + { ?auth acl:accessTo $Container + SERVICE $endpoint + { GRAPH $Container + { { $Container a def:Root } + UNION + { $Container a dh:Container } + } + FILTER NOT EXISTS { GRAPH $this + { $this ?thisP ?thisO } + } + } + } + UNION + { { ?auth acl:accessToClass ?Type } + UNION + { ?auth acl:accessToClass ?Class . + ?Type (rdfs:subClassOf)* ?Class + } + SERVICE $endpoint + { { GRAPH $this + { $this a ?Type } + } + UNION + { GRAPH $Container + { { $Container a def:Root } + UNION + { $Container a dh:Container } + $Container a ?Type + } + FILTER NOT EXISTS { GRAPH $this + { $this ?thisP ?thisO } + } + } + UNION + { GRAPH ?g + { $this a ; + a ?Type + } + } + } + } } ]]>