Home

MS Base

  • prefix: ms:
  • schema: b:

Categories (Data):

Categories (Governance):

namespaces:

 
 

Schema element "b:subspace"

Explains which Namespace Unit describes a sub-set of the top-level Namespace.

Definitions

<element name="subspace" type="b:Subspace" />

<complexType name="Subspace">
  <sequence>
    <element name="inherit"           type="b:UnitRef"    [0..1] />
    <element name="id_unwanted_chars" type="b:Expression" [0..1] />
    <element name="id_encode_ascii"   type="b:Expression" default="'[/]'" />
  </sequence>
  <attribute name="path"              type="b:UnitRef" use! />
</complexType>

Description

The element of the b:namespace structure explains which components of the Namespace have their own specification. For instance, which parts use a different storage architecture.

One c:collection can use multiple subspaces which describe some practical and physical restrictions. In most cases, the Collection will use the same hardware configuration as its parent, but in complex set-ups you may need to differentiate.

Be warned: id_unwanted_chars and id_encode_ascii expect a formula: a plain regexp must be encapsulated in single or double quotes.

attribute path

The absolute location of the Subspace within the Namespace.

The path MUST be in the same root Namespace: it cannot refer to external namespaces.

element id_encode_ascii

When no id is given when a Unit is created, then one is generated from its name. In the context, some of the characters in the name may be dangerous: they play a role in the path splitting or for any other reason.

The following characters are always encoded:

  • ' ': all sequences of WhiteSpace are compressed to a single blank. The Unit's full path is a word, so that blank will be encoded;
  • ':': the colon is used after a prefix. Its use indicates an absolute SCHEMA>b:UnitRef;
  • '#': the fragment indictors, at the end of a b:UnitRef;
  • '\': the backslash, which is horribly confusing to everyone; and
  • '%': the encoding indicator.

Other characters to be encoded than these can be specified with this element.

element id_unwanted_chars

When no id is given when a Unit is created, then one is generated from its name. This elements contains a regular expression for all characters and constructs which are to be removed.

element inherit

Include all the settings from an other Subspace, by default from the root Subspace. This works recursively. The root Subspace will ignore this parameter.

Examples

for id_unwanted_chars

Stripping characters: (mind the single/double quotes!)

'[: -]'                  # removed all colons, blanks, and dashes.
'( -> | [ ] | \.$ )'     # remove ->, blanks, and trailing dots
'( \.tar\.gz | \.zip )$' # remove trailing .tar.gz and .zip

more complex use

More powerfull:

<b:let b:name="is_tgz"  b:regexp="\\.tar\.gz$" />
<b:let b:name="is_zip"  b:regexp="\\.zip$" />
<b:let b:name="exts"    b:expr="'(' ~ is_tgz ~ '|' ~ is_zip ~ ')'" />
<b:subspace b:name="releases">
  <b:id_unwanted_chars>exts</id_unwanted_chars>
</b:subspace>

mark@overmeer.net      Web-pages generated on 2023-12-19