anyURIEqual Function Description

Description

The anyURIEqual function compares two atomic values of type anyURI and returns true if and only if the 2 arguments to the function are equal according to the equality rules defined by the anyURI type.

anyURIEqual belongs to the ALFA function reference's equality predicates category. It maps to the XACML function identifier urn:oasis:names:tc:xacml:1.0:function:anyURI-equal, takes 2 arguments and returns a value of type boolean.

Property Value
Category equality predicates
# Arguments 2
Arguments
  • 2 atomic values of type anyURI
Return Value boolean
Expressed As in-fix
Representation a == b
Allowed In Target true
ALFA Shorthand ==
Commutative true

Example

/**
 * This rule will return Permit if the requestedURL is equal to the allowedURL. In the
 * case of the == operand, ALFA translates it using anyOfAny(function[anyURIEqual],...).
 * anyURIOneAndOnly ensures the bag contains a single value only.
 */
rule anyURIEqualsExample{
    permit
    condition requestedURL == allowedURL || anyURIEqual(anyURIOneAndOnly(requestedURL),anyURIOneAndOnly(allowedURL))
}

In this example, we compare requestedURL to allowedURL. In this case, we use 2 attributes (bags) rather than primitive values. Note the two different ways of expressing equality: via an == operator or via the function name anyURIEqual.