Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "IdAS String Filters"

(ABNF)
(ABNF)
Line 24: Line 24:
 
BAR          = %x7C ; vertical bar or pipe ("|")
 
BAR          = %x7C ; vertical bar or pipe ("|")
 
EXC          = %x21 ; exclamation mark ("!")
 
EXC          = %x21 ; exclamation mark ("!")
 +
</pre>
 +
 +
====Examples====
 +
Match for any entity with a telephone number of 888-555-1212 or 888-123-4567
 +
<pre>
 +
(&(a= http://example.org/attrs/phonenumber 888-555-1212)(a= http://example.org/attrs/phonenumber 888-123-4567))
 
</pre>
 
</pre>
  
 
===XML===
 
===XML===

Revision as of 19:42, 29 July 2008

Problem

While the current IFilter, IFilterAssertion (and sub-interfaces) are adequate to perform complex searches across an IdAS context, it is cumbersome to code to them. Furthermore, there is currently no way to represent a filter using a string such that it could be passed easily across a wire protocol

Proposals

ABNF

The following ABNF could be used to represent filters as strings. Note that I simply looked at the way today's IFilter is and extrapolated an ABNF.

filter       = LP filteritem RP
filteritem   = assertion / and / or / not
assertion    = comparator SP resource SP value 
and          = AMP 1*filter 
or           = BAR 1*filter
not          = EXC filter
comparator   =
resource     =
value        =

LP           = %x28 ; left paren ("(")
RP           = %x29 ; right paren (")")
SP           = %x20 ; space (" ")
AMP          = %x26 ; ampersand ("&")
BAR          = %x7C ; vertical bar or pipe ("|")
EXC          = %x21 ; exclamation mark ("!")

Examples

Match for any entity with a telephone number of 888-555-1212 or 888-123-4567

(&(a= http://example.org/attrs/phonenumber 888-555-1212)(a= http://example.org/attrs/phonenumber 888-123-4567))

XML

Back to the top