diff --git a/home/src/main/resources/rdf/accessControl/firsttime/profile_proximity_query.n3 b/home/src/main/resources/rdf/accessControl/firsttime/profile_proximity_query.n3
index 928713e82..5de1070de 100644
--- a/home/src/main/resources/rdf/accessControl/firsttime/profile_proximity_query.n3
+++ b/home/src/main/resources/rdf/accessControl/firsttime/profile_proximity_query.n3
@@ -3,6 +3,12 @@
@prefix access-individual: .
@prefix access: .
+# Reserved variable names:
+# profileUri - user account associated profile
+# objectUri - access object uri
+# externalAuthId - user account external auth id (should match with profile external auth id)
+# matchingPropertyUri - uri of property used for auth id matching, selfEditing.idMatchingProperty defined in runtime.properties
+
access-individual:PersonProfileProximityToResourceUri a access:SparqlSelectValuesQuery ;
access:id """
SELECT ?resourceUri WHERE {
@@ -58,20 +64,93 @@ access-individual:PersonProfileProximityToResourceUri a access:SparqlSelectValue
{
?profileUri ?roleUri .
?roleUri a .
- ?roleUri ?resourceUri .
+ ?roleUri ?resourceUri .
?resourceUri a .
}
UNION
{
?profileUri ?roleUri .
?roleUri a .
- ?roleUri ?resourceUri .
+ ?roleUri ?resourceUri .
?resourceUri a .
}
UNION
{
- BIND ( ?profileUri as ?resourceUri)
+ BIND (?profileUri as ?resourceUri)
}
}
""" .
+access-individual:ExternalIdMatchProfileProximityToResourceUri a access:SparqlSelectValuesQuery ;
+ access:id """
+ SELECT ?resourceUri WHERE {
+ ?profile ?matchingPropertyUri ?externalAuthId .
+ {
+ ?profile ?roleUri .
+ ?roleUri a .
+ ?roleUri ?resourceUri .
+ ?resourceUri a .
+ }
+ UNION
+ {
+ ?profile ?roleUri .
+ ?roleUri a .
+ ?roleUri ?resourceUri .
+ ?resourceUri a .
+ }
+ UNION
+ {
+ ?profile ?roleUri .
+ ?roleUri a .
+ ?roleUri ?resourceUri .
+ ?resourceUri a .
+ }
+ UNION
+ {
+ ?profile ?roleUri .
+ ?roleUri a .
+ ?roleUri ?resourceUri .
+ ?resourceUri a .
+ }
+ UNION
+ {
+ ?profile ?roleUri .
+ ?roleUri a .
+ ?roleUri ?resourceUri .
+ ?resourceUri a .
+ }
+ UNION
+ {
+ ?profile ?roleUri .
+ ?roleUri a .
+ ?roleUri ?resourceUri .
+ ?resourceUri a .
+ }
+ UNION
+ {
+ ?profile ?roleUri .
+ ?roleUri a .
+ ?roleUri ?resourceUri .
+ ?resourceUri a .
+ }
+ UNION
+ {
+ ?profile ?roleUri .
+ ?roleUri a .
+ ?roleUri ?resourceUri .
+ ?resourceUri a .
+ }
+ UNION
+ {
+ ?profile ?roleUri .
+ ?roleUri a .
+ ?roleUri ?resourceUri .
+ ?resourceUri a .
+ }
+ UNION
+ {
+ ?profile ?matchingPropertyUri ?externalAuthId .
+ BIND (?profile as ?resourceUri)
+ }
+ }
+ """ .