CQL: Context Sets

Version 1.1, 12th January 2004

Introduction

Context sets are a mechanism similar in concept to XML's namespaces -- they permit users of the CQL language to create their own indexes, relations, relation modifiers and boolean modiers without fear of chosing the same name as someone else and thereby having an ambiguous query. All of the above aspects of CQL must come from a context set, however there are rules for determining the prevailing default if one is not supplied. Context sets allow CQL to be used by communities in ways which the designers could not have foreseen, while still maintaining the same rules for parsing which allow interoperability.

Defining a Context Set

When defining a new context set, it is necessary to provide a description of the semantics of each item within it. While context sets may contain indexes, relations, relation modifiers and boolean modifiers, there is no requirement that all should be present; in fact it is expected that most context sets will only define indexes.

This description must be provided in prose, and it is suggested it should follow the ISO 11179 standard for describing data elements used in databases and documents. It may also be useful to include a mapping to the Z39.50 attributes used, if there are any.

When designing a context set, it is expected that it will attempt to not duplicate other well known context sets. For example, the Dublin Core context set defines the 'title' index, so it would be redundant to include an index with the same semantics in a new set. Instead, a profile should be written in order to specify that servers should make a title index available. It might turn out that all that is required is a profile, as all of the indexes have been defined in other context sets.

Prefixes and Identifiers

Each context set has a unique identifier in the form of a URI. This ensures the uniqueness of each item within the context set. However, when sending the context set in a query, a short form is used rather than requring the full URI every time anything is referenced. These short names may be sent as a mapping in the query itself, or be published by the recipient of the query in some protocol dependant fashion. The prefix of 'cql' is well known for the default CQL context set, meaning that if CQL is not otherwises assigned to a URI, by a prefix in the query, then it should be assumed to be the latest version of the CQL context set. Servers should not redefine the 'cql' prefix to a different context set.

Known Context Sets

The following context sets have been defined and made public. If you wish to have your context set listed here, please provide the information to the maintenance agency.

Short NameIdentifierSummary/URL
cqlhttp://www.loc.gov/zing/cql/context-sets/cql/v1.1/The base context set
dchttp://www.loc.gov/zing/cql/dc-indexes/v1.0/Dublin Core metadata set
bathhttp://www.loc.gov/zing/cql/context-sets/bath/v1.1/Bath Profile context set
ztheshttp://zthes.z3950.org/cql/1.0/The ZThes thesaurus context set, v1.0.
ccghttp://srw.cheshire3.org/contextSets/ccg/1.1/Collectable card games context set
rechttp://srw.cheshire3.org/contextSets/rec/1.0/Record metadata
nethttp://srw.cheshire3.org/contextSets/net/1.0/Network resource information