Home
MS Base
Categories (Data):
Categories (Governance):
definitions:
|
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="unitref" type="b:UnitRef" use! />
<attribute name="type" type="b:UnitRef" />
<attribute name="role" type="b:UnitRef" />
<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 Namespace 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.
<unit uid="MarkOv">
<type>ms:Type/Identity.System</type>
<indentity />
</unit>
<unit uid="Sources">
<type>ms:Role/Collection</type>
<definitions>
<has role="dist:Role/Source" unitref="puppy-src-3.14.rpm" />
<has role="dist:Role/Source" unitref="wolf-src-12.2.rpm" />
</definitions>
</unit>
<unit uid="puppy-src-3.14.rpm" />
<name>puppy 3.14 sources</name>
<type>iana:MediaType/application/rpm</type>
<extern />
</unit>
<unit uid="puppy-3.14.rpm">
<name>puppy 3.14</name>
<type>iana:MediaType/application/rpm</type>
<owner>dist:User/MarkOv</owner>
<extern />
<definitions>
<has unitref="dist:Sources/puppy" role="dist:Role/Source" />
</definitions>
</unit>
"unit" : {
"uid" : "MarkOv", // in dist:User/
"type" : "ms:Type/Identity.System"
},
"unit" : {
"uid": "Sources", // in dist:
"type" : "ms:Type/Collection",
"definitions" : [ {
"has" : [ {
"role" : "dist:Role/Source",
"unitref" : "puppy-src-3.14.rpm"
}, {
"role" : "dist:Role/Source",
"unitref" : "wolf-src-12.2.rpm"
} ]
} ]
},
"unit" : {
"uid" : "puppy-src-3.14.rpm", // in dist:Sources/
"name": "puppy 3.14 sources",
"type": "iana:MediaType/application/rpm"
"extern" : {}
},
"unit" : {
"uid" : "puppy-3.14.rpm", // in dist:Package/
"name" : "puppy 3.14",
"type" : "iana:MediaType/application/rpm",
"owner" : "dist:User/MarkOv"
"extern" : {},
"definitions": [ {
"has" : [ {
"unitref" : "dist:Sources/puppy",
"role" : "dist:Role/Source"
} ]
} ]
}
mark@overmeer.net
Web-pages generated on 2023-12-19
|