Home

MS Base

  • prefix: ms:
  • schema: b:

Categories (Data):

Categories (Governance):

relations:

 
 

Schema element "b:has"

A unit has references to another unit for a certain reason.

Definitions

<element name="has" type="b:Has" />

<complexType name="Has">
  <complexContent>
    <extension base="b:Reusable">
      <sequence>
        <element ref="b:shadow" [0..∞] />
		<element name="max_age" type="b:Expression" default="P1D"  />
      </sequence>
      <attribute name="ref"   type="b:UnitRef"  use! />
      <attribute name="type"  type="b:Constant"  />
      <attribute name="role"  type="b:Constant"  />
      <attribute name="seqnr" type="unsignedLong" default="1" />
    </extension>
  </complexContent>
</complexType>

Description

We can think of many reasons for relations. The reason is expressed via the b:is attribute, which contains a name-spaced constant. The attributes are typical selectors to find the right relation to follow.

attribute ref

This required attribute tells the Unit where we describe the relation with. This Unit could be a Namespace, but usually it is a simple data Unit in a collection or a whole Collection.

attribute role

The b:role attribute explains the b:has relation. When that relation unknown, the client may need to collect the related unit to inspect its content, but that is expensive so should be avoided.

The relation (constant) may also be unknown to the client. In that case, the client is RECOMMENDED to ignore the relation. The client MAY warn its user that there is information which is not understood.

When you download a unit, you can specify the namespaces and relations of the related (b:has) units to be downloaded in the same go as well. For instance, within the Meshy Space Concept, a request for a certain msc:Role/Collection will ask to include the related units with relation msc:Role/Rules. Or more general, probably request for all msc:Role/ Units.

attribute seqnr

When there are multiple relations which are of the same kind (same b:is), they may need to be ordered like an array.

attribute type

The type of the content of Unit where this relation refers to, which MAY optimize some processes. This is indicative only: the processors SHALL check whether is field is correct, and MAY cast a warning on mistakes.

Usually, this element is not really useful: the processor can better retreive the Unit and then check whether it is able to handle it.

Many relations support different object types. For instance, the Identity of the owner of the Unit can be a single person, a group, and so on. Which kind of Identity it is, does not really matter in the main code of the processor.

element max_age

The b:expression evaluation into a duration. The status of the Unit must have been checked at the most that long ago. So: this should trigger a freshness check in the Subspace where this Unit resides.

element schadow

When the relation is between a Unit and a Collection, or when the relation is between a Unit and a fragment of a different Unit, then a rewrite is needed which translates the Unit name into a Fragment indicator.

Examples

in the Meshy Space Concept frame

Not all inter-unit relations are the same: some are generic enough to be defined by MSI, where others have a looser or non-standardized relation. It may also be smart to put lesser-used information about a unit into a separate unit: for instance the history of the unit.

<b:unit b:id="MarkOv">               <!-- in dist:User/ -->
  <b:type>msc:Role/Identity</b:type>
  <c:indentity />
</b:unit>
<b:unit b:id="Sources">              <!-- in dist: -->
  <b:type>ms:Role/Collection</b:type>  <!-- is a Subspace -->
  <b:has b:role="dist:Role/Source" b:ref="puppy-src-3.14.rpm" />
  <b:has b:roleis="dist:Role/Source" b:ref="wolf-src-12.2.rpm" />
</b:unit>
<b:unit b:id="puppy-src-3.14.rpm" /> <!-- in dist:Sources/ -->
  <b:name>puppy 3.14 sources</b:name>
  <b:type>iana:MediaType/application/rpm</b:type>
  <b:extern />
</b:unit>
<b:unit b:id="puppy-3.14.rpm">      <!-- in dist:Package/ -->
  <b:name>puppy 3.14</b:name>
  <b:type>iana:MediaType/application/rpm</b:type>
  <b:owner>dist:User/MarkOv</b:owner>
  <b:extern />
  <b:has b:ref="dist:Sources/puppy" b:role="dist:Role/Source" />
</b:unit>
"b_unit" : {
  "b_id" : "MarkOv",               // in dist:User/
  "b_type" : "msc:Role/Identity"
},
"b_unit" : {
  "b_id": "Sources",                // in dist:
  "b_type" : "ms:Role/Collection",  // is a Subspace
  "b_has" : [ {
    "b_role" : "dist:Role/Source",
    "b_ref" : "puppy-src-3.14.rpm"
  }, {
    "b_role" : "dist:Role/Source",
    "b_ref" : "wolf-src-12.2.rpm"
  } ]
},
"b_unit" : {
  "b_id" : "puppy-src-3.14.rpm",   // in dist:Sources/
  "b_name": "puppy 3.14 sources",
  "b_type": "iana:MediaType/application/rpm"
  "b_extern" : {}
},
"b_unit" : {
  "b_id" : "puppy-3.14.rpm",       // in dist:Package/
  "b_name" : "puppy 3.14",
  "b_type" : "iana:MediaType/application/rpm",
  "b_owner" : "dist:User/MarkOv"
  "b_extern" : {},
  "b_has" : [ {
     "b_ref" : "dist:Sources/puppy",
     "b_role" : "dist:Role/Source"
  } ]
}

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