Logical architecture and metagraph
Authorities: the architecture and the language-definition foundations are carried verbatim in Authorities — this chapter is pedagogical and does not replace them.
The logical architecture of FormaSL organizes entities, relations and other semantic elements in a typed role-incidence metagraph. In that structure, relations have their own unity and identity, their participants occupy contract-defined roles, and the represented elements can participate in higher-order relations.
The metagraph provides the logical organization used by the language to declare, reference, query and compose semantic structures. Its storage form is determined by the realization: tables, indexes, key-value structures and other mechanisms can represent the same elements as long as they keep the properties required by the contract.
Relations as semantic units
An n-ary relation is represented as one semantic relation instance, with participants associated to roles. The unity of the relation remains identifiable even when the realization distributes it over several physical structures.
Consider a medicine shipment organized among manufacturer, carrier and recipient. The domain can declare a shipment relation binding the transported lot, the sending organization, the logistics operator and the recipient organization. Each participant occupies its own role in that relation. The identity of the shipment lets different applications refer to the same instance without reconstructing it from isolated pairs of information.
The relation’s contract determines which participants are admitted in each role and which properties characterize their participation. It also defines, when necessary, the number of participants, the possibility of repetition, the multiplicity, the ordering and the use of positions or semantic keys.
A shipment can, for example, involve several recipients. The contract establishes whether they constitute distinct participations, whether the order of service matters and which qualifications belong to the relation as a whole or to each participation. Those decisions follow the domain’s meaning, so different relations can adopt different regimes of multiplicity and ordering.
Roles and participations
The binding of a participant to a role has a structural participation point, used by the logical representation to organize the binding. That point can receive keys and internal records, according to the mechanism employed.
The semantic identity of a participation is a distinct question. In a relation that only requires identifying the sender and the recipient, the structural bindings can suffice. In another, it can be necessary to track a specific participation across revisions, transformations or reference operations. In that case, the contract establishes the participation as a semantic referent and defines how its identity remains recognizable.
The number of declarations contributing to a relation and the number of records used to represent it are also distinct from its semantic multiplicity. Two declarations can add information about the same participation, or record different participations, according to the applicable contract.
That separation makes it possible to correlate information from different modules without confusing documentary contribution, structural binding and participation in the domain. When a correlation gathers information about a participation, the provenance of each contribution remains identifiable where relevant.
Higher-order structures
The metagraph admits typed references to relations and other semantic elements. Thus a relation can participate in another relation, and composed structures can be treated as objects of query, evaluation and transformation.
A decision to retain a batch, for example, can refer to the shipment relation, to the temperature observations and to the criteria used in the evaluation. The decision, in turn, can be referenced by a later revision. Each reference keeps the semantic type and the identity of the element it addresses.
This mechanism makes it possible to represent relations between information without reducing them to texts or generic identifiers. A reference to the Claim issued by the carrier is different from a reference to the assertion’s content; a reference to the retention decision is different from a reference to the action executed as a consequence of it.
Recursive and cyclic structures can also be part of the metagraph when admitted by the involved contracts. Their interpretation depends on the declared relations and roles. The contracts of each domain further determine which positions are asymmetric: roles such as origin, destination, owner or beneficiary can introduce semantic direction into the relations where they appear.
Identity and reference resolution
The language distinguishes origin designators, resolved semantic references and referents. A name, path or identifier is interpreted under a resolution basis. When that basis determines a referent, the language produces a typed semantic reference; when the determination still depends on additional information, the resolution obligation remains explicit.
For this reason, different modules can use the same name for distinct elements. They can also use different names for the same referent, provided the correspondence is established by the applicable resolution basis. Once resolved, the reference keeps the identity of the interpreted element, even if names, paths or physical records are reorganized.
The resolution basis has a specific function in the language. Contexts, frames, jurisdictions and ontological scopes can participate in the interpretation of the domain, but carry responsibilities different from resolving names and references.
In composition between modules, a same-target correspondence recognizes references that already designate the same semantic element. It makes it possible to gather contributions relative to that element. The reconciliation of previously distinct identities, in turn, is its own semantic operation, with an explicit contract.
That distinction also holds when an agent asserts that two domain entities are the same. The assertion can be represented, evaluated and used in the appropriate operations. The identity of the references resolved by the language continues to be determined by its resolution contract.
Content and semantic status
The presence of a structure in the metagraph indicates that it participates in the represented semantic domain. Its semantic status is determined by the category and the qualifications with which that structure appears.
A relation can be part of a Claim’s content, constitute the object of an observation, appear as a hypothetical premise or compose a derived result. Those uses keep their own meanings. The relational structure provides a way to represent and relate content; Claims, evaluations, observations and other elements express the positions taken towards it.
The same care applies to ontological categories. An entity can be classified under a determined ontological scope, while language types and contracts determine the formation and compatibility of the constructs. Ontology relations, relation contracts and inference rules can use associated structures, each with its semantic function.
This organization makes it possible to use shared relational structures for agents that adopt different classifications or interpretations. The contract of each operation determines how the pertinent positions and scopes enter the processing.
Ontologies and the interpretation of the metagraph
The metagraph provides the logical structure of entities, relations, roles and references. Ontologies and semantic theories organize the concepts and interpretation commitments under which those structures are used. An ontology is an intensional, referenciable artifact, with content interpreted according to its contract and its formalism basis.
The same shipment instance can participate in a logistics ontology and in a contractual ontology. The first organizes concepts related to transport; the second relates the shipment to the conditions of receipt and fulfillment of obligations. The references to the shipment remain stable while the categories and commitments of each ontology keep their scope.
Type and relation contracts determine the formation and participation conditions of the language. Ontological categories and situated classifications express domain interpretations. The complete treatment of those relations, of the axioms and of the composition between theories is in Ontologies and semantic theories.
Composition of modules and fragments
FormaSL modules can contribute structures that will be related in a composition. The process uses resolved references, relation contracts and correlation rules to form a result with determined meaning.
Consider two modules dealing with the same shipment. The first declares the relation with the lot and the sending organization; the second adds information about the carrier and the recipient. When both designate the same semantic instance and their contracts allow composition, the contributions can be gathered preserving the involved roles.
The treatment of overlapping contributions depends on the contract. Two pieces of information about the same role can correspond to the same participation, to distinct participations or to a correlation not yet resolved. The result keeps that condition until there is sufficient basis to determine it. Structural equality, the reading order of files and the number of physical records do not replace the correlation rules.
When the contributions belong to different contracts, an operation-specific correlation basis establishes which roles or participations can be related, under which scope and with which preservation obligations. That basis guides the composition and keeps the identity of the origin contracts.
The composition preserves the elements, the relevant qualifications and the interpretation dependencies that remain necessary. The acceptance of a contribution as input is also governed by the consuming operation’s contract. Thus, shared information can be used in new operations with scope, admissibility criteria and authority determined for each use.
When different composition orders satisfy the same completeness contract and use the same resolution, correlation and judgment bases, the results keep the semantic observables required by that contract. The incidental organization of module loading does not come to determine identity, authority or semantic precedence.
Views, projections and interpretation dependencies
Queries and projections present slices of the metagraph. A view can select relations of a determined type, participants of a role or structures applicable to a certain context. It expresses the result of that slice and keeps the qualifications needed to interpret it.
A query over the shipments destined to a distribution center, for example, can present lot, recipient and arrival forecast. The other participations of the relation remain available according to the contract and the access conditions. The slice can be used by an operational application without turning the selected structure into a new domain relation.
Beyond the referent’s identity, some operations depend on the state of an interpretation basis: the relation contract used, the version of a policy, the scope considered or the normative basis of a judgment. When those elements affect the result, the dependency keeps both the identity and the semantic role and the relevant state of the basis used.
This lets a later operation reconstruct the meaning of the received information, even when the current basis has already evolved. The continuity of a referent’s identity and the continuity of its interpretation are related, but distinct, responsibilities.
Relation to the language and the realization
The metagraph’s logical architecture belongs to the plane of the semantic contract. It is in that plane that the identity of relations, the roles, the participation criteria, the references and the composition obligations are defined.
The .fsl files constitute the authoritative semantic source. The organization into modules and files structures authorship and the resolution of designators. The topology of those files can differ from the topology of the declared semantic structures.
The .fsp files specify realization bindings for concrete capabilities and resources. Static weaving resolves those bindings, producing an executable association with the semantic contract preserved. The runtime evaluates the operations defined in that contract over the available data and resources.
In the physical representation, a relation instance can occupy several tables, records or indexes. In the same way, different relations can share storage structures. The realization keeps recoverable the identity of the instances, the typed participation, the relevant qualifications and the reference relations required by the logical model.
The metagraph thus works as the common logical structure over which the language expresses relations, performs queries and composes semantic information. The choice of execution and storage mechanisms belongs to the layers responsible for realizing those operations.