Note | ||
---|---|---|
| ||
This site is in the process of being reviewed and updated. |
Introduction
This page describe the way schema are loaded into ADS. The schema are defined by the following document : RFC 4512 (wgich which obsoletes the RFC 2252)
A schema defines two types of elements, accordingly to RFC 4512 :
- ObjectClasses
- AttributeTypes
Those two elements are used internally by ADS to check that an entry is valid, and to apply the correct rules to compare attributes, sort entries, check attributes, etc.
We also use Syntax, defined in RFC 4512 and described in RFC 4517
Objects relations
We have some relations between those elements, the OIDs, the element's names and the schema file's name. Here they are :
...
- a unique OID
- a list of names, of which the first one is the primary name (names are case insensitives)
- a type ( ABSTRACT, AUXILIARY or STRUCTURAL)
- a flag to tell if the ObjectClass is obsolote or not
- the list of its superior, if any
The key is the OID.
The relations are :
- An ObjectClass is
- An ObjectClass is contained by only one schema
- An AttributesType is contained by only one schema
- An OID is associated with A schema caan contains 0 to N ObjectClass name
- An OID is associated with N AttributesType name ObjectClass may have one or more superior
- An ObjectClass may be the superior of one or more ObjectClass
- An ObjectClass has only one OID
- An ObjectClass has 0 to N mandatory AttributeType
- An ObjectClass has 0 to N authorized AttributeType
- An AttributeType is included in one or more ObjectClass
- An ObjectClass may have more than on name
- A name uniquely identify an ObjectClass
We have two kinds of axccess to an ObjectClass : in the server, we access an ObjectClass either by its OID or by one of its name. From an administrator GUI, we may start with the schema.
AttributeType's relations
AttributeTypes are used to characterize entry's attributes. They contain information about comparizon rules, ordering rules, and such.
- An AttributesType is contained by only one schema
- An OID is associated with N ObjectClass name
- An OID is associated with N AttributesType name
- A ObjectClass name is associated with only one OID
- A AttributesType name is associated with only one OID
- An ObjectClass name has only one OID
- An AttributesType name has only one OID
- An OID is associated with only one ObjectClass
- ... (To be
- A ObjectClass name is associated with only one OID
- A AttributesType name is associated with only one OID
- An ObjectClass name has only one OID
- An AttributesType name has only one OID
- An OID is associated with only one ObjectClass
- ... (To be continued)
Actual grammar
The actual grammar used to parse schema is the following :
Code Block |
---|
<WS> ::= ( '#' (~'\n')* '\n' | ' ' | '\t' | '\r' '\n' | '\n' | '\r' ) <QUOTE> ::= '\'' <DIGIT> ::= '0' .. '9' <DOLLAR> ::= '$' <OPEN_PAREN> ::= '(' <CLOSE_PAREN> ::= ')' <OPEN_BRACKET> ::= '{' <CLOSE_BRACKET> ::= '}' <NUMERIC_STRING> ::= ('0' .. '9')+ <NUMERICOID> ::= <NUMERIC_STRING ( '.' NUMERIC_STRING )+ <IDENTIFIER> ::= ( 'a' .. 'z') ( 'a' .. 'z' | '0' .. '9' | '-' | ';' )* <DESC> ::= "desc" <WS> <QUOTE> ( ~'\'' )+ <QUOTE> <SYNTAX> ::= "syntax" <WS> <NUMERICOID> ( <OPEN_BRACKET> ( <DIGIT> )+ <CLOSE_BRACKET> )? <parseSchema> ::= ( <attributeType> | <objectClass> )* <objectClass> ::= "objectclass" <OPEN_PAREN> <NUMERICOID> ( <objectClassNames> )? ( <objectClassDesc> )? ( "OBSOLETE" )? ( <objectClassSuperiors> )? ( "ABSTRACT" | "STRUCTURAL" | "AUXILIARY" )? ( <must> )? ( <may> )? <CLOSE_PAREN> <may> ::= "MAY" <woidlist> <must> ::= "MUST" <woidlist> <objectClassSuperiors> ::= "SUP" <woidlist> <woid> ::= ( <NUMERICOID> | <IDENTIFIER> ) <woidlist> ::= ( <woid> | ( <OPEN_PAREN> <woid> ( <DOLLAR> <woid> )* <CLOSE_PAREN> ) ) <objectClassDesc> ::= <DESC> <objectClassNames> ::= ( "NAME" ( <QUOTE> <IDENTIFIER> <QUOTE> | ( <OPEN_PAREN> <QUOTE> <IDENTIFIER> <QUOTE> ( <QUOTE> <IDENTIFIER> <QUOTE> )* <CLOSE_PAREN> ) ) ) <attributeType> ::= "attributetype" <OPEN_PAREN> <NUMERICOID> ( <names> )? ( <desc> )? ( "OBSOLETE" )? ( <superior> )? ( <equality> )? ( <ordering> )? ( <substr> )? ( <syntax> )? ( "SINGLE-VALUE" )? ( "COLLECTIVE" )? ( "NO-USER-MODIFICATION" )? ( <usage> )? <CLOSE_PAREN> <desc> ::= <DESC> <superior> ::= "SUP" ( <NUMERICOID> | <IDENTIFIER> ); <equality> ::= "EQUALITY" ( <NUMERICOID> | <IDENTIFIER> ); <substr> ::= "SUBSTR" ( <NUMERICOID> | <IDENTIFIER> ) <ordering> ::= "ORDERING" ( <NUMERICOID> | <IDENTIFIER> ) <names> ::= "NAME" ( <QUOTE> <IDENTIFIER> <QUOTE> | ( <OPEN_PAREN> ( <QUOTE> <IDENTIFIER> <QUOTE> )+ <CLOSE_PAREN> ) ) <syntax> ::= <SYNTAX> <usage> ::= "USAGE" ( "userApplications" | "directoryOperation" | "distributedOperation" | "dSAOperation" )" ) SyntaxDescription ::= <OPEN_PAREN> <WS> <numericoid> ( <WS> "DESC" <SP> <qdstring> )? <WS> <CLOSE_PAREN> |
Future grammar
The next version should be a little bit more powerfull :
...
Code Block |
---|
<xstring> ::= "X" <HYPHEN> ( <ALPHA> | <HYPHEN> | <USCORE> )+ <oid> ::= <descr> | <numericoid> <numericoid> ::= <number> ( <DOT> <number> )+ <descr> ::= <keystring> <keystring> ::= <leadkeychar> ( <keychar> )* <leadkeychar> ::= <ALPHA> <keychar> ::= <ALPHA> | <DIGIT> | <HYPHEN> <number> <HYPHEN> <number> ::= <DIGIT> | <LDIGIT> ( <DIGIT> )* <ALPHA> ::= "A"-"Z" | "a"-"z" <DIGIT> ::= "0".."9" <LDIGIT> ::= <DIGIT> | <LDIGIT> ( <DIGIT> )* <ALPHA>"1".."9" <HEX> ::= "0".."9" | "A"-.."ZF" | "a"-.."zf" <DIGIT><SP> ::= "0".."9" <LDIGIT> ::= ( "1".."9" <HEX> " )+ <WSP> ::= ( "0".."9" | "A".."F" | "a".."f" <SP> " )* <HYPHEN> ::= "-" <DOLLAR> ::= "$" <DOT> ::= ( " ." )+ <WSP><SQUOTE> ::= "'" <LPAREN> ::= "( "" <RPAREN> ::= " )*" <HYPHEN><USCORE> ::= "-" <DOLLAR>_" <QQ> ::= "$\27" <DOT><QS> ::= ".\5C" | "\5c" <SQUOTE><QUTF8> ::= "'" <LPAREN> <QUTF1> / <UTFMB> <QUTF1> ::= "(" <RPAREN> 0x00..0x26 | 0x28..0x5B | 0x5D..0x7F <UTFMB> ::= ")" <USCORE> <UTF2> | <UTF3> | <UTF4> <UTF0> ::= "_" <QQ>0x80..0xBF <UTF1> ::= "\27" <QS> 0x00..0x7F <UTF2> ::= "\5C" | "\5c" <QUTF8>0xC2..0xDF <UTF0> <UTF3> ::= <QUTF1> / <UTFMB> <QUTF1> ::= 0x00..0x26 | 0x28..0x5B | 0x5D..0x7F <UTFMB>0xE0 0xA0..0xBF <UTF0> | 0xE1..0xEC <UTF0> <UTF0>) | 0xED 0x80..0x9F <UTF0> | 0xEE..0xEF <UTF0> <UTF0> <UTF4> ::= <UTF2> | <UTF3> | <UTF4> <UTF0> ::=0xF0 0x90..0xBF <UTF0> <UTF0> | 0xF1..0xF3 <UTF0> <UTF0> <UTF0> | 0xF4 0x80..0xBF <UTF1>0x8F ::= 0x00..0x7F <UTF2> <UTF0> <UTF0> |
ObjectClass object
The ObjectClass syntax is (as of RFC 4512) :
Code Block |
---|
<ObjectClassDescription> ::= 0xC2..0xDF <UTF0> <UTF3> ::= 0xE0 0xA0..0xBF <UTF0> | 0xE1..0xEC <UTF0> <UTF0>) | 0xED 0x80..0x9F <UTF0> | 0xEE..0xEF <UTF0> <UTF0> <UTF4> <LPAREN> <SP> <numericoid> <ocparameters> <extensions> <WSP> RPAREN // Each parameters should not be seen more than once <ocparameters> ::= 0xF0 0x90..0xBF <UTF0> <UTF0>( | 0xF1..0xF3 <UTF0> <UTF0> <UTF0> | 0xF4 0x80..0x8F <UTF0> <UTF0> |
ObjectClass object
The ObjectClass syntax is (as of RFC 4512) :
Code Block |
---|
<ObjectClassDescription> ::=<SP> "NAME" <SP> <qdescrs> | <SP> "DESC" <SP> <qdstring> | <SP> "OBSOLETE" | <LPAREN><SP> "SUP" <SP> <numericoid> <ocparameters> <extensions> <WSP> RPAREN // Each parameters should not be seen more than once <ocparameters> ::= <oids> | <SP> ( "ABSTRACT" | "STRUCTURAL" | "AUXILIARY" ) | <SP> "MUST" <SP> <oids> (| <SP> "NAMEMAY" <SP> <qdescrs> | <SP> "DESC" <SP> <qdstring> | <SP> "OBSOLETE" | <SP> <oids> )+ |
AttributeType object
The AttributeType syntax is (as of RFC 4512) :
Code Block |
---|
<AttributeTypeDescription> = <LPAREN> <WSP> <numericoid> <atparameters> <extensions> <WSP> <RPAREN> // Each parameters should not be seen more than once <atparameters> ::= <SP> "NAME" <SP> <qdescrs> "SUP" <SP> <oids> | <SP> ( "ABSTRACT" | "STRUCTURAL" | "AUXILIARY" ) | <SP> "MUSTDESC" <SP> <oids>qdstring | <SP> "MAY" <SP> <oids> )+ |
AttributeType object
The AttributeType syntax is (as of RFC 4512) :
Code Block |
---|
<AttributeTypeDescription> = <LPAREN> <WSP> <numericoid> <atparameters> <extensions> <WSP> <RPAREN> // Each parameters should not be seen more than once <atparameters> ::= <SP> "NAME" <SP> <qdescrs>OBSOLETE" | <SP> "SUP" <SP> <oid> | <SP> "EQUALITY" <SP> <oid> | <SP> "ORDERING" <SP> <oid> | <SP> "DESCSUBSTR" <SP> qdstring<oid> | <SP> "OBSOLETESYNTAX" <SP> <noidlen> | <SP> "SUP" <SP> <oid>SINGLE-VALUE" | <SP> "EQUALITYCOLLECTIVE" <SP> <oid> | <SP> "ORDERING" <SP> <oid>NO-USER-MODIFICATION" | <SP> "SUBSTRUSAGE" <SP> <oid> <usage> |
Syntax object
Th Syntax grammar is :
Code Block |
---|
SyntaxDescription = <LPAREN> <WSP> | <SP> "SYNTAX" <SP> <noidlen> <numericoid> | <SP> "SINGLE-VALUE" |( <SP> "COLLECTIVEDESC" <SP> <qdstring> )? | <SP> "NO-USER-MODIFICATION" | <SP> "USAGE"<extensions> <SP><WSP> <usage> <RPAREN> |
What does not appears in this grammar is an information regarding human readability (wether the attribute is binary or textual)..