[sc34wg3] TMQL requirements 1.0.0

Lars Marius Garshol sc34wg3@isotopicmaps.org
29 Aug 2001 09:44:38 +0200


Holger and I have now completed the TMQL requirements document version
1.0.0, based on input from the Montréal meeting and the tmql-wg
mailing list.

Sara and/or Jim, could you please give this document a number and put
it into the SC34 registry?

Thanks!

--Lars M.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!-- $Id: tmqlreqs.html,v 1.11 2001/08/23 20:56:43 larsga Exp $ 
 0.8.2: 1.4
 0.9.0: 1.10
 1.0.0: 1.11
-->
<html>
<head>
<title>TMQL requirements (1.0.0)</title>

<style type="text/css">
th {
  text-align: left;
  vertical-align: top;
}

h1, h2, h3, h4 {
  font-family: Verdana, Helvetica, sans-serif;
}

body {
  margin-left: 10%;
  margin-right: 10%;
  margin-top: 48pt;
}

dt {
  font-weight: bold;
}
</style>
</head>
<body>

<h1>TMQL requirements (1.0.0)</h1>

<table>
<tbody>
<tr><th>Editors:</th>
    <td><a href="mailto:holger.rath@empolis.com">Hans Holger Rath</a>,
        empolis GmbH<br>
        <a href="mailto:larsga@ontopia.net">Lars Marius Garshol</a>, Ontopia
</td></tr>
<tr><th>Version:</th>      <td>1.0.0</td> </tr>
<tr><th>Last changed:</th> <td>2001-08-23</td> </tr>
</tbody>
</table>

<h2>1. Introduction</h2>

<p>
This document sets down the requirements that will guide the work with
the Topic Map Query Language (TMQL), a query language for topic maps
that is to become an ISO standard.  These requirements document the
intentions of the standards editors, as informed by the user
community. The purpose of this document is to make it clear what can
be expected to come out of the TMQL process, and to encourage the user
community to make their needs known to the editors.
</p>

<p>
This document has requirements for the TMQL standard as a whole, and
for the query part of TMQL in particular. Additional requirements for
the modification part of TMQL will have to be defined at a later
stage.
</p>

<p>
The following key words are used to indicate the degree of certainty
associated with each particular requirement:
</p>

<dl>
<dt>Shall</dt>
<dd>Means that the requirement is absolute.</dd>
<dt>Should</dt>
<dd>Means that the requirement is a goal.</dd>
<dt>May</dt>
<dd>Means that the requirement is considered important, but that it is
not yet clear whether TMQL should conform to it or not.</dd>
</dl>

<p>
Please note that some requirements are only implicitly specified
through the form of other requirements. This document must be read
with care.
</p>

<p>
Feedback on this requirements document is requested.
</p>

<h2>2. Requirements in brief</h2>

<p>
This section contains the main TMQL requirements in summarized form
for easy reference:
</p>

<ol>
<li>TMQL shall have a concise and human-readable syntax.</li>

<li>The execution of TMQL queries shall be defined in terms of
operations on an abstract data model for topic maps and possibly also
an environment (about which, see section 3.4).</li>

<li>TMQL query results shall be instances of an abstract TMQL data
model (see requirement 3.3:2).</li>

<li>TMQL shall be independent of any particular interface between
clients and the query processor.</li>

<li>TMQL shall support all natural languages equally well. That is,
TMQL shall be fully internationalized with respect to text
representation, text ordering, etc. (See also requirements 3.5:7 and
3.5:8.)</li>

<li>The TMQL standard shall be defined in two parts, first one with
querying only, then one adding support for modifications.</li>

<li>The TMQL standard shall not unduly constrain the form of
implementations.</li>

<li>The TMQL standard shall be formal, fully define the results of
queries (so that any given query can only have one correct result in
any given context) and, in so far as possible, be human-readable.</li>

<li>TMQL shall be usable across a wide range of foreseeable platforms
and applications over an extended lifetime (20-50 years).</li>
	
</ol>

<h2>3. Requirements in detail</h2>

<h3>3.1. General</h3>

<p>
The following general requirements apply, in addition to those already
mentioned. 
</p>

<ol>
<li>TMQL queries shall be able to span multiple topic maps.</li>

<li>The TMQL standard should be defined based on a set of use cases
representing general classes of queries expected to be common.</li>

<li>The TMQL standard shall define error situations, and how TMQL
processors are required to react to them.</li>

<li>The TMQL language shall be extensible. TMQL shall define
controlled mechanisms for third-party extensions, e.g.,
domain-specific extensions.</li>

<li>The TMQL standard shall contain a conformance clause, stating the
conditions under which TMQL implementations may claim to conform to
the standard.</li>

<li>The TMQL language may support the definition and use of logic
inferencing rules.</li>

<li>The TMQL standard may define a distributed addressing scheme for
topic maps.</li>
</ol>

<h3>3.2. Syntax</h3>

<p>
The following requirements apply to the TMQL syntax, beyond those
stated above.
</p>

<ol>
<li>The syntax shall be defined in terms of a formal grammar.</li>

<li>The TMQL query syntax shall be designed to be easily embeddable
into XML documents and programming language source code.</li>

<li>The syntax should be designed so that queries expected to be
common be as easy to write as possible.</li>

<li>An XML syntax for TMQL queries may be defined.</li>
</ol>

<h3>3.3. Model and algebra</h3>

<p>
The following requirements apply to the formal underpinnings of the
TMQL standard, beyond those already stated.
</p>

<ol>
<li>TMQL shall not define its own data model, but be based on one
common to the entire family of topic map standards.</li>

<li>TMQL may extend the common data model in order to be able to
represent query results which are not topic maps, but merely sets and
lists of topic map objects, resources, and perhaps also primitive
values like strings and numbers.</li>

<li>The definition of TMQL should be based on an abstract query
algebra, which again should be based on the data model.</li>

<li>The TMQL language should support nesting of queries to form
sub-queries.</li>

<li>The TMQL language should support sorting query results by parts of
the query results.</li>

<li>The algebra may include operators such as: merge, comparison,
boolean logic operators, set operators, matching by scope
operators, cardinality/count, string matching operators, and
aggregation.</li>

<li>TMQL may support returning associations, topic names, and
occurrences that were not present in the queried topic map(s).</li>

<li>TMQL may define operations for constructing topic maps from the
results of TMQL queries.</li>

</ol>

<h3>3.4 Self-containedness of queries</h3>

<p>
The following concepts relating to the self-containedness of queries
have been identified. They are described here in order to clarify the
list of requirements following the concepts. Please note that these
concepts, and how they may apply to TMQL as it will be defined is not
yet understood, and the descriptions themselves do not constitute
requirements.
</p>

<dl>
<dt>TMQL environment</dt>
<dd>This is the environment in which TMQL queries are evaluated.
It may contain things like ID-to-topic map-mappings, identifier to
variable/function/predicate/etc mappings, base URIs used to resolve
relative URIs, and so on.</dd>

<dt>Inter-query context</dt>
<dd>This is the execution context for TMQL queries, as modified by
previous queries. It is not clear what this context may contain.</dd>

<dt>Intra-query context</dt>
<dd>This is the execution context for a TMQL query, as modified or set
up by the query itself. It may contain identifier to value mappings, a
base URI for resolving relative URIs, specifications of nested
queries, specifications of local functions/predicates, and so on.</dd>
</dl>

<p>
The following requirements apply to the self-containedness of queries,
in addition to the requirements above this section.
</p>

<ol>
<li>The TMQL standard shall clearly define how it uses each of the
concepts above, and whether it uses any of them.</li>
<li>Any particular TMQL query shall contain all the information
necessary to interpret it (with respect to its TMQL environment,
inter-query context, and intra-query context).</li>
<li>The TMQL standard should make use of a TMQL environment, and an
intra-query context to specify the interpretation of queries.</li>
<li>The TMQL standard may make use of the notion of an inter-query
context to specify how queries are interpreted.</li>
</ol>


<h3>3.5. Relationship to other standards</h3>

<p>
The TMQL standard is part of a larger family and community of
standards, and the following requirements apply to its integration in
this community.
</p>

<ol>
<li>TMQL shall be based on <a
href="http://www.y12.doe.gov/sgml/sc34/document/0129.pdf">ISO
13250</a>.</li>

<li>TMQL shall be based on the topic map data model currently being
defined. (Thus, TMQL will also support <a
href="http://www.topicmaps.org/xtm/1.0/">XTM</a>.)</li>

<li>URIs used in TMQL queries shall be normalized in the manner
defined by the topic map data model.</li>

<li>If value equality for topic map objects is not defined by the
topic map data model it shall be defined by the TMQL standard.</li>

<li>TMQL shall relate to the <a
href="http://www.y12.doe.gov/sgml/sc34/document/0226.htm">Topic Map
Conceptual Model</a> through the topic map data model.</li>

<li>TMQL shall be harmonized with the Topic Map Constraint Language
currently being defined, in the sense that there shall be no overlap
of functionality, the standard shall be compatible, and features from
TMCL shall be reused in TMQL wherever suitable..</li>

<li>The character set of TMQL shall be <a
href="http://www.unicode.org/">Unicode</a>.</li>

<li>Ordering of strings in TMQL shall be based on externally-defined
specifications for internationalized string collation. Candidates are
<a href="http://www.unicode.org/unicode/reports/tr10/">the Unicode
Collation Algorithm</a>, and <a
href="http://anubis.dkuug.dk/jtc1/sc22/open/n2933.pdf">ISO
14651</a></li>

<li>The syntax of URIs within TMQL queries shall be governed by the
rules of <a href="http://www.ietf.org/rfc/rfc2396.txt">RFC
2396</a>.</li>
</ol>

<h3>3.6. Specific query capabilities</h3>

<p>
This section lists some general classes of queries which TMQL may
support. The queries are only informally defined since there currently
is no data model to define them in terms of. This list has not been
tested for completeness.
</p>

<h4>3.6.1. Queries returning topics</h4>

<ol>
<li>Find all topics with specific names whose scopes match a specific
scope.</li>

<li>Find all topics with specific resources as occurrences whose
scopes match a specific scope.</li>

<li>Find all topics playing one of a set of roles in an association of
one of a set of types whose scopes match a specific scope.</li>

<li>Find all topics playing one of a set of roles in an association of
one of a set of types, where one of a set of topics plays one of a set
of roles, whose scopes match a specific scope.</li>

<li>Find the topic that has a specific resource as one of its subject
indicators.</li>

<li>Find the topic that has a specific resource as its subject
address.</li>

<li>Find all topics that play one of a set of roles in instances of
one of a set of association types.</li>
</ol>

<h4>3.6.2. Queries returning associations</h4>

<ol>
<li>Find all associations whose scopes match a specific scope.</li>

<li>Find all associations that are instances of a specific type.</li>

<li>Find all associations where one of a set of topics play any role,
and whose scopes match a specific scope.</li>

<li>Find all associations where one of a set of topics play one of a
set of roles, and whose scopes match a specific scope.</li>
</ol>

<h4>3.6.3. Queries returning any topic map object</h4>

<ol>
<li>Find the object that has a specific resource as its source
locator.</li>

<li>Find all objects that are direct instances of a specific
type.</li>

<li>Find all objects that are instances of a specific type or any of
its subtypes.</li>
</ol>

<h4>3.6.4. Queries returning various types of objects</h4>

<ol>
<li>Find all the names of the topics in a particular set of topics,
whose scopes match a particular scope.</li>

<li>Find all the occurrences of the topics in a particular set of
topics, whose scopes match a particular scope.</li>

<li>Find all the occurrences of any of a particular set of types of
the topics in a particular set of topics, whose scopes match a
particular scope.</li>

<li>Find all the resources that are subject indicators of the topics
in a particular set of topics.</li>

<li>Find the resources that are the addressable subjects of the topics
in a particular set of topics.</li>
</ol>
    
<H2>4. Non-Requirements</H2>

<P>Requirements listed in this section are for various reasons not in
the scope of TMQL.</P>

<OL>
  <LI>The TMQL standard shall not include an API to query processors
    in parts 1 (querying) or 2 (modification) of the standard. One may
    be defined in later parts.</LI>
  <LI>The TMQL standard shall not define mechanisms for specifying validity
    constraints on topic maps. It may be used by other specifications and
    software to define such constraints.</LI>
  <LI>The TMQL standard shall not define a natural language query
    interface.</LI>
</OL>

<h2>5. Acknowledgements</h2>

<p>
This document is based on input from 
</p>

<ul>
<li>many <a href="http://www.topicmaps.org">TopicMaps.Org</a>
meetings,</li> <li>many <a
href="http://www.ornl.gov/sgml/sc34/sc34home.htm">ISO SC34</a>
meetings,</li> <li>the <a
href="http://www.infoloom.com/mailman/listinfo/topicmapmail">topicmapmail</a>
and <a href="http://groups.yahoo.com/group/xtm-wg">xtm-wg</a>, and <a
href="http://groups.yahoo.com/group/tmql-wg">tmql-wg</a> mailing
lists, and</li>
<li>it is also based on work done by a former editor, Ann
Wrightson.</li>
</ul>

<h2>6. Revision history</h2>

<p>
Changes from version 0.9.0 to version 1.0:
</p>

<ul>
<li>The word 'update' was replaced with 'modification' in section 1,
second paragraph.
<li>Links were added to the text of requirements 3.5:1, 3.5:2, 3.5:6,
and 3.5:7.
<li>Requirements 2:2, 2:3, 2:6, 2:8, 3.1:4, 3.4:2, 3.5:4, 3.5:6, and
4:1 were modified.
<li>Requirements 3.1:7 and 3.2:4 were added.
</ul>

<p>
Changes from version 0.8.2 to version 0.9:
</p>

<ul>
<li>Section 3.4 was added.
<li>Sub-section numbers were added.
<li>Prose of introductory paragraphs slightly improved.
<li>Requirements 2:3, 2:6, 2:8, 2:9, 3.1:3, 3.1:4, 3.2:2, and 3.3:6
    were modified.
<li>Requirements 3.1:5, 3.1:6, 3.3:4, 3.3:5, 3.5:9, and 3.6.4:3 were added.
<li>Revision history was added.
</ul>

</body>
</html>