home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / cdrom / ata / sfql-ovr.txt < prev    next >
Text File  |  1991-05-11  |  42KB  |  924 lines

  1.                           -------------------
  2.                           ATA 89-9C MONOGRAPH
  3.                           -------------------
  4.  
  5.  
  6.     ------------------------------------------------------------------
  7.                CD-ROM Disc Interchangeability standards:
  8.  
  9.                             Beyond iso 9660
  10.  
  11.           with the Structured Full-Text Query Language (SFQL)
  12.  
  13.  
  14.                             Neil R. Shapiro,
  15.                          Elias Diamantopoulos,
  16.                             and Paul Cotton
  17.  
  18.      (A typeset version of this document can be obtained from Scilab
  19.       Inc., 1921 Hexam Rd, Schenectady, NY 12309.  (518) 393-1526; Fax
  20.       at same number via autoswitch)
  21.  
  22.     ------------------------------------------------------------------
  23.  
  24.                                 ABSTRACT
  25.  
  26.     Today, data on CD-ROM can only be accessed using the retrieval
  27.     software that comes with the disc.  This often means that end-users
  28.     must work with several user interfaces.  The Air Transport
  29.     Association (ATA) has addressed this issue by developing a software
  30.     interface standard which allows a single retrieval application to
  31.     work with discs from multiple sources.  A key component of this
  32.     strategy is the Structured Full-Text Query Language (SFQL).  This
  33.     paper provides an overview of the SFQL language, and the ATA efforts
  34.     to develop and test it.
  35.  
  36.     ------------------------------------------------------------------
  37.                       LIST OF ACCOMPANYING FIGURES
  38.  
  39.     Figure 1.  SFQL Conceptual Model. (OVRFIG1.PCX)
  40.  
  41.     Figure 2.  Client/Server architecture for SFQL (OVRFIG2.PCX)
  42.  
  43.     Figure 3.  Client/Server components and the need for
  44.              standardization. (OVRFIG3.PCX)
  45.  
  46.     Figure 4.  SFQL server design based on existing engine. (OVRFIG4.PCX)
  47.  
  48.     Figure 5.  Terminology Comparison between SQL and SFQL (OVRFIG5.PCX)
  49.  
  50.     Figure 6.  Illustration of SFQLCA with child substructures (VLR and
  51.              FSR) (OVRFIG6.PCX)
  52.     ------------------------------------------------------------------
  53.  
  54.  
  55. INTRODUCTION
  56. ------------
  57.  
  58. The reliability of commercial aircraft is something we dare not
  59. take for granted--it requires top quality maintenance.  For this
  60. reason, the commercial aerospace industry devotes significant
  61. resources to producing high quality, up-to-date maintenance
  62. documentation.  The industry thus monitors new technology
  63. closely in order to improve the traditional publishing methods.
  64. It should come as no surprise then, that both the airlines and
  65. the aerospace manufacturers have been actively testing CD-ROM
  66. technology as a way to improve the efficiency of technical
  67. publishing.
  68.  
  69. After three years of field trials, CD-ROM has proven to be a key
  70. technology in the aerospace industry.  Foremost among the list
  71. of achievements is the improved accessibility of data provided
  72. by electronic access to documents on CD-ROM.  Full-text
  73. retrieval, which provides complete ad hoc access, and hypertext
  74. technology, have begun to replace tedious manual processes for
  75. information inquiry on the maintenance hanger floor as well as
  76. in shop management operations of airlines.
  77.  
  78. CD-ROM has also changed the economics of document production
  79. --making management of information more cost effective for both
  80. aerospace manufacturers and airlines.  For example, periodic
  81. revisions to an engine shop manual may include as many as 2500
  82. pages and can cost as much as $160 to ship.  After receiving the
  83. revision, users may spend as many as 6 hours collating the
  84. revised pages into the manuals.  With CD-ROM, a completely
  85. revised set of manuals can be sent to users at a lower cost than
  86. that of the paper revisions alone.
  87.  
  88. But experience has also shown that the state-of-the-art of
  89. CD-ROMs are not advanced enough to support the aerospace
  90. industry's needs.  Airlines have heterogeneous fleets of
  91. airframes and engines, and thus support documentation comes from
  92. many different suppliers.  The suppliers, to meet their own
  93. production needs, select different vendors to produce the
  94. CD-ROMs.  And the CD-ROMs that come from different vendors are
  95. incompatible.
  96.  
  97. The incompatibilities are driven by software.  Each disc comes
  98. with its own retrieval software, and only that software can be
  99. used with the disc.  A CD-ROM produced with Retrieval System A
  100. cannot be accessed using Retrieval System B, or vice versa.  In
  101. other words, CD-ROMs are Software Dependent.
  102.  
  103. Thus, to the airline end-user, state-of-the-art CD-ROMs mean
  104. multiple user interfaces for working with multiple discs--even
  105. when the discs contain standardized information, such as manuals
  106. produced according to their industry documentation standard, ATA
  107. Specification 100.  And multiple user interfaces, i.e., multiple
  108. software applications, opens the door for system
  109. incompatibilities over platforms, operating systems, windowing
  110. environments, and input/output devices such as monitors,
  111. printers, or specialized hardware.
  112.  
  113. CD-ROM standards are the answer to this problem.  Yet, despite
  114. landmark efforts which have standardized CD-ROMs to the file
  115. level (ISO 9660), there are no CD-ROM standards in place that
  116. will allow a single system to serve as the retrieval software
  117. for discs from different vendors.
  118.  
  119. The technical reason for this incompatibility is the lack of
  120. file content standards for CD-ROM.  But file content standards
  121. would not be sufficient to produce software independent CD-ROMs.
  122.  There is more than data on the disc, there is metadata--data
  123. about data, in the form of indexes for full-text retrieval or
  124. columnar retrieval (relational) technology, and hypertext links,
  125. electronic cross references.
  126.  
  127. Moreover, standards for metadata are not likely to appear--not
  128. only because they could not cover the breadth of requirements
  129. for CD-ROM retrieval systems, but because the proprietary nature
  130. of metadata is the basis of competition for system performance
  131. and features.  (However, it should be noted that a program to
  132. provide a standard format for full-text databases is underway at
  133. the U.S. Air Force Electronic Systems Division, Hanscom Air
  134. Force Base, MA.)
  135.  
  136. One solution to this is to build retrieval systems using a
  137. client/server architecture to separate the end-user interface
  138. from the underlying metadata access routines.  The server
  139. software would be distributed with each disc and would
  140. understand the vendor-dependent format of the metadata.  The
  141. server would accept commands via a standard interprocess request
  142. language and would return data in standardized formats to any
  143. other software program acting as its client.  Thus, any vendor's
  144. end-user retrieval software (the client) could operate with any
  145. other vendor's disc--disc interchangeability.
  146.  
  147. ATA STANDARDS FOR CD-ROM
  148. ------------------------
  149.  
  150. Given the importance of the CD-ROMs to publication of
  151. maintenance documentation, the Air Transport Association (ATA),
  152. the standards governor of the airlines, has taken the initiative
  153. to define standards to provide software independence of CD-ROMs
  154. (Shapiro and Bowers, 1989).
  155.  
  156. The Structured Full-Text Query Language (SFQL), is a key
  157. component of this strategy.  SFQL is designed to serve as the
  158. standard interprocess request language between the client and
  159. server.  SFQL provides both a standard method of data request
  160. (e.g., a query), and a standard method of data return.
  161.  
  162. As its name suggests, SFQL is based on the ANSI and ISO
  163. Structured Query Language (SQL), the industry standard query
  164. language for relational databases.  The standard SQL would not
  165. be sufficient to serve as the client/server request language for
  166. the ATA CD-ROMs:  SQL is designed primarily for relational
  167. database access; the ATA requires the features of a full-text
  168. (fully indexed) database on the CD-ROM.  SFQL is thus an attempt
  169. to extend SQL to full-text databases.
  170.  
  171. Starting with the existing standard, SQL, as the basis for a
  172. full-text retrieval language provides leverage in the design and
  173. use of the new standard.  Foremost, it provides a potential
  174. bridge between full-text and relational databases.  Although
  175. initially the ATA is looking to full-text databases only, it
  176. will be possible in the future to provide a combined
  177. full-text/relational server which could provide the client with
  178. transparent use of the two database types.  In addition, the
  179. common language reduces the learning curve for those familiar
  180. with SQL, and thus promotes acceptance of the standard.
  181.  
  182. In order to base the new language on SQL, however, an analogy is
  183. needed between relational and full-text databases so that common
  184. areas can be mapped to SQL.  This is not as difficult as it
  185. seems: full-text systems have evolved to handle structured data,
  186. just as relational systems have evolved to deal with free text.
  187.  
  188. Consider a full-text database, which is comprised of a set of
  189. documents.  When we perform a search, the results are also a set
  190. of documents.  Likewise, a table in a relational database
  191. contains a set of rows.  When we perform a query against a
  192. table, the result is a set of rows.  The key difference between
  193. a document in a full text database and a row in a relational
  194. database, then, is that the relational  database row is rigidly
  195. structured: the row is divided up into fields (called columns).
  196.  
  197. Documents in full-text databases are not really unstructured, of
  198. course.  There are a number of logical elements in the data,
  199. which may be "tagged" using a mark-up language.  Most full-text
  200. databases permit searches to be restricted in domain to one or
  201. more of these tags--much in the same way a relational database
  202. permits searches on specific columns.
  203.  
  204. When the tagged fields of the document represent unique,
  205. nonoverlapping attributes, it is easy to see the analogy between
  206. the full-text and the relational models.  The analogy,
  207. illustrated in Figure 1, is used to map SQL to full-text
  208. databases.
  209.  
  210. This analogy is, of course, based on a class of full-text data
  211. where the structure can be easily compared to the table-based
  212. relational model, since tag-fields are nonhierarchical.  While,
  213. in fact, most full-text systems support only nonhierarchical
  214. tags, many documents are better described by a hierarchical
  215. model (e.g., ATA Maintenance/Engine Shop Manuals).  We shall see
  216. later how hierarchical relationships can be represented in an
  217. SFQL database.
  218.  
  219. ARCHITECTURE
  220. ------------
  221.  
  222. SFQL is a key part of the ATA client/server architecture for
  223. CD-ROM database interchangeability, as shown in Figure 2.  SFQL
  224. is the language used by the end-user software (the client) to
  225. query and request data from one or more retrieval engines
  226. (servers).  SFQL also specifies a standard data return
  227. structure, the SFQLCA, which is a wrapper to return variable
  228. length data in multiple formats, so that a query may return both
  229. text and graphics.
  230.  
  231. With this approach, the same end-user software can be used with
  232. discs from different vendors.  The user simply inserts a new
  233. disc, and behind the scenes, the end-user software connects with
  234. the retrieval engine supplied on the new disc.  Whichever disc
  235. is loaded, when the user enters a search request (for example,
  236. by filling in a form), the request is translated into a series
  237. of SFQL statements, which are sent to the retrieval engine.  The
  238. retrieval engine, in turn, packages all responses in the
  239. standard SFQLCA return structure.
  240.  
  241. Note that SFQL itself is not sufficient to provide disc
  242. interchangeability.  A number of other standards must come into
  243. play to orchestrate the interaction between client and server
  244. (see Figure 3).  For example, an end-to-end communications
  245. protocol is required to ensure error free transfer of SFQL
  246. requests and data return.  Since a number of applicable
  247. standards exist, depending on platform, the ATA plans to adopt
  248. the prevalent standard for each specific platform.  Data format
  249. standards are also required: SFQL only defines the envelope in
  250. which the server returns data--the contents must still be
  251. interpretable by the client.
  252.  
  253. Thus, the ATA standards cover Layers 1 to 3, which will provide
  254. disc interchangeability.  But only Layer 2, SFQL Language and
  255. Return Data Structures, represents a significant new development
  256. that might provide benefits to the entire CD-ROM industry.
  257.  
  258. PROOF OF CONCEPT
  259. ----------------
  260.  
  261. To test whether the ATA standards could provide software
  262. independence for CD-ROMs, a proof of concept experiment was
  263. undertaken in December of 1989.  GE (a manufacturer of jet
  264. engines) and Aerospatiale (an airframe manufacturer) each set
  265. out to develop a complete full-text retrieval system in
  266. compliance with the draft standard.  The plan was that each
  267. company would independently develop prototype systems consisting
  268. of a client and a server which communicate using SFQL.  After
  269. the prototypes were developed, an interchange test would be
  270. performed.  If software independence was achieved,
  271. Aerospatiale's client should work with GE's server as well as
  272. the Aerospatiale server;  Likewise, GE's client should work with
  273. both companies' servers.
  274.  
  275. Rather than building complete full-text systems from scratch, GE
  276. and Aerospatiale chose to build servers using commercial
  277. full-text systems.  The idea was to encapsulate the existing
  278. system into a server using an interprocess interface based on
  279. SFQL.  The server would translate incoming SFQL requests to the
  280. proprietary system's interface, and conversely, would format
  281. outgoing data into SFQL defined return structures.  Figure 4
  282. illustrates this design.
  283.  
  284. GE built its server using KnowledgeSet's (Monterey, CA) KRS
  285. retrieval engine while Aerospatiale used Fulcrum Technologies'
  286. (Ottawa, Canada)  Ful/Text engine.  Both servers were developed
  287. for Microsoft Windows (MS-Windows) using Microsoft C and the
  288. MS-Windows Software Development Kit, as well as libraries from
  289. Fulcrum and KnowledgeSet.  The servers proved to be good test
  290. cases for the experiment, since they differed significantly in
  291. their design assumptions.
  292.  
  293. GE and Aerospatiale each developed their own client applications
  294. using C and the window-based graphical user interface provided
  295. by MS-Windows.  GE developed two different types of client: (1)
  296. an Interactive SFQL (ISFQL) front-end which allowed dynamic
  297. testing of SFQL queries simply by highlighting one or more SFQL
  298. statements in the editor window; and (2) a general purpose
  299. query-by-forms application.  The latter application was designed
  300. to demonstrate a form-based application that was not tied to a
  301. particular database design: it did not have field names bound to
  302. the form.  Field names were supplied at run-time to the client
  303. dialog by the server, and selected by the user via point and
  304. click techniques.
  305.  
  306. Aerospatiale also developed a query-by-forms application,
  307. although with a markedly different user interface.  It was
  308. designed under a more rigid set of assumptions in order to
  309. provide the type of straightforward, easy-to-use interface that
  310. would be placed in an airline maintenance bay.
  311.  
  312. In addition to the existing SFQL, the prototype development
  313. required writing an end-to-end communication protocol, not
  314. included as part of SFQL, to provide the underlying interprocess
  315. communications.  The specification that resulted, based on
  316. Microsoft's DDE, eventually became the ATA proposed standard for
  317. the PC's DOS/Windows environment (ATA 89-9C.WINCOMM-R2-1990).
  318.  
  319. The prototypes were successfully demonstrated at the February
  320. 1990 AIA/ATA meeting in Washington, D.C.  Each system was first
  321. shown performing queries and retrieval from its "native" server.
  322.  This demonstrated that the systems were similar to the CD-ROM
  323. applications familiar to the ATA: there was nothing new
  324. there--everyone had used proprietary retrieval systems.
  325.  
  326. The magic came with each application's derivative of a "New
  327. Disc" menu item.  What made this option different, of course,
  328. was that either GE's or Aerospatiale's disc could be inserted
  329. and used with the application, without exiting, rebooting,
  330. reconfiguring, or restarting.  The menu item, transparent to the
  331. user, disconnected from the current server, allowed the user to
  332. change discs, and then established a new connection with the
  333. server on the new disc.  To the user, this operation
  334. demonstrated disc interchangeability.
  335.  
  336. PROTOTYPE RESULTS
  337. -----------------
  338.  
  339. The prototype effort was the first known demonstration of
  340. database interchangeability among full-text engines.  The effort
  341. validated the client/server model for disc interchangeability,
  342. and the selection of SQL as the basis for the client/server
  343. language.
  344.  
  345. The prototypes also uncovered some problems with the original
  346. SFQL specification.  The most major problem was the initial
  347. assumption that clients using locator information returned by
  348. SFQL should, be allowed to access the disc directly for data
  349. access.  The design was supposed to optimize performance of
  350. applications by not requiring large data transfers to be made
  351. through the client/server interface.  However, the design was in
  352. direct conflict with many existing systems which store the data
  353. internally in proprietary formats according to their own
  354. optimization goals (e.g., space or performance).  More
  355. importantly, the approach violated one of the initial design
  356. premises: standardize only the interface between layers and give
  357. the implementors as much flexibility as possible within either
  358. layer (server or client).
  359.  
  360. SFQL2 DEVELOPMENT
  361. -----------------
  362.  
  363. The ATA has addressed this and other language issues by forming
  364. a joint ATA/Vendor SFQL working group.  Vendors were invited to
  365. participate in a review of the proposed standard in January,
  366. 1989, and in October, 1990, at ATA headquarters in Washington,
  367. DC.  At the October meeting, the SFQL working group of
  368. volunteers was formed to draft a second version of the language
  369. (89-9C.SFQL2-R1-1990).
  370.  
  371. Vendors represented on the committee included Context
  372. Corporation,  Electronic Data Systems (EDS), Fulcrum
  373. Technologies, IBM, KnowledgeSet, Maxwell Data Management, and
  374. TMS.  The ATA was represented by American Airlines, British
  375. Airways, and four aerospace industry representatives (airline
  376. suppliers): Aerospatiale, Boeing, Douglas, and GE.
  377.  
  378. The group completed the draft specification in meetings spanning
  379. over 12 days, using a JAD-based methodology Joint Application
  380. Design is a method invented by IBM in which users and developers
  381. work as a team to develop a set of system specifications.
  382. Although not traditionally applied to this type of effort, JAD
  383. turned out to be an effective means for integrating the
  384. knowledge of this diverse group.
  385.  
  386. Foremost among the changes, the SFQL model is now entirely black
  387. box.  Both search and data access now work through the
  388. SFQL-based interprocess communications.  This makes it easier
  389. for vendors to comply with the standard, leaves room for
  390. innovations which improve performance or functionality, and can
  391. provide greater upward compatibility as the underlying search
  392. engine technology evolves.
  393.  
  394. The SFQL2 specification, along with several other related draft
  395. ATA retrieval standards, are now undergoing further validation
  396. testing.  The validation testing will assert that SFQL, combined
  397. with a number of other key standards (e.g., the logical
  398. partitioning of documents using SGML based mark-up), provide an
  399. effective, software independent solution for technical
  400. documentation delivery on CD-ROM.
  401.  
  402. In the next sections, we will provide a look at the SFQL
  403. language itself, including a discussion of SQL extensions to
  404. support hierarchical tags.
  405.  
  406. THE SFQL LANGUAGE
  407. -----------------
  408.  
  409. The draft SFQL standard (ATA 89-9C.SFQL2-R1-1990) was written by
  410. a group of volunteers representing the Aerospace Industry
  411. Association, the Air Transport Association, and interested
  412. vendors.  The specification was based on ANSI SQL (ANSI
  413. X3.135-1986).  Since the primary focus of the ATA standards is
  414. CD-ROM based retrieval, not all of the features of the ANSI
  415. specification were included.  Specifically, features relating to
  416. dynamic database updates, dynamic view definition, transaction
  417. processing, and database definition were deferred as low
  418. priority items in a data publishing paradigm.  Other features
  419. such as SQL subselects and subqueries were deferred because the
  420. cost/benefit ratio of complexity to usefulness was too high.
  421. Finally, some features such as joins were excluded because we
  422. did not yet fully understand all of the implications of the
  423. operation in the full-text environment.
  424.  
  425. Thus, the nucleus of SFQL is a subset of the 1986 ANSI SQL
  426. specification.  The SFQL Working Group then extended this base
  427. language to include features for full-text query and data
  428. manipulation which are not part of SQL.  All new language
  429. constructs were added under the restriction that they were used
  430. in a manner consistent with SQL.  Further, as extensions were
  431. designed, the working group referred to newer drafts of the ANSI
  432. and ISO SQL standards, to avoid reinventing features which had
  433. been specified by ANSI or ISO but were not yet approved.  When a
  434. new feature was needed, the potential for conflict with new SQL
  435. features was evaluated and factored into the design.
  436.  
  437. DEFINITIONS
  438. -----------
  439.  
  440. The SFQL specification introduces some new nomenclature to help
  441. users map document-based concepts into the table-based metaphor
  442. used in SQL.  The mapping between the two sets of terminology is
  443. given in Figure 5.
  444.  
  445. An SFQL database consists of one or more collections, analogous
  446. to SQL tables.  Each collection is a set of document-records
  447. (SQL rows), where a document-record may contain all or part of
  448. the information we normally associate with a paper document.
  449. Document-records are divided into fields; since these fields,
  450. analogous to the columns of an SQL table, are typically derived
  451. from a marked ("tagged") area of a document, they are formally
  452. referred to as tag-fields.  Tag-fields may contain the entire
  453. source document,  a specific portion of it such as the title or
  454. abstract, or may contain a single item (such as a part number).
  455. Tag-fields are created by marking up documents with a standard
  456. markup language, such as SGML, or via vendor-specific methods
  457.  
  458. LANGUAGE SYNTAX
  459. ---------------
  460.  
  461. SFQL is very simple.  It consists of three general statement
  462. types: SELECT, CURSOR, and SET.  The SELECT statement is used to
  463. formulate all queries.  CURSOR is a family of four statements
  464. (DECLARE, OPEN, FETCH, and CLOSE) which request return of data
  465. one record (or portion of a record) at a time.  SET is used to
  466. configure options in the SFQL server.  These constructs are
  467. familiar to anyone who has used an SQL-based relational
  468. database, since they are used in the same way as in SQL.  (SET
  469. is found in most SQL databases; however, it is not part of ANSI
  470. X3.135-1986.)
  471.  
  472. THE SELECT STATEMENT
  473. --------------------
  474.  
  475. The heart of the SFQL data manipulation language is the SELECT
  476. statement, used to express queries.  It consists of three basic
  477. clauses:
  478.  
  479.     SELECT return_list
  480.     FROM collection [UNION collection]
  481.     WHERE predicate ;
  482.  
  483.  
  484. The SELECT clause is used to specify a list of tag-fields to be
  485. returned from matching document-records in the collection(s)
  486. indicated in the FROM clause.
  487.  
  488. The WHERE clause is used to specify a predicate which indicates
  489. the criteria for including document-records in the result set.
  490.  
  491. The result of the query will be a new, temporary collection,
  492. called the search-results, containing all the document-records
  493. that matched the criteria in predicate, but where each
  494. document-record consists only of the data in the tag-fields
  495. specified in the return_list.
  496.  
  497. The structure and purpose of the SFQL SELECT statement presented
  498. above is basically the same as that of SQL.  One important
  499. difference, however, is in the FROM clause.  The SQL FROM clause
  500. allows a comma-separated list of tables (collections).  This is
  501. the basis of the SQL join operation, which as mentioned earlier,
  502. is not currently included in SFQL.  However, multiple
  503. collections may be searched by means of the UNION operator in
  504. the FROM clause, which was adopted from the draft specification
  505. of SQL3.  Unlike a join, the UNION operation performs a simple
  506. set-based union of the collections prior to the search.
  507.  
  508. PREDICATE EXTENSIONS
  509. --------------------
  510.  
  511. The most significant extensions to the SQL SELECT involve the
  512. addition of predicates to permit full-text searches such as
  513. domain-restricted search and proximity search.
  514.  
  515. Domain-restricted search is used to find a word or phrase in a
  516. particular tag-field of each document-record.  This improves the
  517. precision of a search, compared to a word or phrase search
  518. conducted across an entire document.  For example, one could
  519. search for all document-records containing the name "Smith" in
  520. the authors tag-field.  The SFQL query for this would look like:
  521.  
  522.     SELECT authors
  523.     FROM Publications
  524.     WHERE authors CONTAINS 'Smith' ;
  525.  
  526. Proximity search is used to locate a phrase or sentence where
  527. the exact wording is not known.  It enables the user to search
  528. for a word within a specified number of units of another word,
  529. where units consist of characters, words, sentences, or
  530. paragraphs.  For example;
  531.  
  532.     SELECT DOCUMENT
  533.     FROM Publications
  534.     WHERE DOCUMENT CONTAINS 'turbine' WITHIN 3 WORDS OF
  535.                     'power generation' ;
  536.  
  537. This query would return the entire text of any document-record
  538. in the collection Publications where the word "turbine" is three
  539. words or fewer before or after the phrase "power generation".
  540. The keyword DOCUMENT is a special reserved name which represents
  541. the entire document-record as a single tag-field.
  542.  
  543. Of course, SFQL also includes the standard SQL relational
  544. predicates such as "=", ">", and "<", which can be combined with
  545. proximity or domain-restricted search using traditional boolean
  546. operations (AND, OR, NOT).  For example, to find the titles of
  547. all articles published in Byte after 1989 concerning "SGML":
  548.  
  549.     SELECT titles
  550.     FROM Articles
  551.     WHERE date > DATE(1989-12-31)
  552.            AND source = 'Byte'
  553.           AND DOCUMENT CONTAINS 'SGML' ;
  554.  
  555. Note that in this query, the source tag-field in the
  556. document-record would have to contain the text "Byte", exactly
  557. as specified, since relational operators are used in SFQL
  558. exactly as they are in SQL.  This means that the comparisons are
  559. made without the benefit of the text processing used in
  560. proximity and domain searching.
  561.  
  562. CURSOR OPERATIONS
  563. -----------------
  564.  
  565. An SFQL SELECT statement is typically embedded in a cursor to
  566. control the flow of return data.  A SELECT which is not embedded
  567. in a cursor can only return a single document-record.  This is
  568. sometimes useful, however, to perform return results of
  569. functions such as HITS() or SYSTEMINFO().
  570.  
  571. A cursor is simply a pointer used to direct access to rows in
  572. the collection that results from a search.  The cursor is
  573. defined via a DECLARE statement, which associates it with a
  574. SELECT statement (a query).  The basic syntax is:
  575.  
  576.     DECLARE cursor_name
  577.     CURSOR FOR select_statement;
  578.  
  579. where cursor_name can be subsequently used to access the results
  580. of the select_statement.  Note that this operation only stores
  581. the definition of the cursor; the actual search is not performed
  582. until the cursor is opened as:
  583.  
  584.     OPEN cursor_name;
  585.  
  586. Once the search is conducted, the data in the search-results
  587. need to be retrieved.  The FETCH statement is used for this.
  588. The basic syntax is:
  589.  
  590.     FETCH cursor_name ;
  591.  
  592. The fetch brings back the data in the tag-fields specified in
  593. the SELECT statement for the current document-record.  The
  594. cursor starts at the top of the search-results, pointing to the
  595. first document-record, and then moves down document-record by
  596. document-record with each successive fetch.  Thus, the first
  597. time a fetch is issued the first document-record is retrieved;
  598. the second fetch retrieves the second document-record, etc.
  599. When all the document-records have been retrieved, a FETCH
  600. statement returns an exception condition.
  601.  
  602. The SFQL cursor operations just described are identical to that
  603. of SQL.  A few language extensions were made, however, to
  604. accommodate differences in the quantity of data expected in the
  605. two types of databases.
  606.  
  607. In SQL-based databases, a row is typically short in length (a
  608. maximum record length is usually enforced by the database
  609. system).  In contrast, for full-text systems, document-records
  610. are typically very large.  Thus, the user needs to control which
  611. fields within a document-record to return, and must be able to
  612. return portions of the data within the fields.  In SQL, control
  613. over this is provided entirely within the SELECT clause.   In
  614. other words, fetches based on the cursor:
  615.  
  616.     DECLARE cursor1
  617.     CURSOR FOR
  618.           SELECT author, title
  619.           FROM abstracts;
  620.  
  621. return only the author and title of each row (which could
  622. contain other fields such as journal, date, and abstract).  But,
  623. in SQL, after opening the cursor, the application cannot change
  624. the list of return fields without redefining the cursor and
  625. reexecuting the query.  Thus, in SQL, a declared cursor would
  626. typically list all fields of interest in the SELECT, and the
  627. application would discard any fields that were not needed on a
  628. particular fetch.
  629.  
  630. In SFQL databases, where document-records are expected to be
  631. very long, this restriction would place an unnecessary burden on
  632. client/server communications.  Therefore, in SFQL, the cursor
  633. FETCH operation, used to retrieve data document-record by
  634. document-record, was extended to allow the return_list to be
  635. changed on a document-record by document-record basis.  The
  636. mechanism for this enhancement was to add a FIELDS clause to the
  637. FETCH statement.  The FIELDS clause is specified in the FETCH
  638. statement as:
  639.  
  640.     FETCH cursor_name
  641.     FIELDS return_list ;
  642.  
  643. The FIELDS clause allows the FETCH to return a subset of the
  644. items in the SELECT clause of the cursor declaration.  Because
  645. the FIELDS clause may be included with each FETCH statement, the
  646. list of items returned may be changed for every document-record
  647. in the search-results.  For example,
  648.  
  649.     FETCH cursor1
  650.     FIELDS author;
  651.  
  652. for the above query would only return the tag-field author for
  653. the current document-record.
  654.  
  655. To illustrate how this feature fits into the development of an
  656. application, consider the following scenario.  When the user
  657. issues a query, the system conducts the search and returns
  658. summary data identifying which documents matched the search
  659. criteria.  For example, this summary information might consist
  660. of the document title and author.   The user then selects the
  661. documents of interest directly from this summary information.
  662. As the user makes further choices from the summary, the client
  663. requests more information about the matching document using the
  664. FIELDS clause of the FETCH, without the need to reissue the
  665. query and without affecting the original search-results, which
  666. comprise the summary list.
  667.  
  668. THE "HORIZONTAL" CURSOR
  669. -----------------------
  670.  
  671. Using the FIELDS clause to return partial document records by
  672. tag-fields helps in limiting the amount of information returned
  673. as a result of a query.  However, in many full-text databases a
  674. tag-field itself might be very large--for example, in a
  675. collection of famous novels, the tag-field DOCUMENT could return
  676. the entire text of War And Peace.  Further, unlike most
  677. relational database (SQL) queries, the criteria which qualified
  678. this record for the search-results is not the entire tag-field,
  679. but a relatively small portion of it.  To return data from
  680. within a tag-field relative to the areas that matched the
  681. predicate, the SFQL function HIT_TEXT() is used in the FIELDS
  682. clause of the fetch.  The general form of HIT_TEXT is:
  683.  
  684.     HIT_TEXT (tag_field_spec,fetch_orientation, maxlength,
  685.              hit_justification, tag_list)
  686.  
  687. where fetch_orientation indicates the direction of movement of
  688. the horizontal cursor, either PREVIOUS, NEXT, ABSOLUTE n, or
  689. RELATIVE n--the same terms used in the standard FETCH "vertical"
  690. cursor.  The maxlength argument is used to specify the amount of
  691. text to return.  To control the position of the matched text in
  692. the return buffer, hit_justification is used to specify the
  693. return of text either before, after, or centered about the
  694. matched text.  In any case, the actual matched text will be
  695. marked in the document using special, configurable character
  696. codes called match-codes.  The last argument, tag_list, is a
  697. blank-separated list of tags to remove (only the tag itself is
  698. removed, not the tagged text) before returning the text.  The
  699. keyword ALL can be used in the tag_list to filter all tags out
  700. of the return text.
  701.  
  702. For example,  to return 1000 characters of text centered around
  703. the first hit in the current document-record, with all tags
  704. removed, the following FETCH would be sent to the server:
  705.  
  706.     FETCH cursor1
  707.     FIELDS HIT_TEXT(DOCUMENT, NEXT, 1000, CENTERED, 'ALL') ;
  708.  
  709. To retrieve the same amount of text around the next hit, this
  710. FETCH statement would be reissued.
  711.  
  712. After examining the text surrounding a hit and deciding the
  713. document is relevant, users often want to scroll through the
  714. adjacent information.  The DATA function provides this
  715. capability in SFQL.  The format of the DATA function is:
  716.  
  717.     DATA (tag_field_spec, fetch_orientation, maxlength, tag_list)
  718.  
  719. which are interpreted as they are for HIT_TEXT above.
  720.  
  721. For example, to return the next block of 1000 characters of text
  722. following our HIT_TEXT example above:
  723.  
  724.     FETCH cursor1
  725.     FIELDS DATA(DOCUMENT, NEXT,1000,'ALL') ;
  726.  
  727. Likewise, to return the last 1000 characters in the DOCUMENT:
  728.  
  729.     FETCH cursor1
  730.     FIELDS DATA(DOCUMENT, LAST,1000,'ALL') ;
  731.  
  732. The DATA function can also work independently of the HIT_TEXT
  733. function.  This function can be used to request blocks of data
  734. from a tag-field on user demand.  This is useful for tag-fields
  735. containing lengthy text or large amounts of graphics data.
  736.  
  737. Thus:
  738.  
  739.     FETCH cursor1
  740.     FIELDS DATA(illustration, FIRST, 1000, 'ALL') ;
  741.  
  742. returns the first 500 characters of the tag-field abstract, and:
  743.  
  744.     FETCH cursor1
  745.     FIELDS DATA(illustration,
  746.     ABSOLUTE 3, 500, 'ALL') ;
  747.  
  748. returns characters the characters in positions 1001 - 1500 of
  749. the tag-field.
  750.  
  751. THE SET STATEMENT
  752. -----------------
  753.  
  754. The SET statement is included in SFQL to give the user control
  755. over server operations.  In full-text systems, a query can
  756. result in a very large number of document-records, which can tie
  757. up system resources needlessly both in terms of memory and
  758. processing time.  For example, to eliminate the possibility of
  759. an excessive number of document-records returned by a query, the
  760. following statement can be issued:
  761.  
  762.     SET MAX_SEARCH_RECORDS(100);
  763.  
  764. which limits the number of document records to 100.
  765.  
  766. Similarly, the functions SUSPEND and RESUME are used by the
  767. client to interrupt (or resume) an operation at the server that
  768. is taking too much time.  To suspend a particular search, the
  769. client could issue the SFQL statement:
  770.  
  771.     SET SUSPEND(cursorname) ;
  772.  
  773. where cursorname represents the name of the cursor-based search
  774. that is ongoing.
  775.  
  776. There are a number of other SET functions in SFQL, which control
  777. important aspects of the server other than resource allocation.
  778. For example, the MATCH_METHOD function determines whether or not
  779. case is significant during queries, or whether fuzzy matching
  780. (e.g., verb stemming) is in effect.
  781.  
  782. SFQL RETURN DATA STRUCTURES
  783. ---------------------------
  784.  
  785. The SFQL grammar provides a means to express queries and request
  786. data from the server.  A standard data return structure is also
  787. required, so that the client can interpret the data returned by
  788. the server.
  789.  
  790. SFQL specifies return of data and status information in a
  791. structure called the SFQL Communications Area (SFQLCA).  The
  792. SFQLCA has two parts, a header that contains status information,
  793. and a message area (SFQLMSG) which is used to return data or
  794. extended error messages.
  795.  
  796. The SFQLCA header is modeled after several popular SQL
  797. implementations.  (Although the concept of a communications
  798. areas is part of the SQL standard, the precise definition of an
  799. SQLCA is not.)  Among the more important items of the SFQLCA is
  800. the SFQLCODE, which provides an integer return code indicating
  801. the status of the operation.  (SQLCODE is the only part of SQL's
  802. SQLCA which is standard.)
  803.  
  804. The server responds to every SFQL statement sent by the client
  805. with an SFQLCA.  For example, the return SFQLCA may simply
  806. contain a "No Errors" status code following a "CLOSE cursor"
  807. statement, or it may contain an error message ranging from
  808. statement parse errors to resource limitation errors.
  809.  
  810. When data is returned in the SFQLMSG area, for example, in
  811. response to a FETCH, it is formatted in a special multi-field
  812. variable length return structure called a Variable Length Record
  813. (VLR).  The VLR permits the return of data from tag-fields of
  814. various types and sizes, from integers to large text or binary
  815. objects. Each data object is placed in a special container
  816. structure called a Field Subrecord (FSR).  The FSR header
  817. identifies the source of the data object, and its type.
  818.  
  819. A variable number of FSRs may be placed in a VLR.  Figure 6
  820. illustrates this in the context of the entire data structure
  821. hierarchy--from SFQLCA to FSR.  As the figure shows, there is
  822. one FSR returned for each of the items in the return_list of the
  823. FIELDS clause (or in the return_list of the SELECT if there is
  824. no FIELDS clause in the FETCH.)
  825.  
  826. For example the statement:
  827.  
  828.     FETCH cursor1
  829.     FIELDS title, author, abstract ;
  830.  
  831. would return an SFQLCA message with status information and a VLR
  832. containing three FSRs to hold the data associated with the
  833. title, author, and abstract return items.
  834.  
  835. CONCLUSIONS
  836. -----------
  837.  
  838. The architecture described here is an evolutionary step for
  839. CD-ROM technology.  It permits users to grow beyond a single
  840. major CD-ROM database application towards a complete CD-ROM
  841. information system.
  842.  
  843. The SFQL language also represents an evolutionary step for both
  844. full-text systems and relational databases.  SFQL provides
  845. full-text systems the features of SQL, a powerful and
  846. well-established query language standard for working with
  847. structured data.   SFQL provides relational database systems
  848. with the necessary language extensions to allow databases to
  849. exploit full-text capabilities.
  850.  
  851. But most importantly, SFQL is the first step in forming
  852. permanent bonds between these important technologies.  Although
  853. SFQL is not a complete superset of SQL, the groundwork has been
  854. laid to bridge the two technologies.  The underlying
  855. model--relational, full-text, or both--should be transparent to
  856. the client application during retrieval.  Then we will have
  857. truly achieved disc interchangeability.
  858.  
  859. BIBLIOGRAPHY
  860. ------------
  861.  
  862. ANSI X3.135-1986.  American National Standard for Information
  863. Systems--Database Language--SQL.  American National Standards
  864. Institute, New York, NY.
  865.  
  866. ATA, 1990.  ATA Specification 100, Appendix 1:  Digital Data
  867. Standards, Published by the Air Transport Association, 1709 New
  868. York Avenue Northwest, Washington D.C. 20006.
  869.  
  870. ATA 89-9C.COMMWIN-R2-1990.  CD-ROM Interchangeability
  871. Standard--Client/Server Communication Protocol: Microsoft
  872. Windows.  Air Transport Association, Washington, DC.
  873.  
  874. ATA 89-9C.SFQL2-R1-1990.  CD-ROM Interchangeability
  875. Standard--SFQL.  Air Transport Association, Washington, DC.
  876.  
  877. Shapiro, N.R. and Bowers, F.J. (1989).  Standardizing the
  878. delivery of technical documentation on CD-ROM's.  CD Data
  879. Report, pp. 21-28.
  880.  
  881. ABOUT THE AUTHORS
  882. -----------------
  883.  
  884. Neil R. Shapiro, Ph.D., is an independent consultant
  885. specializing in cooperative applications, user interface
  886. technology, and optical publishing.  As the original author of
  887. SFQL, he has represented GE Aircraft Engines in the ATA
  888. standards effort for the last two years.  He is a member of the
  889. IEEE Computer Society and the ACM.  Dr. Shapiro may be reached
  890. at Scilab Inc., 1921 Hexam Rd., Schenectady, NY, 12309.  TEL
  891. 518/393-1526, FAX: 518/393-1526 (automatic routing on carrier
  892. detect, or press Extension 11).
  893.  
  894. Elias Diamantopoulos, M.S., has been an engineer at GE's
  895. Ordnance Division since 1986, where he develops expert system
  896. based applications with hypermedia-based support.  He is
  897. currently working to define a paperless maintenance system for
  898. the Navy.  Mr. Diamantopoulos implemented GE's SFQL server
  899. prototype as part of a Master's Thesis for the University of
  900. Massachusetts.  He is a member of IEEE.
  901.  
  902. Paul Cotton is Technical Product Manager at Fulcrum
  903. Technologies, Inc, a supplier of full-text search and retrieval
  904. software.  Mr. Cotton was one of the key contributors in the
  905. SFQL Working Group.  He was a co-founder of Officesmiths, Inc.
  906. and principal designer of The Officesmith, an integrated text
  907. database and office automation package.  Mr. Cotton has M.Math
  908. and B.Math degrees in Computer Science from the University of
  909. Waterloo.  He can be reached at 560 Rochester Street, Ottawa
  910. Ontario Canada K1S 5K2 TEL: 613/238-1761 or EMAIL:
  911. uunet!fultech!pbc.
  912.  
  913.  
  914. -----------------------------------------------------------------
  915. Copyright 1991, Scilab Inc..
  916.  
  917. Permission to copy/download/upload, without fee, all or part of the
  918. material is granted provided that (1) This copyright notice is included
  919. in its entirety; (2) the copies are not made or distributed for direct
  920. commercial advantage; and (3) Scilab Inc. (1921 Hexam Rd, Schenectady,
  921. NY 12309-6510) is notified of the distribution details (e.g., the event
  922. at which it was distributed or the recipient names).
  923.  
  924.