UNOFFICIAL COMPILATION of the Formal Specifications from Annex A
("Useful element types, notations, and instances") of the HyTime
Standard (ISO/IEC 10744:1992). This is not intended to replace
Annex A of the HyTime standard itself;
it is merely intended to provide an electronic form of those
portions of Annex A that HyTime applications implementers could
be expected to want to have in electronic form. This information
is provided for interim purposes only, and it should be destroyed
when the official electronic version of this information becomes
available. Again, THIS FILE IS NO SUBSTITUTE FOR THE STANDARD, AND
IT IS NOT THE STANDARD. THE ONLY RELIABLE SOURCE IS THE OFFICIAL
PRINTED ISO-SANCTIONED FORM OF THE STANDARD.
This file was manually typed from the printed text of the standard.
All of this material is subject to the following copyright notice and
license:
Copyright (C) International Organization for Standardization 1992.
Permission to copy in any form is granted for use with
conforming HyTime systems and applications as defined in
ISO/IEC 10744, provided this notice is included in all copies.
A.1 HyLex: HyTime lexical model notation
A.1.1.2 Delimiters
Role String Description
---- ------ -----------
XESC \ Escape
XGRPO ( Group open
XGRPC ) Group close
XLIT " Literal start or end
XLITA ' Literal start or end (alternative)
XSEQ , Sequence connector
XOR | Or connector
XDTGO [ Alternative single-character pattern open
XDTGC ] Alternative single-character pattern close
XOPT ? Optional occurrence indicator
XREP + Required and repeatable
XOREP * Optional and repeatable
XMINUS - Negation and range
XRNI # Reserved name indicator
A.1.1.4 Wildcards
# Any single character
(#, #+) (prohibited)
(#+) (ok)
(#*) (ok)
A.1.1.5 Hit boundary constraints
#SOD The hit must begin at the start of the match domain
#EOD The hit must end at the end of the match domain.
#ISC Ignored starting characters can occur before the hit;
equivalent to: (#SOD, #*).
#IEC Ignored ending characters can occur after the hit;
equivalent to: (#*, #EOD).
A.1.1.6 Alternative single-character patterns (ASCP)
Example: [A-Za-z] is any alphabetic character.
A.1.1.7 Matching Rules.
HyLex finds the longest match for known sub-models (sequences of
literals and ASCPs) and the shortest match for wildcard sequences.
Known sub-models are matched in the order they occur, with no overlap.
If multiple alternative sub-models (that is, OR group members) start
with the same character, only the longest among them will be matched
at a given point in the match domain.
A.1.2 HyLex element type
A.1.3 Useful HyLex types
Public identifier for this material:
"ISO/IEC 10744:1992//TEXT Useful HyLex Lexical Types//EN"
(IDREF | "#NULL")
(NAME, (s+, NAME)*)
(GI, (s+, GI)*)
(IDREF, s+, IDREF)
(IDR2, (s+, IDR2)*)
((ATTNAME|("#CONTENT"))
(number, (s+, number)*)
(number, s+, number)
(frac, (s+, frac)*)
([+-]?,number)
([1-9])
(nzdigit, digit*)
([+-]?,unzi)
(nmchar+)
(word, (s+, word)*)
((LIT,#*,LIT) | (LITA,#*,LITA))
The following models define string forms for qualified lexical type
names, qualified property names, and function arguments. The
delimiter roles are SGML delimiter roles, not data content notation
delimiter roles; they cannot be changed by a "delims" attribute.
((LMGI,PLUS)?,LTN)
(((PSN,PLUS)?,(PN,(DSO,(QPN|QLTN|word|literal),DSC)?)),
(NET,((PSN,PLUS)?,(PN,(DSO,(QPN|QLTN|word|literal),DSC)?)))*
(PERO,nzdigit,((digit, digit?)?)
A.2 HyTime property definition
A.2.1 Useful property sets
The following notation declarations identify the sources for the
inherent definitions in the property sets.
A.2.1.1 SGML lexical properties
These properties are purely lexical. In a lexical scan they are
satisfied by the occurrence of a string assigned to them by the
concrete syntax of the domain, without regard to context or the
current parsing state. In a query or proploc they return all the
strings assigned to them, in normalized form with single space between
strings.
A.2.1.1.1 HTlex1: SGML character classes
The following properties are the four abstract syntax character
classes. (Ee is excluded because it is a system signal.)
The following properties are the 14 concrete syntax character classes.
The following properties are syntactic variables derived from the
character classes.
A.2.1.1.2 HTlex2: SGML delimiter role names
A.2.1.2 SGML and HyTime semantic properties
The properties are checked for validity in the current parsing
context.
The following properties are declared value prescriptions of
attributes.
character data
general entity name
general entity names
id value
id reference value
id reference list
name
name list
name token
name token
notation name
number
number list
number token
number token list
The following properties are identifiers of objects or properties.
entity name
attribute name
generic identifier
ID of current element
The following properties relate to the prolog of an SGML document or
subdocument.
document type definition
link process definition
associated element type
associated notation name
entity type
attribute definition list
attribute definition
declared value
name token in ATTDV name token group
The following properties relate to a parsed document instance:
entity
etype[ENAME]/notation
data attribute specification
element
current element
attribute specification list
link attribute specification
result element specification
attribute value
A.2.1.2.2 HTsem2 PUBLIC "+//ISO/IEC 10744:1992//NOTATION
HTsem2::HyTime basic constructs//EN">
lexical type name
lexmodel element type
property name
property set name
specifier of property
function name
object class identifier
PTR to current object
HyQ node list name
reference type
lexical type
The following properties relate to location addressing:
object
current object
location source of object
HyQ selector condidate
dataloc data quantum
pseudo-element
data entity
data object
element or pseudo-element
node type:(element|pelement|dataent|dataobj)
document root
document position
data position
additional property source
The following properties relate to hyperlinking:
ilink or clink element
objects linked by a hylink
anchor roles of anchors of hylink
hylinks that link an anchor
other anchors of linkedby
role of anchor in hylink
A.2.1.2.3 HTsem3: Unparsed SGML text
Use of this property set requires support of the "unparsed" option in
the base module.
unparsed element (includes tags)
unparsed content (excludes tags)
unpelem[ID]/unpcontx
start-tag
attribute value specification
A.3 HyQ: HyTime query notation
A.3.2 HyQ formal definition
-- Conventions --
-- 'UC' Reserved name
'Ulc(' Reserved operator name
!lc Useful LTN or PN or user-specified text
@lc Attribute defined elsewhere
lc Grammar non-terminal symbol
()?*+| Meta-ops: grouping opt, orep, rrep, or
'' Delimit meta-ops when used in real syntax
two hyphens Begin and end comments (as in SGML)
--
-- Delimiters --
-- Role String Description
=== ====== ===========
QESC \ Escape
QGRPO ( Group open
QGRPC ) Group close
QLIT " Literal start or end
QLITA ' Literal start or end (alternative)
--
-- HyQ --
HyQ -- The content of an element that uses the HyQ notation is a
node list that comprises the body of a query. A qdomain
and args can be specified as attributes of the query
element. --
qbody
-- Query --
query -- A query can be either a direct query or an indirect query --
(dquery|iquery)
dquery -- Direct query: the query body is specified as a
direct argument of the query --
'Query('qbody (qdomain? args)?')'
iquery -- Indirect query: the query body is specified indirectly by
reference to the fn attribute of another query element --
'UseQ('@fn (qdomain? args)?')'
qbody -- Query body --
nl
qdomain -- Query domain: node list whose objects are test for inclusion
in query result; defaults to DOMTREE if not specified. --
-- Qdomain must be specified if there are no args. --
nl
args -- Query arguments --
node*
-- Nodes --
node -- Node --
-- !literal Delimited data
@arg Argument (conforms to HyFunk ltn=arg)
CAND The candidate currently under test in a select
function. CAND has no meaning elsewhere, but
survives in nested queries until stacked when
a nested select function is invoked.
(!literal|'CAND'|@arg|oo|count)
oo -- Object of: resolves IDREF to its object --
-- Object must be valid in context in which oo occurs --
'Oo('!idref')'
count -- Returns the number of quanta in an addressable range.
The range is determined from a node list, all of whose nodes
are data objects that have a common apropsrc (that is, all of
the objects occur within the data of one other object). The
range extends from the first bit combination of the node that
is first in the common containing object, to the last bit
combination of the last node, inclusive. --
'Count('nl @quantum?')'
-- Node List --
nl --Node List --
('DOMTREE'|'DOMROOT'|assign|nlref|nlops|nldefs|oo|query)
assign -- Assign nmae to a node list to allow reuse by nl reference.
Name is constant for scope of query body and its nested
queries --
'Assign('!name nl')'
nlref -- Node list reference; resolves !name to its node list --
-- !name Name assigne to a node list definition to
allow reuse by reference; must be unique within
query element. A node list cannot be referenced
within its own body. --
'Nlref('!name')'
-- Node List Operations --
nlops -- Node list operations (like set operations) --
(select|create||union|inter|diff)
select -- Selects resulting nodes by testing specified properties
of members of a given node list. The member under test is
the "candidate" (CAND); it is included in resulting node
list if the assertion returns "TRUE". --
create -- Create node list: duplicates are not removed. --
-- Create() is the empty node list --
-- Keyword 'Create' can be omitted --
'Create'?'('(node|nl)*')'
union -- Union (sum) of node lists: duplicates are removed. --
'Union('nl+')'
diff -- Difference between node lists (non-common membership) --
-- Diff of first two nls, then (diff of result and next nl)* --
'Diff('nl+')'
-- Node List Definitions --
nldefs -- Node list definitions --
(proploc|treeloc|pathloc|listloc|dataloc|hitloc|relloc)
proploc -- Returns nl of data objects containing property of source
nodes --
-- Based on proploc element type form:
(node|nl) Locsrc
!qpn Content
@joint Attribute
@aproprsrc Attribute
@notprop Attribute --
'Proploc('(node|nl) !qpn @joint? @aproprsrc? @notprop?')'
listloc -- Pick nodes from list by position --
-- Based on listloc element type form:
nl Locsrc
mkpair* Content
@overrun Attribute
@set Attribute
'Listloc('nl mkpair* @overrun? @set?')'
treeloc -- Pick node from tree by position --
-- Based on treeloc element type form:
nl Locsrc
!snzi* Content
@overrun Attribute
@set Attribute
@treecom Attribute
'Treeloc('nl !snzi* @overrun? @set? @treecom?')'
pathloc -- Pick nodes from tree by paths --
-- Based on pathloc element type form:
nl Locsrc
mkpair* Content
@overrun Attribute
@set Attribute
treecom Attribute
'Pathloc('nl mkpair* @overrun? @set? @treecom?')'
relloc -- Locates relatives by selction from addressable ranges --
-- Based on relloc element type form:
nl Locsrc
(node|nl) Root attribute
@relation Attribute
mkpair* Content
@overrun Attribute
@set Attribute
'Relloc('nl (node|nl) @relation? mkpair* @overrun? @set?')'
dataloc -- Selects portions of each node in the node list --
-- Based on dataloc element type form:
nl Locsrc
@quantum Attribute
@catsrc Attribute
@catres Attribute
@mkpair* Content
@overrun Attribute --
'Dataloc('nl @quantum? @catsrc? @catres? mkpair* @overrun? ')'
mkpair -- Pair of axis marker, interpreted as dimspec --
(!snzi !snzi)
hitloc -- Returns node list of data objects like that addressed by a
dataloc whose content is a mrkquery whose qdomain is the
dataloc locsrc --
-- Each resulting node contains information about the location
of the match (the "hit"), in marker pairs (like mrkquery). --
match
-- Pattern Match --
match -- Pattern match: Returns a node list where each node contains
one occurrence of the matching text (a "hit"). That is,
one node is returned for each non-overlapping match
in the text in each match domain node. The number
of matches per node has to be within hitrange. --
-- Hit must be word quantum unless "bigmatch" option is
supported. --
-- !qltn Qualified lexical type name (need not be HyLex)
@lexord Attribute (overrides @lexord on model element)
Defaults to character set order if "mixcase"
option is supported, otherwise to #SGMLCASE
Lexicographic reordering takes place prior to
quantization or other normalization.
@boudnary Attribute (defaults to "ISCIEC") --
'Match('(node|nl) (hylox|!qltn|!literal)
'Oo('@lexord')'? @boundary? hitrange?')'
hylex -- Local HyLex model --
-- Based on HyLex element type:
@HyLex Content (lexical model in HyLex notation)
@norm Attribute
@lexord Attribute --
'HyLex('('@hylex')' @norm? 'Oo('@lexord')'?')'
hitrange -- Hit range: 1 <= MINHITS <= hits <= MAXHITS --
-- Omitted MAXHITS means no upper limit --
-- 1st unzi is MINHITS and 2nd is MAXHITS --
(%unzi %unzi?)
-- Assertion --
assert -- Assertion: evaluates to "TRUE" or "FALSE" --
('TRUE'|'FALSE'|ah|compare|ordered|and|or|not|forall|exists)
ah -- Assertain handler for user-defined assertion:
The IDREF addresses an object that implements the assertion.
The node list contains the operands. --
-- Requires "uassert" option of location address module. --
'Ah('!idref nl')'
forall -- Evaluates to TRUE if the query returns nodes for every node
in nl --
'Forall('nl query')'
exists -- When a node list or match occurs where an assertion is
expected,
it evaluates to TRUE if non-empty, FALSE if empty. --
(nl|match)
-- Comparison --
compare -- Comparison: tests ordering of operands. --
-- Operands in nl are data objects or literals --
-- Comparisons are done in a way appropriate for the quantum. --
-- Relations testes are TRUE if:
EQ: all operands are equal
NE: at least two operands are not equal
LT: each operand is less than its successor
LE: each operand is less or equal to its successor
GT: each operand is greater than its successor
GE: each operand is greater or equal to its successor
SS: all operands are same size (same number of quanta)
NS: at least two operands are not the same size
ST: each operand is smaller (shorter) than its successor
SE: each operand is smaller (shorter) or equal to its successor
BT: each operand is bigger (longer) than its successor
BE: each operand is bigger (longer) or equal to its successor
HO: each operand holds its successor (proper superstring)
HE: each operand holds or equals its successor (superstring)
IH: each operand is held in its successor (proper substring)
IE: each operand is held in ord equals its successor (substring)
-- Use CAND to operate on the candidate node of the active
select. --
('EQ'|'NE'|'LT'|'LE'|'GT'|'GE'|'SS'|'NS'|'ST'|'SE'|'BT'|'BE'|'HO'|'HE'|
'IH'|'IE')'('@quantum?, 'Oo('@lexord')'? (node|nl)+')'
ordered -- TRUE if all nodes are data objects that have a common
aproprsrc and are ordered within it --
-- OVERLAP TRUE if first bit combination is LE next node's
first.
NOVERLAP TRUE if each node ends before enxt begins. --
'Ordered('nl ('OVERLAP'|'NOVERLAP')?')'
-- Boolean Expressions --
and -- TRUE if all its assertions are TRUE --
'And('assert+')'
or -- TRUE if any of its assertions are TRUE --
'Or('assert+')'
not -- TRUE if its assertion is FALSE --
'Not('assert')'
A.3.3 HyQ element type
The content of a HyQ element is the body of a query in the HyQ
notation. HyQ query functions can contain arguments whose values are
passed as the "args" attribute of a HyQ element. The operands are
referenced by placeholders (%1-%999), which are replaced by a node
specified via an IDREF in the "args". A placeholder can occur
wherever anode con occur. If no arg was specified for a placeholder,
it is empty.
The usefn attribute is supported; it allows an expression to be
created once and given a query function name that can be specified in
other HyQ element that specify arguments for the expression.
An instance of a HyQ element type can have either of two architectural
forms, which differ only in the form of address in which the query
results are generated: nmquery, which generates names, and mrkquery,
which generates axis marker. When a HyQ element is used as a marker
query in a coordinate location address, the default query domain is
the location source of the coordinate location address element.
A.3.4 HyQ examples
The first example locates all "equation" elements in a document.
Select(DOMTREE EQ(Proploc(CAND GI) "equation"))
The next example creates a named query that can be reused with an
argument to locate all elements of a specified element type.
Select(DOMTREE EQ(Proploc(CAND GI) %1))
The following query locates the second "para" element in the document
that occurs in a "body" element.
Listloc(
Select(
Pathloc(Select(DOMTREE EQ(Proploc(CAND GI) "body"))
1 -1 2 -1)
EQ(Proploc(CAND GI) "para") )
2 1 )
The last example performs the same search as the preceding one, but it
uses the named query defined in the second example.
Listloc(
UseQ(hasgi
Pathloc(UseQ(hasgi DOMTREE "body")
1 -1 2 -1)
"para )
2 1 )
A.4 Marker functions
HyOp is a simple recursive function, while HyFunk allows complex
expressions. Both use the same set of primitive operators and the
standard HyTIme dimension reference facilities. An application
designer could create higher-level forms of marker function that
resolve to the primitives used by HyOp and HyFunk.
A.4.1 HyOp: HyTime single operator marker function
A.4.2 HyFunk: HyTime function notation
A.4.2.1 HyFunk syntax and semantics
Delimiter roles defined by the HyFunk notation.
Role String Description
==== ===== ===========
FESC \ Description
FGRPO ( Group open
FGRPC ) Group close
FRNI # Reserved name indicator
FOP @ Operator name indicator
The following table shows the syntax of the HyFunk notation, defined
using the HyLex notation.
(fun)
(startfun, s*, funbody?, s*, endfun)
((operand, (s+, operand)*))
(")")
(fun|dimref|pdimref|snzi|arg)
("@",dimop,s*,"(",s*, refbody, s*,")")
((IDREF|("#SCOPE")), axisnext?)
(s+, GI)?, (s+, NUMBER)?()
("@",pdimop,s*,"(",s*,prefbody, s*,")")
(IDREF,s+, IDREF, axisnext?))
(NAME)
(NAME)
(NAME)
(NAME)
where:
mfn is a marker function name from a HyFunk element.
dimop is a dimension reference function, corresponding to a
combination of the selcomp and flipa ttributes of a dimref
element, named:
first for a reference to the first quantum
last for a reference to the last quantum
qcnt for a reference to the quantum count
flfirst for a reference to the first quantum with flip
fllast for a reference to the last quantum with flip
flqcnt for a reference to the quantum count with flip
Its operands are:
IDREF is the first operand, corresponding to the
elemref attribute of a dimref element.
#SCOPE is an alternative first operand, corresponding
to #SCOPE as elemref of a dimref within a
projectr or grpdex.
GI is the optional second operand, corresponding
to the extref attribute of a dimref element.
pdimop is a dimension reference function, corresponding to a
combination of the selcomp and flip attributes of a dimref
element that references the projected extent of an event or
event group, named:
pfirst for a reference to the projected first quantum
plast for a reference to the projected last quantum
pqcnt for a reference to the projected quanted count
pflfirst for a reference to the projected first quantum
with flip.
pfllast for a reference to the projected last quantum
with flip.
pflqcnt for a reference to the projected quantum count
with flip.
Its operands are:
IDREF is the first operand, corresponding to the
elemref attribute of a dimref element.
IDREF is the second operand, corresponding to the
projectr attribute of a dimref element.
GI is the option third operand, corresponding to
the axisref attribute of a dimref element.
NUMBER is the optional fourth operand, corresponding
to the extref attribute of a dimref element.
arg is a placeholder (%1-5999) that is replaced by a snum
specified directly or via an IDREF and the "ARGS" attribute
of the HyFunk element containing the function. If not
specified, it is empty.
operator is a HyFunk operator.
The following table shows each HyFunk operator name, the number of
operands in its function body, and the value it returns.
NAME FUNCTION BODY RETURNED VALUE
==== ============= ==============
avg (operand+) Average of all operands (rounded)
decr (operand) Operand decremented by 1.
div (operand, operand) First operand divided by second operand
(truncated).
incr (operand) Operand incremented by 1.
max (operand+) Highest operand
min (operand+) Lowest operand
mod (operand, operand) Remainder of first operand divided by second
operand.
mult (operand, operand+) Product of all operands multiplied together.
abs (operand) Absolute value of operand.
nabs (operand) Negated absolute value of operand.
rand () Pseudo-random value from 1 through hyqcnt
subt (operand, operand) Second operand subtracted from first.
sum (operand, operand+) Sum of all operands.
A.4.2.2 HyFunk element type
The content of a HyFunk element is an expression in the HyFunk
language. The expression can contain constant operands and/or
arguments whose values are passed as the "args" attribute of a HyFunk
element. The usefn attribute is suppored: it allows an expression to
be created once and given a function name that dan be specified in
other HyFunk element that specify arguments for the expression. See
A.4.2.3 for an example.
A.4.2.3 HyTime Measurement Unit ratio (HMUratio)
HMUratio is a practical example of a HyFunk marker function. It is
for use in scheduled extents occurring in event projectors only. The
function element accepts a frac in its args and multiplies it by the
qcnt of the projector scope extent. An optional GI of an exis can be
included as the third arg if the extent is multidimensional.
The function expression is:
@div(@mult(%1 @qcnt(#SCOPE %3))%2)
Here is how it could be used in one dimension, with a ratio of 3/2:
A.5 Measurement
A.5.1 Useful Standard Measurement Units
A.5.2 Useful measurement domain definitions
HyTime defines five measurement domain definitions for the useful SMU
notation declarations, that can be referenced as public text using the
following SGML formal public identifier:
"ISO/IEC 10744:1992//TEXT Useful Measurement Domain Definitions//EN"
(The element and attribute list declarations for "measure" and
"granule" are not included here. They are identical to the
definitions of the architectural forms, except that the content of
"granule" is declared to be empty.)
(As the set of granules is unbounded, these measurement domain
definitions are necessarily incomplete. Granules can be added easily
using the facilities described in 7.3.1.)
A.5.2.1 Generic quantum
A.5.2.2 Virtual time
A.5.2.2 Virtual space
A.5.2.4 Systeme International second
A.5.2.5 Systeme International meter
A.5.3 Other standard measurement units
The following notation declarations can be used for virtual reality
applications or other situations that required units of measure other
than temporal, spatial, and generic quanta. The comprise the
remaining Systeme International base units and supplementary units.
Declarations for other SI derived units should be constructed
similarly: the notation name should consist of the letters "SI"
followed by the special name of the derived unit if it is 6 characters
or less, otherwise by the symbol for the derived unit. (The special
name and the symbol can be found ins ISO 31-0:1991.) For example: