Published Subject Indicators for Scripted Aspects

PSI Metadata

Description Data-inheritance is a brand of inferencing widely used in O-O languages. It can readily provide default or computed topic characteristics which FOL finds very hard to formalize. The PSI-set below denotes types of packed character Strings which provide these features by using O-O techniques.

Each denoted character String may be optionally embedded in an occurrence in any subclass of aspect topic to define and configure its special (default or computed) characteristics and its dynamic behavior.

Under WORDS, the dynamic characteristics of any target topic arise only from each such scripted aspect that has been asserted for the target, or for some other topic from which that aspect-target pair inherits data.

PublisherLexikos Corporation
CreatorDan Corwin
Languagehttp://www.topicmaps.org/xtm/1.0/language.xtm#en
Version2003/11/03
StatusPre-release draft for comment
Date Published2003/10/02

Index Of Subjects

Aspect Typehttp://www.lexikos.com/psi/words/aspect/#type
Default Valuehttp://www.lexikos.com/psi/words/aspect/#default
Functional Valuehttp://www.lexikos.com/psi/words/aspect/#function
Value Constraintshttp://www.lexikos.com/psi/words/aspect/#constraints
Change Listenershttp://www.lexikos.com/psi/words/aspect/#listeners
Data Inheritancehttp://www.lexikos.com/psi/words/aspect/#inheritance


Aspect Type

Published Subject Identifier: http://www.lexikos.com/psi/words/aspect/#type

This PSI, if cited as the type of an occurrence in any topic, declares that topic to be some kind of
PropType (values are Strings) or a RoleType (values are Topics). Details and additional dimensions of the aspect are declared within a comma-separated ResourceData String holding these subfields:
  1. SubKind, a numeric ID for the aspect being declared.
  2. Cardinality of its value, an ID at cardinality
  3. Update Policy on its value, an ID at updating
  4. Domain shows (per these rules) what subjects the aspect can modify
  5. Range of its value(s), per rules that depend on its SubKind:
  6. Inheritance Policy for aspect values not yet set, per Data Inheritance
All bolded substrings are required, and heavily constrain the legal value(s) of the aspect throughout the WORDS system. Inheritance is optional, but it defaults (if missing) to a standard policy that is (like Range) effectively SubKind-dependent.

Default Value

Published Subject Identifier: http://www.lexikos.com/psi/words/aspect/#default

This PSI, if cited as the type of ResourceData, flags that String as being a WORDS expression able to compute a typical value for the
aspect topic which contains it. The script takes the aspect and a given topic or association, then returns the aspect's default value as. .

Such scripts are key parts of a TM's ontology under WORDS, which help to define (i.e., configure) the abstract system behavior for each Aspect Type.


Functional Value

Published Subject Identifier: http://www.lexikos.com/psi/words/aspect/#function

This PSI works like
Default Value, but its associated script returns a computed value for the Aspect Type that may override (or extend) normal TM value lookup logic.

This has many exotic use cases. One simple example would be to find the value of some resourceRef by normal means, then read in that resource as a stream, and locally process it to compute the final value returned by the script.

A more complex (and useful) example might combine the above script with a real time clock and a separate scheduler. It builds a nightly report of selected content or changes. At other times (to stay nimble), it returns the last such (cached) value.


Value Constraints

Published Subject Identifier: http://www.lexikos.com/psi/words/aspect/#constraints

Extra
predicates constraining the value of an aspect (beyond those of its Aspect Type) may be listed in ResourceData typed by this PSI. Each such predicate is a comma-separated substring with parameters, to be passed as a unit to its own validation code, along with the specific thing, aspect, and value to be tested.

This is a very general spec, as open as the registry of predicates. Validation will return the first listed predicate to fail in each case. Such logic (often experimental) may become part of a TMCL spec, or augment it.


Change Listeners

Published Subject Identifier: http://www.lexikos.com/psi/words/aspect/#listeners

This PSI works roughly like
Value Constraints, but declares a type of ResourceData holding comma-separated specs for event handling (specific triggers, handlers, etc.).

Details of the substring formats and semantics are forthcoming separately. This is an advanced feature, whose uses seem highly application-specific.


Data Inheritance

Published Subject Identifier: http://www.lexikos.com/psi/words/aspect/#inheritance

The simplest and most common data-inheritance method is single-parent, by class, terminating at the first value found. (This is exactly what Java uses.) Unless told otherwise, this is also the inheritance method WORDS uses for any PropType.

For a RoleType in such a situation, WORDS uses no inheritance of the value, but instead it looks for a script that can return a Default Value. That script may be inherited, but not the default topic itself.

This PSI types ResourceData holding comma-separated specs that can configure exceptions to such inheritance rules. Details are in separate forthcoming specs. They involve such variations as:

No matter what rules get configured above, they can be designated for each aspect by the single character 'n' (iNheritance), whereas normal lookup rules for a value can be summarized by the single character 'L' (Lookup). Using such notation, a full list of primative ways to get an aspect value might be:

The codes above can be combined into an optional script-like Inheritance Policy subString for the Aspect Type, as in these bolded examples:

If such a policy is present, it will program WORDS to return a value of the aspect by using the indicated pattern of calls. If the policy is omitted from the Aspect Type, WORDS will use these default policies:

For most aspects, such defaults should work out pretty well. If they fail, the rest of this PSI-set lets aspect authors configure a better policy on a case-by-case basis.