MarkLogic 9 Product Documentation
rdt:rule-validate

rdt:rule-validate(
   $rule-collection as xs:string*
) as xs:string*

Summary

Validate the redaction rules in one or more redaction rule collections and return the URIs of the rule documents validated.

Parameters
rule-collection The URIs of the collections that contains the redaction rules to be validated. The collections must not contain any non-rule documents.

Required Privileges

This operation requires the redaction-user role or the following privilege:

http://marklogic.com/xdmp/privileges/redaction-user

Usage Notes

Use this function to perform validation of redaction rules. Rules are identified by the rule collection to which they belong. If all rules validate successfully, this function returns a list of the validated rule URIs. If any rule is invalid, this function throws the exception RDT-BADRULE. If a rule names a custom redaction for a module that is not installed in MarkLogic, the exception RDT-MODNOTFOUND is thrown.

Validation does not check the contents of the options section of a rule because this data is redaction-function specific, rather than a general characteristic of all redaction rules. If the rule uses dictionary-based masking, no validation is performed on the dictionary.

The collection(s) can contain XML rules, JSON rules, or both, but must not contain non-rule documents.

See Also

Example


xquery version "1.0-ml";
import module namespace rdt = "http://marklogic.com/xdmp/redaction"
    at "/MarkLogic/redaction.xqy";
rdt:rule-validate(("pii-conceal", "obscure-loc"))

(: Result: Assuming the rules in the "pii-conceal" and "obscure-loc"
 : collections are valid, the URIs of all the rule documents in these
 : collections. :)
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy