an example ontology

Tom Gruber <>
Message-id: <2922600723-1933131@KSL-Mac-69>
Date: Wed, 12 Aug 92  02:32:03 PDT
From: Tom Gruber <>
To: srkb@ISI.EDU
Subject: an example ontology

                        THE BIBLIOGRAPHY ONTOLOGY
Author: Thomas Gruber
Version: 1
Last Modified: August 11, 1992

This file defines an ontology for representing bibliographic data, such as
those used in reference lists and document index databases.  The objective of
this ontology is to define the concepts and relationships that underlie a
family of databases and tools in the domain of bibliographies.  Such a
conceptualization is intended to help with automatic translation among
existing databases, to enable the development of reference-formatting styles
that are independent of database or tool, and to support remote services
such as bibliography database search and reference-list generation.

An ontology can be partitioned into theories.  This file contains the
GENERIC-BIBLIOGRAPHY, which establishes the basic terminology.
Child theories that include (specialize) the generic bibliography ontology
will describe the constraints of specific bibliographic databases and tools.

Basic ontological commitments:

A bibliography is made up of references.  A REFERENCE describes the
information needed to identify and retrieve a publication.  A publication is
associated with a DOCUMENT of some sort (e.g., a book or journal).  In some
cases there are several publications per document (e.g., papers in an edited
collection).  Thus documents are distinguished from references.  Documents
are created by AUTHORs, which are PEOPLE or other agents (e.g.,
ORGANIZATIONs).  They are published by PUBLISHERs or other organizations.

A very simple ontology of time is included.  A TIMEPOINT is a specification
of a single point in historical time.  CALENDER-DATE is a timepoint at the
resolution of days; that is, the day, month, and year are known.  A
CALENDER-YEAR is a timepoint at the resolution of years.  The publication
date of DOCUMENTs is some kind of timepoint; for many publications only
the year is known.  Events such as CONFERENCEs also occur on dates specified
with timepoints.

All documents have titles.  TITLEs are names (strings of characters), as are
AGENT-NAMEs, CITY-ADDRESSes, and other data types that are used as
identifiers and are not further destructured.  The class called BIBLIO-NAME
is a place holder for these atomic identifiers.  The class BIBLIO-NL-TEXT is
for strings of characters meant for human reading, rather than as an

The most interesting ontological commitment is the distinction between the
data fields in a REFERENCE and the facts about DOCUMENTs.  Facts are stated
as relationships over and properties of explicitly-represented objects.  For
example, some facts are about publishers: the publisher name, the city with
which the publisher is associated, and the year of (latest) publication.  In
a document, the DOC.PUBLISHER is an ORGANIZATION.  In a REFERENCE, the
REF.PUBLISHER is the PUBLISHER.NAME of the publisher, and the REF.ADDRESS is
the PUBLISHER.ADDRESS of the document's publisher.  The REF.YEAR of the
reference is a number, which is the TIMEPOINT.YEAR of the
DOC.PUBLICATION-DATE (a timepoint) of the document associated with a
reference.  Thus, in a reference -- the entity we are trying to share -- many
of the facts have been mapped onto these atomic data types such as name
strings, title strings, and numbers.  In a document, some of the meaning of
these data types can be stated as logical constraints.  This is in the spirit
of the Cyc project, which aims to provide the background knowledge behind the
narrow, brittle representations of expert systems and conventional databases.

This distinction between data in references and facts in other parts of the
ontology is there to support the interoperability of tools that commit to
this ontology, and the integration of this ontology and associated databases
with other ontologies and databases.  Part of the incompatibility between
bibliography databases and tools is due to different _encodings_ and
_presentations_ of the same information.  For example, one database might
encode a date as a string, another as a structured record of integer fields.
Their ontological commitments might be the same -- they might both support
years and months for a magazine article reference -- but their encodings mask
their conceptual agreement.  Similarly, different bibliography formatting
styles might disagree on whether a publisher city is required for a given
reference type, but they both agree that the city is a function of the
publisher (not a name for it found in some reference field).  Explicitly
representing agents (authors), organizations (publishers), events
(conferences), and time (publication dates) as objects in the
conceptualization allows one to write knowledge-full constraints about how
the data fields are related.  Capturing these constraints is part of good
database design, because it reduces redundancy and anticipates integration
with other databases.  For example, associating author and publisher _names_
(which are all that appear in references) with independently defined agents
ensures that these agents will be named consistently in the references and
facilitates the importation of data on authors and publishers from other

This ontology is a set of definitions of classes, relations, and functions.
It is represented in Ontolingua forms, which use KIF as the formal language
and English documentation strings to describe meanings that we haven't
formalized.  We are using a slightly new-and-improved syntax for Ontolingua,
in which the result variable of a function resides next to the argument list
and some new second-order relations are introduced (HAVE-SAME-VALUES,

The definitions are organized in a mildly bottom-up order, as follows:

 1. Introduction
 2. Generic Data Classes: biblio-name, biblio-NL-text, title, keyword
 3. Agents and Events: persons, organizations, publishers, conferences
 4. Dates and units of time
 5. Documents
   5.1 The document class and slots on it
   5.2 Document types (subclasses): books, periodicals, theses, reports, etc.
 6. References
   6.1 The reference class and slots on it
   6.2 Reference types (subclasses): book-ref, article-ref, thesis-ref, etc.
   6.3 Constraints used frequently to define reference types.
 7. Acknowledgments

;;; ----------------------------------------------------------------------
;;; 1. Introduction

;;; First we need to establish the package in which this is to be read.
;;; Ontolingua-user is a good package to write ontologies.  It inherits the
;;; exported symbols from the KIF and Ontolingua packages, which gives the
;;; user use of all the symbols defined in the KIF ontology (e.g., AND, OR,
;;; SETOF, =>) and Frame-ontology (e.g., VALUE-TYPE, HAS-ONE, SUBCLASS-PARTITION).

(in-package "ONTOLINGUA-USER")

;;; All ontologies need to be in one or more theories.  Here we define a
;;; theory that includes just the frame ontology.
;;; DEFINE-THEORY is analogous to DEFPACKAGE.

(define-theory GENERIC-BIBLIOGRAPHY (frame-ontology)
   "The generic-bibliography ontology defines the terms used
for describing bibliographic references.  This theory defines
the basic class for reference objects and the types (classes) for
the data objects that appear in references, such as authors and titles.
Specific databases will use schemata that associate references with
various combinations of data objects, usually as fields in a record.
This ontology is intended to provide the basic types from which
a specific database schema might be defined.")

;;; DEFINE-THEORY only defines the theory, it doesn't make it the ``current
;;; theory''.  The following form does just that.  IN-THEORY is analogous to
;;; IN-PACKAGE.  The rest of the ontolingua forms in this file are
;;; interpreted with respect to the GENERIC-BIBLIOGRAPHY theory.


;;; ----------------------------------------------------------------------
;;; 2. Generic Data Classes: biblio-name, biblio-NL-text, title, keyword

;;; Ontologies will commonly have a top-level class such as the following.
;;; They are more for organization rather than meaning, but are useful for
;;; assimilating a small ontology into a more comprehensive ontology.

(define-class BIBLIO-THING (?x)
  "Biblio-thing is the root of the bibliographic ontology."

  :def (individual ?x)  ; from KIF ontology - means "not a set"

  :axiom-def (subclass-partition
               (setof biblio-text

(define-class BIBLIO-TEXT (?string)
  "The most general class of undifferentiated text objects."

  :def (and (biblio-thing ?string)
            (string ?string))

  :issues (("Why not make biblio-name and biblio-nl-text be disjoint
             subclasses of biblio-text?"
            "There may be valid names that are exactly the same strings
             as NL texts, so it would be overconstraining to require
             these two classes to be disjoint.  The distinction between
             names and NL texts is in their intended use, rather than
             their forms. This happens because we don't represent what
             the strings denote.  If we did, then we could offer a
             formal basis for distinguishing between these two classes
             of text strings.")))

(define-class BIBLIO-NAME (?string)
  "A name of something in the bibliography ontology.
Names are distinguished from strings in general because
they may be treated specially in some databases; for example,
there may be uniqueness assumptions."

  :def (biblio-text ?string))

(define-class BIBLIO-NL-TEXT (?string)
  "A string of natural language text mentioned in some bibliographic
reference.  Texts are distinguished from strings in general because
they may be treated specially in some databases, or presented as
free-flowing text to a human reader.  Biblio-texts are used for
different purposes than biblio-names.  Biblio texts are for things like
notes and abstracts; biblio-names are meant to identify some object or
some property."

  :def (biblio-text ?string))

(define-class TITLE (?x)
  "A title is a string naming a publication, a document, or 
something analogous.  Title strings are distinct from strings naming
agents (books can't talk)."

  :def (biblio-name ?x))

(define-class KEYWORD (?keyword)
  "A keyword is a name used as an index."
  :def (biblio-name ?keyword))

(define-class CITY-ADDRESS (?name)
  "A city-address is a string that identifies a city
somewhere in the world.  We distinguish it from other
names to facilitate integrating it with ontologies that
include representations for locations and alternative ways
of identifying places."

  :def (biblio-name ?name))

;;; ----------------------------------------------------------------------
;;; 3. Agents and Events: persons, organizations, publishers, conferences
;;;    People, organizations, and events involved in creating and
;;;    publishing documents

(define-class AGENT (?x)
  "An agent is something or someone that can act on its
own and produce changes in the world.  There is more to
agenthood than that, but for this ontology that is all
that matters."

  :def (and (biblio-thing ?x)
            (has-one ?x

  :axiom-def (subclass-partition
               (setof person

  :issues ("could be merged with more meaningful definitions
            of agenthood in larger ontologies."))

(define-function AGENT.NAME (?agent) :-> ?name
  "Function from an agent to the name by which it goes.
One name per agent."

  :def (and (agent ?agent)
            (biblio-name ?name)))

(define-class AGENT-NAME (?name)
  "A string that is the name of some agent."

  :axiom-def (exact-range AGENT.NAME AGENT-NAME))

(define-class PERSON (?x)
  "Human person"

  :def (agent ?x))

(define-function PERSON.NAME (?person) :-> ?name
  "The name that people use as authors of publications.  One name per

  :def (and (person ?person)
            (biblio-name ?name)))

(define-class AUTHOR (?x)
  "An author is a person who writes things.  An author must have a name."

  :def (and (person ?x)
            (has-one-of-type ?x biblio-name)
            (have-same-values ?x

(define-class ORGANIZATION (?x)
  "An organization is a corporate or similar institution, distinguished 
>From persons and other agents."

  :def (and (biblio-thing ?x)
            (agent ?x)))

(define-function ORGANIZATION.NAME (?organization) :-> ?name
  "The name by which organizations go by.  One name per place."

  :def (and (organization ?organization)
            (biblio-name ?name)))

(define-class PUBLISHER (?x)
  "A publisher is an organization that publishes."

  :def (and (organization ?x)
            (has-one-of-type ?x PUBLISHER.NAME biblio-name)))

(define-function PUBLISHER.NAME (?publisher) :-> ?name
  "The name of a publisher; one per publisher."

  :def (and (publisher ?publisher)
            (biblio-name ?name)))

(define-class PUBLISHER-NAME (?name)
  "A name of some publisher"
  :axiom-def (exact-range PUBLISHER-NAME))

(define-relation PUBLISHER.ADDRESS (?publisher ?city)
  "The publisher.address is the name of a city with which a publisher
is associated for document ordering purposes.  There may be several
cities associated with a publisher.  If the city is well-known,
then just its name is given; otherwise its name and state and sometimes 
country are given as the location."

  :def (and (publisher ?publisher)
            (city-address ?city)))

(define-class UNIVERSITY (?x)
  "A university is an institute of higher learning that offers a
graduate research program.  Of importance here is the fact that
universities sponsor the publication of dissertations."

  :def (organization ?x))

(define-class CONFERENCE (?x)
  "A conference is a big meeting where people wear badges, sit through
boring talks, and drink coffee in the halls."

  :def (and (biblio-thing ?x)   ;should be an event of some kind
            (has-one-of-type ?x biblio-name)
            (has-one-of-type ?x conf.organization organization)
            (has-one-of-type ?x calendar-date)
            (value-type ?x conf.address city-address)
            (can-have-one ?x conf.address)))

;;; ----------------------------------------------------------------------
;;; 4. Dates and units of time
;;;    An incomplete ontology of time.  Should be merged with a more 
;;;    general-purpose version, such as those used for scheduling.

(define-class TIMEPOINT (?t)
  "A timepoint is a specification of an absolute point in real, historical

  :def (biblio-thing ?t))

(define-class CALENDER-YEAR (?t)
  "a specification of a point in absolute calendar time, at the 
resolution of one year."

  :def (and (timepoint ?t)
            (has-one ?t timepoint.year)))

(define-class CALENDER-DATE (?t)
  "a specification of a point in absolute calendar time, at the 
resolution of one day."

  :def (and (timepoint ?t)
            (has-one ?t
            (has-one ?t timepoint.month)
            (has-one ?t timepoint.year)))

(define-class UNIVERSAL-TIME-SPEC (?t)
   "a specification of a point in real-world, historical, wall-clock time,
independent of timezone and with one second resolution."
  :def (and (timepoint ?t)
             (has-one ?t timepoint.seconds)
             (has-one ?t timepoint.minutes)
             (has-one ?t
             (has-one ?t timepoint.month)
             (has-one ?t timepoint.year)))

(define-function TIMEPOINT.YEAR (?timepoint ?year) :-> ?year
  "function from time points to integers representing the year
component of the time specification.  The integer represents
the number of years A.D., e.g., 1992."

  :def (and (timepoint ?timepoint)
            (year-number ?year)))

(define-class YEAR-NUMBER (?year)
  "A year expressed as the number of years A.D."

  :def (integer ?year))

(define-function TIMEPOINT.MONTH (?timepoint) :-> ?month
  "function from time points to months, representing the month component of
the time specification.  Months are not integers, but named objects."

  :def (and (timepoint ?timepoint)
            (month-name ?month)))

(define-class MONTH-NAME (?month)
  "The months of the year, specified as an extensionally-defined
 (i.e., enumerated) set of objects, in English.
  Instances of this class of months are not _symbols_, they are months
that may be denoted by object constants."

  :iff-def (member ?month
                   (setof january february march april may june july
                          august september october november december))

  :issue (("Why not specify them as an ordered sequence?"
           "The class only defines the set of months.  Their order would
            be given by an ordering predicate: a binary relation.")))

(define-function TIMEPOINT.DAY (?timepoint) :-> ?day-of-month
  "function from time points to integers representing the day
component of the time specification."

  :def (and (timepoint ?timepoint)
            (integer ?day-of-month)
            (=< 0 ?day-of-month)
            (=< ?day-of-month 31)))

(define-function TIMEPOINT.MINUTES (?timepoint) :-> ?minutes
  "function from time points to integers representing the minutes
component of the time specification."

  :def (and (timepoint ?timepoint)
            (integer ?minutes)
            (=< 0 ?minutes)
            (< ?minutes 60)))

(define-function TIMEPOINT.SECONDS (?timepoint) :-> ?seconds
  "function from time points to integers representing the seconds component of
the time specification.  This is not the internal representation of the
universal time, (e.g., number seconds since some historical date).
Timepoint.seconds is the number of seconds past the minute, hour, day, etc.
specified in the other components of the timepoint."

  :def (and (timepoint ?timepoint)
            (integer ?seconds)
            (=< 0 ?seconds)
            (< ?seconds 60)))

;;; ----------------------------------------------------------------------
;;; 5. Documents
;;;   5.1 The document class and slots on it.

(define-class DOCUMENT (?x)
  "A document is something created by author(s) that may be viewed,
listened to, etc., by some audience.  A document persists in material
form (e.g., a concert or dramatic performance is not a document).
Documents typically reside in libraries."

  :def (and (biblio-thing ?x)
            (has-one ?x doc.title))

  :axiom-def (subclass-partition
               (setof book

(define-function DOC.TITLE (?doc) :-> ?title
  "The title of a document.  Not necessarily the title of a work
published in the document."

  :def (and (document ?doc)
            (title ?title)))

(define-relation DOC.AUTHOR (?doc ?agent) ?name
  "The creator(s) of a document.  Not necessarily the author of a
work published in the document, but often so.  The author is a real
agent, not a name of an agent."

  :def (and (document ?doc)
            (agent ?agent)))

(define-function DOC.PUBLICATION-DATE (?doc) :-> ?year
  "The publication date of a document.  If the document isn't
formally published, e.g., a painting, then it is the year of creation.
The date is a timepoint for which at least the year is known.
In some cases, the month and day are also known."

  :def (and (document ?doc)
            (calendar-year ?year))

  :issues ("Calendar-date is a subclass-of calendar-year, because it
            requires the same constraint (that a year be known) plus
            a few more (that a month and day be known).  This means
            that if we require publication dates to be calendar-years,
            then we also allow more precise timepoint specifications
            as well.  Thus, documents for which a month field is needed
            can get the month from the publication date."))

(define-function DOC.PUBLISHER (?doc) :-> ?publisher
  "The publisher of a document, if there is one.  This is the 
publisher, not its name."

  :def (and (document ?doc)
            (publisher ?publisher)))

(define-relation DOC.EDITOR (?doc ?editor)
  "Named primary editors of a document."

  :def (and
         (or (book ?doc)
             (proceedings ?doc))
         (person ?editor)))

(define-relation DOC.SERIES-EDITOR (?doc ?editor)
  "Series editors of a document."

  :def (and
         (or (book ?doc)
             (proceedings ?doc))
         (person ?editor)))

(define-function DOC.SERIES-TITLE (?doc) :-> ?title
  "Series title of a document."

  :def (and
         (or (book ?doc)
             (proceedings ?doc))
         (title ?title)))

(define-relation DOC.TRANSLATOR (?doc ?translator)
  "Named primary editors of a document."

  :def (and
         (or (book ?doc)
             (proceedings ?doc))
         (person ?translator)))

(define-function DOC.EDITION (?doc) :-> ?nth
 "Refers to the nth edition of a document."

  :def (and
         (or (book ?doc)
             (proceedings ?doc)
             (cartographic-map ?doc))
         (natural-number ?nth)))

(define-function DOC.NUMBER-OF-PAGES (?doc) :-> ?n
 "Number of pages contained a document.  Not the page numbers of an article"

  :def (and (document ?doc)
            (natural-number ?n)))

;;; ----------------------------------------------------------------------
;;;   5.2 Document types (subclasses): books, periodicals, theses,
;;;       proceedings, reports, maps, manuals, etc.

(define-class BOOK (?x)
  "pages in a bound cover. You can't judge it by its cover."
  :def (and (document ?x)
            (has-some ?x
            (has-one ?x doc.title)
            (has-one ?x doc.publication-date)
            (has-one ?x doc.publisher)

(define-class EDITED-BOOK (?x)
  "An edited book is a book whose authors are known as editors."
  :iff-def (and (book ?x)
                (has-some ?x doc.editor)
                (have-same-values ?x doc.editor

  "A periodical-publication is published regularly, such as once
every week.  Strictly speaking, the noun ``periodical'' is used
by librarians to refer to things published at intervals of greater
than a day.  We use the phase periodical-publication to include
newspapers and other daily publications, since they share many
bibliographic features."

  :def (document ?x)
  :axiom-def (subclass-partition
               (setof journal

(define-class JOURNAL (?x)
  "A journal is an archival periodical publication.  Note that a
journal is not the same as a journal article or a reference to an
article.  A journal is a document; a particular issue of a journal may
contain several articles."

  :def (periodical-publication ?x))

(define-class MAGAZINE (?x)
  "A magazine is a periodical publication that is considered to be of
more general interest than a journal."

  :def (periodical-publication ?x))

(define-class NEWSPAPER (?x)
  "A newspaper is a periodical publication that may be published as
frequently as once a day."

  :def (periodical-publication ?x))

(define-class PROCEEDINGS (?x)
  "The published proceedings of a conference, workshop, or similar
meeting.  If the proceedings appear as an edited book, the document
is an edited book with a title other than ``proceedings of...''
Proceedings may have editors, however."

  :def (and (document ?x)
            (has-one-of-type ?x doc.conference conference)
            (have-same-values ?x doc.title
                              (compose* doc.conference))
            (have-same-values ?x doc.publication-date
                              (compose* doc.conference)))

  :issues ("We are assuming that the title of the proceedings is
            the same as the name of the conferences.  This may be

(define-class THESIS (?x)
  "An official report on a bout of graduate work for which one receives a
degree, published by the university.  Never mind that some fields make a big
deal about the difference between dissertations and theses.  From the
bibliographic perspective, they are both of the same family."

  :def (and (document ?x)
            (has-one ?x
            (has-one ?x doc.title)
            (has-one ?x doc.publication-date)
            (has-one-of-type ?x university))

  :axiom-def (exhaustive-subclass-partition
               (setof masters-thesis

  :issues (("What about theses published as technical reports?"
            "If it is cited as a TR, it is a TR."
            "One can imagine adding a cross-reference field to
             references that points to associated documents or
             other references.")))

(define-class MASTERS-THESIS (?x)
  "M.S. thesis document."

  :def (thesis ?x))

(define-class DOCTORAL-THESIS (?x)
  "Ph.D. thesis document"

  :def (thesis ?x))

(define-class TECHNICAL-REPORT (?x)
  "A technical report is a paper published by some research

  :def (and (document ?x)
            (has-some ?x
            (has-one ?x doc.title)
            (has-one ?x doc.publication-date)
            (has-one-of-type ?x doc.institution organization)))

  "A miscellaneous category of documents that are infrequently found
in bibliographic references."

  :def (and (document ?x)
            (has-one ?ref doc.title))

  :axiom-def (subclass-partition
               (setof manual

(define-class TECHNICAL-MANUAL (?x)
  "The is the technical writer."

  :def (miscellaneous-publication ?x))

(define-class COMPUTER-PROGRAM (?x)
  "The is the programmer."

  :def (miscellaneous-publication ?x))

(define-class ARTWORK (?x)
  "The is the artist."

  :def (and (has-one ?ref
            (miscellaneous-publication ?x)))

(define-class CARTOGRAPHIC-MAP (?x)
  "The is the cartographer."

  :def (miscellaneous-publication ?x))

(define-class MULTIMEDIA-DOCUMENT (?x)
  "A multimedia document is some identifiable communique in a
modality such as audio, video, animation, etc.
The document may exist in digital form in a library that is accessed
by electronic means."

  :def (miscellaneous-publication ?x))

;;; ----------------------------------------------------------------------
;;;  6. References
;;;    6.1 The reference class and slots on it

(define-class REFERENCE (?ref)
  "A bibliographic reference is a description of some publication that
uniquely identifies it, providing the information needed to retrieve the
associated document.  A reference is distinguished from a citation, which occurs
in the body of a document and points to a reference.  Note that references
are distinguished from documents as well.
    The information associated with a reference is contained in data fields,
which are binary relations (often unary functions).
   A reference should at least contain information about the author, title,
and year.  (Since there are exceptions, that constraint is associated with a
specialization of this class.) ."

  :def (biblio-thing ?ref)
  :axiom-def (exhaustive-subclass-partition
               (setof publication-reference

;;; Fields of references are represented as binary relations (slots).
;;; If they are single-valued, they are defined as unary functions.
;;; (Recall that in KIF, unary functions are a subclass of binary relations.)

(define-function REF.DOCUMENT (?ref) :-> ?document
  "Function from references to associated documents. 
Is only defined on publication-references, since by definition they are the
references associated with documents."

  :def (and (publication-reference ?ref)
            (document ?document)))

(define-relation REF.AUTHOR (?ref ?author-name)
  "Relation between a reference and the name(s) of the
creator(s) of the publication."

  :def (and (reference ?ref)
            (agent-name ?author-name)))

(define-function REF.TITLE (?ref) :-> ?title
  "Most general relation between a reference and the PRIMARY title 
of a publication.  The primary title goes by various names depending 
on the reference type."

  :def (and (reference ?ref)
            (title ?title)))

(define-function REF.YEAR (?ref) :-> ?year
  "The year field is a function from a reference to the year 
in which the publication was published."

  :def (and (reference ?ref)
            (year-number ?year)))

(define-function REF.PERIODICAL (?ref) :-> ?journal-title
  "Most general relation between a reference and a journal."

  :def (and (reference ?ref)
            (title ?journal-title)))

(define-function REF.VOLUME (?ref) :-> ?number
  "in a reference, the volume number of a journal or magazine
in which an article occurs."

  :def (and
         ;; domain is a subclass of all references
           (book-reference ?ref)
           (book-section-reference ?ref)
           (article-reference ?ref))

         ;; range is natural numbers
         (natural-number ?number)))

(define-function REF.ISSUE (?ref) :-> ?issue-number
  "In a reference, the issue number of a journal or magazine
in which an article occurs."

  :def (and (article-reference ?ref)
            (natural-number ?issue-number)))

(define-function REF.REPORT-NUMBER (?ref) :-> ?identifier
  "An alphanumeric identifier that identifies a technical report within a
series sponsored by the publishing institution.  For example, STAN-CS-68-118
is the 118th report number of a report written at Stanford in the computer
science department in 1968."

  :def (and (technical-report-reference ?ref)
            (biblio-name ?identifier)))

(define-function REF.PAGES (?ref) :-> ?page-range
  "In a reference, the pages of an article or analogous subdocument in which a
publication resides.  Specified as a sequence of two integers."

  :def (and
         ;; domain is the union of these ref types:
         (or (book-section-reference ?ref)
             (article-reference ?ref)
             (proceedings-paper-reference ?ref))

         ;; range is a list of (starting ending) pages
         (list ?page-range)
         (integer (first ?page-range))
         (integer (second ?page-range))))

(define-function REF.MONTH (?ref) :-> ?month
  "In a reference, the month in which a publication is published.
Useful for magazines, conference proceedings, and technical reports."

  :def (and (or (article-reference ?ref)
                (technical-report ?ref))
            (month-name ?month)))

(define-function REF.DAY (?ref) :-> ?month
  "In a reference, the day of the month in which a publication is published.
Useful for conference proceedings, personal communications."

  :def (and (or (article-reference ?ref)
                (personal-communication-reference ?ref))
            (day ?month)))

(define-relation REF.NOTES (?ref ?note-string)
  "In a reference, the notes field contains a set of strings that is used 
to describe all sorts of things."

  :def (and (reference ?ref)
            (biblio-NL-text ?note-string)))

(define-function REF.ABSTRACT (?ref) :-> ?abstract-string
  "In a reference, the abstract field contains a string of natural
language text that is used to describe all sorts of things."

  :def (and (reference ?ref)
            (biblio-NL-text ?abstract-string)))

(define-relation REF.KEYWORDS (?ref ?keyword)
  "Keywords associated with a reference."
  :def (and (reference ?ref)
            (keyword ?keyword)))

(define-relation REF.LABELS (?ref ?label)
  "Labels associated with a reference."
  :def (and (reference ?ref)
            (biblio-name ?label)))

(define-relation REF.EDITOR (?ref ?editor)
  "A reference's editor is the name of the document's editor."

  :axiom-def (= REF.EDITOR
             (compose* doc.editor ref.document)))

(define-relation REF.SERIES-EDITOR (?ref ?editor)
  "A reference's series editor is the name of a series editor of 
the document."

  :axiom-def (= REF.SERIES-EDITOR 
             (compose* doc.series-editor ref.document)))

(define-relation REF.TRANSLATOR (?ref ?translator)
  "A reference's translator is the name of the document's translator."

  :axiom-def (= REF.TRANSLATOR
             (compose* doc.translator ref.document)))

(define-relation REF.SECONDARY-AUTHOR (?ref ?editor)
  "In a reference, the secondary author field usually names an editor
of some sort who was involved in the production of the work but who
was not a original author."

  :def (and (reference ?ref)
            (agent-name ?author-name)))

(define-relation REF.SECONDARY-TITLE (?ref ?title)
  "In a reference, the secondary title usually names the book or 
serial in which the publication is published."

  :def (and (reference ?ref)
            (title ?title)))

(define-relation REF.ADDRESS (?ref ?address)
  "The place (e.g., city) where a document is published.  Means
different things depending on the reference type."

  :def (and (reference ?ref)
            (city-address ?address)))

(define-function REF.PUBLISHER-NAME (?ref) :-> ?publisher-name
  "The publisher field of a reference points to the publisher of 
the associated document."

  :def (and (reference ?ref)
            (publisher-name ?publisher-name)))

(define-function REF.NUMBER-OF-VOLUMES (?ref) :-> ?number
  "In a reference, the number of volumes in the associated document."

  :def (and (reference ?ref)
            (natural-number ?number)))

(define-function REF.EDITION (?ref) :-> ?nth
  "Refers to the nth edition of a document."

  :def (and (reference ?ref)
            (natural-number ?nth))

  ;; ref's edition is the document's edition
  :lambda-body (doc.edition (ref.document ?ref)))

(define-function REF.TYPE-OF-WORK (?ref) :-> ?name
  "An identifier of some specialization within the reference type.
For example, technical reports are labeled with types-of-work such as
``technical report'' and ``memo''.  Dissertations are specialized by the
level of the associated degree."

  :def (and (or (thesis-reference ?ref)
                (technical-report-reference ?ref)
                (miscellaneous-reference ?ref))
            (biblio-name ?name)))

;;; ----------------------------------------------------------------------
;;;  Reference types

(define-class PUBLICATION-REFERENCE (?ref)
  "A reference associated with some kind of published document, where
publication and documenthood are interpreted broadly."

  :def (and (has-one-of-type ?ref ref.document document)
            (has-one ?ref ref.title))
  :axiom-def (subclass-partition
               (setof book-reference

(define-class NON-PUBLICATION-REFERENCE (?ref)
  "A reference to something that just isn't a document."

  :def (and (publication-reference ?ref)
            (cannot-have ?ref ref.document))
  :axiom-def (subclass-partition
               (setof personal-communication-reference

(define-class BOOK-REFERENCE (?ref)
  "A book reference.   Book references usually include complete publisher
information, and may have a series editor and title, edition, and translator.
A reference to a book gets many of its publication data from the book qua

  :def (and (publication-reference ?ref)
            (has-one-of-type ?ref ref.document book)
            (inherits-author-from-document ?ref)
            (inherits-title-from-document ?ref)
            (book-publication-data-constraint ?ref) ;see-below
            (have-same-values ?ref ref.secondary-author ref.series-editor)
            (have-same-values ?ref ref.secondary-title doc.series-title)))

(define-class EDITED-BOOK-REFERENCE (?ref)
  "like a book-reference, except the document is an edited-book and
the author and editor are the same."

  :iff-def (and (book-reference ?ref)
                (has-one-of-type ?ref ref.document edited-book)
                (has-some ?ref ref.editor)
                (have-same-values ?ref ref.editor)))

(define-class BOOK-SECTION-REFERENCE (?ref)
  "A section of a book, like a chapter or a paper in an edited collection."

  :def (and (publication-reference ?ref)
            (has-one-of-type ?ref ref.document edited-book)
            (has-some ?ref
            (has-some ?ref ref.editor)
            (has-one ?ref ref.booktitle)
            (have-same-values ?ref ref.booktitle
                              (compose* doc.title ref.document))
            (book-publication-data-constraint ?ref)
            (have-same-values ?ref ref.secondary-author ref.editor)
            (have-same-values ?ref ref.tertiary-author ref.series-editor)))

(define-class ARTICLE-REFERENCE (?ref)
  "An article is a piece published in a journal, magazine, or newspaper."

  :def (and (publication-reference ?ref)
            (value-type ref.document periodical-publication)
            (has-some ?ref
            (has-one ?ref ref.title)
            (has-one ?ref ref.year)
            (has-one ?ref ref.periodical)
            (have-same-values ?ref ref.periodical
                              (compose* doc.title ref.document))
            (have-same-values ?ref ref.secondary-title

(define-class JOURNAL-ARTICLE-REFERENCE (?ref)
  "A reference to article in a journal must give information sufficient to
find the issue containing the article."

  :def (and (article-reference ?ref)
            (value-type ref.document journal)
            (cannot-have ?ref ref.month)  ; unlike other articles

  "A reference to an article in a magazine is essentially the same as a
journal article reference.  Some formatting styles need the distinction.
Magazine article references sometimes include the month instead of the
volume/issue numbers."

  :def (and (article-reference ?ref)
            (value-type ref.document magazine)
            (has-one ?ref ref.magazine-name)
            (have-same-values ?ref ref.magazine-name

  "A newspaper article reference is like a magazine article reference"

  :def (and (article-reference ?ref)
            (value-type ref.document newspaper)
            (has-one ?ref ref.newspaper-name)
            (have-same-values ?ref ref.magazine-name ref.periodical)
            (has-one ?ref ref.month)
            (has-one ?ref
            (value-type ?ref ref.address city-address)))

  "An article appearing in the published proceedings of some conference or

  :def (and (publication-reference ?ref)
            (value-type ref.document proceedings)
            (has-some ?ref
            (has-one ?ref ref.title)
            (inherits-year-from-document ?ref)
            (has-one ?ref ref.booktitle)
            (have-same-values ?ref ref.booktitle
                              (compose* doc.title ref.document))
            (have-same-values ?ref ref.secondary-title ref.booktitle)
            (have-same-values ?ref ref.secondary-author ref.editor)
            (have-same-values ?ref ref.organization
                              (compose* conf.organization
                                        doc.conference ref.document))
            (have-same-values ?ref ref.address
                              (compose* conf.address
                                        doc.conference ref.document))
            (have-same-values ?ref ref.month
                              (compose* timepoint.month
                                        doc.publication-date ref.document))
            (have-same-values ?ref
                                        doc.publication-date ref.document))))

(define-class THESIS-REFERENCE (?ref)
  "A reference to a master's or doctoral thesis."

  :def (and (publication-reference ?Ref)
            (value-type ref.document thesis)
            (inherits-author-from-document ?ref)
            (inherits-title-from-document ?ref)
            (inherits-year-from-document ?ref)
            (has-one ?ref ref.publisher)
            (has-same-values ?ref ref.publisher
  :axiom-def (subclass-partition
               (setof doctoral-thesis-reference

(define-class DOCTORAL-THESIS-REFERENCE (?ref)

  :def (and (thesis-reference ?ref)
            (value-type ref.document doctoral-thesis)
            (has-value ?ref ref.type-of-work doctoral-thesis)))

(define-class MASTERS-THESIS-REFERENCE (?ref)

  :def (and (masters-thesis ?ref)
            (value-type ref.document masters-thesis)
            (has-value ?ref ref.type-of-work masters-thesis)))


  :def (and (publication-reference ?ref)
            (inherits-author-from-document ?ref)
            (inherits-title-from-document ?ref)
            (inherits-year-from-document ?ref)
            (has-one ?ref ref.publisher)
            (has-same-values ?ref ref.publisher
                             (compose* doc.institution))))


  :def (publication-reference ?ref)
  :axiom-def (subclass-partition
               (setof technical-manual-reference

  "A reference to a manual that may accompany a product but is otherwise

  :def (and (misc-publication-reference ?ref)
            (inherits-author-from-document ?ref)
            (inherits-title-from-document ?ref)
            (inherits-year-from-document ?ref)))

  "A reference to a computer program.  The ref.title is the name of the
program.  The author is the programmer."

  :def (and (misc-publication-reference ?ref)
            (inherits-author-from-document ?ref)
            (inherits-title-from-document ?ref)))

  "A reference to a map created by a cartographer."

  :def (and (misc-publication-reference ?ref)
            (inherits-author-from-document ?ref)
            (inherits-title-from-document ?ref)
            (inherits-year-from-document ?ref)))

(define-class ARTWORK-REFERENCE (?ref)
  "A reference to a work of art that does not fit the other categories of
documents.  The author is the artist."

  :def (and (misc-publication-reference ?ref)
            (inherits-author-from-document ?ref)
            (inherits-title-from-document ?ref)
            (inherits-year-from-document ?ref)))

  "A bibliographic reference to a multimedia document.
Who knows what conventions the future holds for these things."

  :def (and (misc-publication-reference ?ref)
            (inherits-author-from-document ?ref)
            (inherits-title-from-document ?ref)
            (inherits-year-from-document ?ref)))

  "A reference to a personal communication between the author of the paper in
which the bibliography appears and some other person.  The of the
reference is the person with whom the conversation was held."

  :def (and (non-publication-reference ?ref)
            (has-one ?ref
            (has-one ?ref ref.year)
            (has-one ?ref ref.month)
            (has-one ?ref

;;; ----------------------------------------------------------------------
;;;  6.3 Constraints used frequently to define reference types.

;;; Technically, the following are classes.  In intent, they are constraints
;;; over slot values of classes (thus, they are specializations of classes). 
;;; We use define-relation instead of define-class for such constraints, but 
;;; there is no logical distinction between the unary-relation qua class and
;;; qua constraint over class membership.

(define-relation INHERITS-AUTHOR-FROM-DOCUMENT (?ref)
  "When a reference is a one-to-one account of a document, then the author
in the reference ( is the name of the author of the document.
This relation captures this relationship."

  :iff-def (and (publication-reference ?ref)
                (have-same-values ?ref

  "When a reference is a one-to-one account of a document, then the publisher
in the reference (ref.publisher) is the name of the publisher of the
document. This relation captures this relationship.  Inherits the 
publisher's address as well."

  :iff-def (and (publication-reference ?ref)
                (have-same-values ?ref ref.publisher-name
                               (compose* doc.publisher
                (have-same-values ?ref ref.address
                               (compose* publisher.address
                                         doc.publisher ref.document))))

(define-relation INHERITS-YEAR-FROM-DOCUMENT (?ref)
  "When a reference is a one-to-one account of a document, then the year
in the reference (ref.year) is the year of publication of the document.
This relation captures this relationship."

  :iff-def (and (publication-reference ?ref)
                (have-same-values ?ref ref.year
                                  (compose* timepoint.year

(define-relation INHERITS-TITLE-FROM-DOCUMENT (?ref)

  :iff-def (and (publication-reference ?ref)
                (have-same-values ?ref ref.title
                                  (compose* doc.title ref.document))))

  "In references associated with books, the reference fields
for publication data such as publisher, place, and edition
are all taken from the data on the book-document itself.
This unary relation captures these constraints in one place, 
so that each of the book reference types can just inherit them."

  :iff-def (and
             ;; the constraint applies to references
             (publication-reference ?ref)

             ;; whose associated document is a book of some sort
             (has-one-of-type ?ref ref.document book)

             ;; must list a publisher.
             (has-one ?ref ref.publisher)

             ;; ref's publisher is the book publisher's name
             ;; and the address is the publisher's address
             (inherits-publisher-from-document ?ref)

             ;; books must have a year, and the are the year of publication
             ;; of the book document.
             (has-one ?ref ref.year)
             (inherits-year-from-document ?ref)))



Many thanks to Richard Fikes, who helped with the formalization and style
decisions, and Fritz Mueller, who implemented Ontolingua code to support
these definitions.  This work is supported by DARPA.


(define-instance LaTeX (book-reference)
  "The LaTeX book."
  :def (and ( LaTeX leslie-lamport)
            (ref.title LaTeX "LaTeX: A Document Preparation System")
            (ref.year LaTeX 1986)
            (ref.publisher addison-wesley)
            (ref.address "Menlo Park, CA")))

(define-instance EndNote (manual-reference)
  :def (and ( "Niles and Associates, Inc.")
            (ref.publisher "Niles and Associates, Inc.")
            (ref.title "EndNote Plus: Enhanced Reference Database and
Bibliography Maker")
            (ref.year 1990)
            (ref.address "2000 Hearst St., Berkeley, CA 94709")))

(define-instance ADDISON-WESLEY (publisher)
  "The Addison-Wesley Publishing Company"
  :def (and ( ADDISON-WESLEY
                            "Addison-Wesley Publishing Company")
            (publisher.address ADDISON-WESLEY
                                "Menlo Park, CA")))

(define-instance NILES&ASSOCIATES (organization)
  "The company that distributes the EndNote program"
  :def ( NILES&ASSOCIATES "Niles and Associates, Inc."))