Published Subject Indicators for Constraint Types

PSI Metadata

Description The first PSI below designates the full array of constraints to be honored by WORDS for aspects defined in that language. The others designate individual constraints as now planned.

Because WORDS uses similar mechansisms to declare constraints on any aspect, it is convenient below to generalize how we speak of their effect. So we talk here about each constaint as logically limiting the "value(s)" for some open set of [description aspect value(s)] n-tples held in topic map memory. In fact, such n-tples will actually exhibit one of these more concrete storage patterns:

The descriptions and values constrained are therefore implicit in the type of aspect being discussed. The details of each constraint, meanwhile, depend on the explicit declaration of this same type.

So in the WORDS model, the constraints and typing for each aspect are very tightly bound. Constraints are essentially conceived as facets of declared data types; and aspects as typed variables in which data values may be stored within any description. This paradigm is widely used (with variations) in many other programming languages.

Note: These specs guide R&D on future software releases. If you would prefer to see changes in what they declare, this would be an excellent time to say so.

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

Index Of Subjects

Constrainthttp://www.lexikos.com/psi/words/constraint/#0
Cardinalityhttp://www.lexikos.com/psi/words/constraint/#1
*...minCardinalityhttp://www.lexikos.com/psi/words/constraint/#11
*...maxCardinalityhttp://www.lexikos.com/psi/words/constraint/#12
*...fixedCardinalityhttp://www.lexikos.com/psi/words/constraint/#13
Update Policyhttp://www.lexikos.com/psi/words/constraint/#2
*...onlyAuthorhttp://www.lexikos.com/psi/words/constraint/#21
*...onlyAdminhttp://www.lexikos.com/psi/words/constraint/#22
*...onlyLicensedhttp://www.lexikos.com/psi/words/constraint/#23
*...fromConstraintshttp://www.lexikos.com/psi/words/constraint/#20
Domainhttp://www.lexikos.com/psi/words/constraint/#3
Rangehttp://www.lexikos.com/psi/words/constraint/#4
*...general Stringhttp://www.lexikos.com/psi/words/constraint/#41
*...a kind of URIhttp://www.lexikos.com/psi/words/constraint/#42
*...an Integerhttp://www.lexikos.com/psi/words/constraint/#43
*...a TimeStamphttp://www.lexikos.com/psi/words/constraint/#44
*...a Topic Namehttp://www.lexikos.com/psi/words/constraint/#45
*...PSI-set ID(s)http://www.lexikos.com/psi/words/constraint/#46
*...-(others TBD)-http://www.lexikos.com/psi/words/constraint/#40
Property Predicatehttp://www.lexikos.com/psi/words/constraint/#5
*...patternAssertionhttp://www.lexikos.com/psi/words/constraint/#51
*...inListingAssertionhttp://www.lexikos.com/psi/words/constraint/#52
*...-(others TBD)-http://www.lexikos.com/psi/words/constraint/#50
Topical Predicatehttp://www.lexikos.com/psi/words/constraint/#6
*...instanceAssertionhttp://www.lexikos.com/psi/words/constraint/#61
*...subClassAssertionhttp://www.lexikos.com/psi/words/constraint/#62
*...rolePlayViaWordshttp://www.lexikos.com/psi/words/constraint/#63
*...-(others TBD)-http://www.lexikos.com/psi/words/constraint/#60


Constraint

Published Subject Identifier: http://www.lexikos.com/psi/words/constraint/#0

A WORDS constaint logically limits legal values for an open set of [description aspect value(s)] n-tples held in topic map memory.

Each constraint logically limits the value(s) of an aspect if and only if the aspect topic itself explicitly declares that the ASSERTION applies. Such a declaration is made by including the constraint model within the aspect topic as an occurrence which is itself typed by the appropriate PSI defined below.

The PSIs for Cardinality, Update Policy, Domain and Range are special cases, attached in a very compact and direct way by their semi-immutable inclusion in each aspect type by the (ontology) author who defines it. This acts as a basic declaration on the aspect's nature and expected usage, in much the same way that a programmer assigns a dataype to each variable. See each subsection for details and defaults.

Property Predicate and Topical Predicate PSIs let explicit, optional ASSERTIONS be declared for an aspect type. They are more complex to define, partly because each one now requires some constraint language in which to express the ASSERTION, plus integration of all executables required to test it.

Hopefully, a standard TMCL will soon reduce this chaos. Initially, WORDS limits it by supporting only aspect type strings (a pretty good 80-20 stopgap), and allowing (a few, basic) predicates as experimental.


Cardinality

Published Subject Identifier: http://www.lexikos.com/psi/words/constraint/#1

How many values can exist for the aspect? WORDS asks the same question here that OWL-lite does, but sanctions a greater range of answers:

If multiple values are declared, WORDS will permit use of ONLY plural-signature API methods for setting values of the aspect. Otherwise, it allows ONLY single-value signatures (the default for unconstrained aspects).


Update Policy

Published Subject Identifier: http://www.lexikos.com/psi/words/constraint/#2

This
Constraint declares when changes can be made to the value of an aspect.

The last case also works as a default for aspects never declared, which have no constraints imposed. For them, all changes are deemed legal. Under onlyLicensed, any attempted updates of them would fail (as being unanticipated). A global setting for WORDS run-time code (TBDL) can make any of the above the default policy.


Domain

Published Subject Identifier: http://www.lexikos.com/psi/words/constraint/#3

The Domain of each aspect type is viewed by WORDS as the only kind(s) of
thing which it should help to describe - the most general sort(s) of thing which can have that aspect.

E.g., each aspect that applies only to living things should cite the defined code for organism. Multiple thing types, separated by spaces, are allowed as an answer.


Range

Published Subject Identifier: http://www.lexikos.com/psi/words/constraint/#4

Each PSI here defines an abstract pattern to be met by an aspect's value(s). Two broad types of ranges must be validated in separate ways:

Lots of String types could mean lots of coding work here. Reusing published regular expressions (e.g., for XSD), should help. For many simple WORDS applications, they should be ample.


Property Predicate

Published Subject Identifier: http://www.lexikos.com/psi/words/constraint/#5

boolean propTest_###(String ASSERT, Topic subject, Topic propType, String value);

To let TM applications validate Strings in more detail, using arbitrary logic, WORDS defines PSI-based predicates of a fairly broad type, which can be functionally adjusted by the String ASSERT passed as lead argument to a method with the signature above.

This design pattern is general, and seeks to let each application assemble the procedural constraints it needs to validate any Property value. Any WORDS validator would first check its format by using the PSI and logic for Range, then check for any ASSERTS listed after other PSIs in its Constraints property, and test them using the related method, with a signature like that above. Such a call might return: .

The potential list is clearly wide open, potentially lengthy, and relates closely to the robustness and features of the expression language defined for each predicate within its ASSERT argument.

Topical Predicate

Published Subject Identifier: http://www.lexikos.com/psi/words/constraint/#6

boolean roleTest_###(String ASSERT, Topic subject, Topic roleType, Association assoc);

For any particular RoleType, WORDS syntax can similarly support basic types of ASSERTS. Each related predicate takes such character Strings as the lead argument to a PSI-labeled method with the signature above. The specific predicates WORDS initially defines are wide open by design:

Even more clearly, this list depends on the symbolic details of the String in the ASSERT argument, which each aspect's author can adjust. Purportedly, it decides if the subject can fit the indicated roleType in the indicated assoc.

Each ASSERT has procedural support, which can be as general as its designers desire. For security reasons, open scripts should not be supported, but PSI names and related arguments for scripts can be safely used in ASSERT Strings. Indeed, such a string can even start with the name of a scripting language other than WORDS, which can be called as described under Constraint.

Such extensions should let each aspect author register within a core TM any ASSERT scripts supported by his application's chosen language(s), then rely on those scripts and ASSERTs to ensure that mutations to (copies of) the original TM remain reasonably valid.