6.1.5 Port type
A port type can be referred to by its name prefixed with
‘#’
#port type name;
A port type can be used as the
argument to a foreach,
do or
dowhile loop. It can also be used as a
condition in if statements, either on
its own or as part of a chain clause, including as the final element. A port
type can also be used as part of a chain output command, but there the final
element must be a property.
Please note that it is generally not advisable to navigate
to an object, relationship or role from a port instance. This is due to the fact
that the same port instance may be used in several object instances in this
graph, and navigating on from a port will thus navigate on from all those
instances. There is no way to make a distinction between them from within the
generator, which only knows that it is ‘in’ a port in a certain
graph. If you want to restrict yourself to navigating further within the current
binding, navigate to the role, and from there query or generator the information
you need from the port, then navigate from the role to the object.
When navigating to a dynamic port, the same syntax is
used, although then the type name is that of the object type whose instance is
the dynamic port. The same restriction on further navigation also still applies:
As the result is an object, attempting to navigate on from there will search
first for the dynamic port as an object directly in the current graph, rather
than as something in the port slot of a binding. Only if the object does not
exist directly in the current graph, but is in a port slot of one or more
bindings, will navigation on from a dynamic port navigate along those
bindings.