Bibliography.kif ;;; Translation of file /tmp_mnt/vol/q/htw/ontolingua/examples/biblio/bibliography.lisp
;;; into target language :KIF

(defrelation biblio-thing
(subclass-partition biblio-thing
(setof biblio-text agent timepoint document reference))
(subclass-of biblio-thing individual) (class biblio-thing))

(documentation biblio-thing
"Biblio-thing is the root of the bibliographic ontology.")

(defrelation biblio-text (subclass-of biblio-text biblio-thing)
(subclass-of biblio-text string) (class biblio-text))

(documentation biblio-text
"The most general class of undifferentiated text objects.")

(defrelation biblio-name (subclass-of biblio-name biblio-text)
(class biblio-name))

(documentation biblio-name
"A name of something in the bibliographic-data ontology.
Names are distinguished from strings in general because
they may be treated specially in some databases; for example,
there may be uniqueness assumptions.")

(defrelation biblio-nl-text (subclass-of biblio-nl-text biblio-text)
(class biblio-nl-text))

(documentation biblio-nl-text
"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.")

(defrelation title (subclass-of title biblio-name) (class title))

(documentation title
"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).")

(defrelation keyword (subclass-of keyword biblio-name) (class keyword))

(documentation keyword "A keyword is a name used as an index.")

(defrelation city-address (subclass-of city-address biblio-name)
(class city-address))

(documentation city-address
"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.")

(defrelation agent (?x) :=> (value-cardinality ?x agent.name 1) :axiom
(and (subclass-partition agent (setof person organization))
(subclass-of agent biblio-thing)
(class agent)))

(documentation agent
"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.")
(deffunction agent.name (function agent.name) (domain agent.name agent)
(range agent.name biblio-name) (arity agent.name 2))

(documentation agent.name
"Function from an agent to the name by which it goes. If an agent
has more than one complete name (not parts of the name, such as first
and last name), then the agent.name is the name used to identify that
agent in the shared world. If the shared world is represented in a
database, then the name would be a `key field' for the agent. Other
names can be related to the agent by some other relations.")

(defrelation agent-name (exact-range agent.name agent-name) (class agent-name))

(documentation agent-name "A string that is the name of some agent.")

(defrelation person (subclass-of person agent) (class person))

(documentation person "Human person")

(defrelation author (?x) :=> (value-cardinality ?x agent.name 1) :axiom
(and (subclass-of author agent) (class author)))
(<<= (same-values ?x author.name agent.name) (author ?x)
(consis (same-values ?x author.name agent.name)))

(documentation author
"An author is an agent who writes things. An author must have a
name, which is its real name as an agent. The name as author
may or may not be the agent's name, but usually is.")

(defrelation author.name (?author ?name) :=>
(or (agent.name ?author ?name) (penname ?author ?name)) :axiom
(and (domain author.name author)
(range author.name biblio-name)
(relation author.name)
(arity author.name 2)))

(documentation author.name
"An author name is the name of an agent used to identify
it as an author. It is not necessarily unique; authors may
go by pseudonyms.")

(defrelation penname (subrelation-of penname author.name) (relation penname)
(arity penname 2))

(documentation penname
"An author's pseudonym [Webster]. An author may use several
pseudonyms. Which name is a function of the document.")

(defrelation author-name (exact-range author.name author-name)
(class author-name))

(documentation author-name
"A string that is used as the author.name of some author.
Often databases of author names are kept separately from
databases of people or documents.")

(defrelation organization (subclass-of organization agent) (class organization))

(documentation organization
"An organization is a corporate or similar institution, distinguished
from persons and other agents.")
(deffunction organization.name (function organization.name)
(subrelation-of organization.name agent.name)
(domain organization.name organization) (range organization.name biblio-name)
(arity organization.name 2))

(documentation organization.name
"The name by which organizations go by. One name per place.")

(defrelation publisher (?x) :=> (value-cardinality ?x publisher.name 1) :axiom
(and (subclass-of publisher organization) (class publisher)))

(documentation publisher
"A publisher is an organization that publishes.
The owner of a publishing company may be a person,
and the name of the publisher may be the name of a person.")
(deffunction publisher.name (function publisher.name)
(subrelation-of publisher.name organization.name)
(domain publisher.name publisher) (range publisher.name biblio-name)
(arity publisher.name 2))

(documentation publisher.name "The name of a publisher; one per publisher.")

(defrelation publisher-name (exact-range publisher.name publisher-name)
(class publisher-name))

(documentation publisher-name "A name of some publisher")

(defrelation publisher.address (domain publisher.address publisher)
(range publisher.address city-address) (relation publisher.address)
(arity publisher.address 2))

(documentation publisher.address
"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.")

(defrelation university (subclass-of university organization)
(class university))

(documentation university
"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. Any organization
that has been accredited to grant graduate degrees and is recognized
in libraries to be a publisher of dissertations can be called a
university. Some places that call themselves colleges fall under this
category.")

(defrelation conference (?x) :=>
(and (value-cardinality ?x conf.name 1)
(value-type ?x conf.name biblio-name)
(value-cardinality ?x conf.organization 1)
(value-type ?x conf.organization organization)
(value-cardinality ?x conf.date 1)
(value-type ?x conf.date calendar-date)
(value-type ?x conf.address city-address)
(maximum-value-cardinality ?x conf.address 1))
:axiom (and (subclass-of conference biblio-thing) (class conference)))

(documentation conference
"A conference is a big meeting where people wear badges, sit through
boring talks, and drink coffee in the halls.")
(deffunction conf.name (function conf.name) (domain conf.name conference)
(range conf.name biblio-name) (arity conf.name 2))

(documentation conf.name "Conference name.")
(deffunction conf.date (function conf.date) (domain conf.date conference)
(range conf.date calendar-date) (arity conf.date 2))

(documentation conf.date "Conference date.")
(deffunction conf.address (function conf.address)
(domain conf.address conference) (range conf.address city-address)
(arity conf.address 2))

(documentation conf.address "Conference address.")
(deffunction conf.organization (function conf.organization)
(domain conf.organization conference) (range conf.organization organization)
(arity conf.organization 2))

(documentation conf.organization "Conference name.")

(defrelation timepoint (subclass-of timepoint biblio-thing) (class timepoint))

(documentation timepoint
"A timepoint is a point in real, historical time (on earth).
It is independent of observer and context. A timepoint is not
a measurement of time, nor is it a specification of time.
It is the point in time. The timepoints at which events occur can
be _known_ with various degrees of precision and approximation,
but conceptually timepoints are point-like and not interval-like.
That is, it doesn't make sense to talk about what happens during
a timepoint, or how long the timepoint lasts.")

(defrelation calendar-year (?t) :=> (value-cardinality ?t timepoint.year 1)
:axiom (and (subclass-of calendar-year timepoint) (class calendar-year)))

(documentation calendar-year
"a specification of a point in absolute calendar time, at the
resolution of one year.")

(defrelation calendar-date (?t) :=>
(and (value-cardinality ?t timepoint.day 1)
(value-cardinality ?t timepoint.month 1)
(value-cardinality ?t timepoint.year 1))
:axiom (and (subclass-of calendar-date timepoint) (class calendar-date)))

(documentation calendar-date
"a specification of a point in absolute calendar time, at the
resolution of one day.")

(defrelation universal-time-spec (?t) :=>
(and (value-cardinality ?t timepoint.seconds 1)
(value-cardinality ?t timepoint.minutes 1)
(value-cardinality ?t timepoint.day 1)
(value-cardinality ?t timepoint.month 1)
(value-cardinality ?t timepoint.year 1))
:axiom
(and (subclass-of universal-time-spec timepoint) (class universal-time-spec)))

(documentation universal-time-spec
"a specification of a point in real-world, historical, wall-clock time,
independent of timezone and with one second resolution.")
(deffunction timepoint.year (function timepoint.year)
(domain timepoint.year timepoint) (range timepoint.year year-number)
(arity timepoint.year 2))

(documentation timepoint.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.")

(defrelation year-number (subclass-of year-number integer) (class year-number))

(documentation year-number "A year expressed as the number of years A.D.")
(deffunction timepoint.month (function timepoint.month)
(domain timepoint.month timepoint) (range timepoint.month month-name)
(arity timepoint.month 2))

(documentation timepoint.month
"function from time points to months, representing the month component of
the time specification. Months are not integers, but named objects.")

(defrelation month-name
(all-instances month-name
(setof january february march april may june july august september october
november december))
(class month-name))

(documentation month-name
"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.")
(defobject january (month-name january))
(defobject february (month-name february))
(defobject march (month-name march))
(defobject april (month-name april))
(defobject may (month-name may))
(defobject june (month-name june))
(defobject july (month-name july))
(defobject august (month-name august))
(defobject september (month-name september))
(defobject october (month-name october))
(defobject november (month-name november))
(defobject december (month-name december))

(defrelation day-number (?day-of-month) :=
(and (integer ?day-of-month) (=< 0 ?day-of-month) (=< ?day-of-month 31))
:axiom (and (subclass-of day-number integer) (class day-number)))

(documentation day-number "integer representing day of month.")
(deffunction timepoint.day (function timepoint.day)
(domain timepoint.day timepoint) (range timepoint.day day-number)
(arity timepoint.day 2))

(documentation timepoint.day
"function from time points to integers representing the day
component of the time specification.")
(deffunction timepoint.minutes
(=> (timepoint.minutes ?timepoint ?minutes)
(and (=< 0 ?minutes) (=< ?minutes 59)))
(function timepoint.minutes) (domain timepoint.minutes timepoint)
(range timepoint.minutes integer) (arity timepoint.minutes 2))

(documentation timepoint.minutes
"function from time points to integers representing the minutes
component of the time specification.")
(deffunction timepoint.seconds
(=> (timepoint.seconds ?timepoint ?seconds)
(and (=< 0 ?seconds) (=< ?seconds 59)))
(function timepoint.seconds) (domain timepoint.seconds timepoint)
(range timepoint.seconds integer) (arity timepoint.seconds 2))

(documentation 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.")

(defrelation document (?x) :=> (value-cardinality ?x doc.title 1) :axiom
(and (subclass-partition document
(setof book periodical-publication proceedings thesis technical-report
miscellaneous-publication))
(subclass-of document biblio-thing)
(class document)))

(documentation document
"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.")
(deffunction doc.title (function doc.title) (domain doc.title document)
(range doc.title title) (arity doc.title 2))

(documentation doc.title
"The title of a document. Not necessarily the title of a work
published in the document.")

(defrelation doc.author (domain doc.author document) (range doc.author author)
(relation doc.author) (arity doc.author 2))

(documentation doc.author
"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.")
(deffunction doc.author.name (function doc.author.name)
(nth-domain doc.author.name 1 document) (nth-domain doc.author.name 2 author)
(nth-domain doc.author.name 3 author-name) (arity doc.author.name 3))

(documentation doc.author.name
"The name used by an author is a function of the document and the author.")

(defrelation doc.author-name (?doc ?name) :=>
(exists (?author)
(and (doc.author ?doc ?author) (doc.author.name ?doc ?author ?name)))
:axiom
(and (domain doc.author-name document)
(range doc.author-name author-name)
(relation doc.author-name)
(arity doc.author-name 2)))

(documentation doc.author-name
"Each author of a document is identified by an author-name.
Although an author can have several pennames, the author only
gets to use one of them for a particular document.")
(deffunction doc.publication-date (function doc.publication-date)
(domain doc.publication-date document)
(range doc.publication-date calendar-year) (arity doc.publication-date 2))

(documentation doc.publication-date
"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.")
(deffunction doc.publisher (function doc.publisher)
(domain doc.publisher document) (range doc.publisher publisher)
(arity doc.publisher 2))

(documentation doc.publisher
"The publisher of a document, if there is one. This is the
publisher, not its name.")
(deffunction doc.institution
(=> (doc.institution ?doc ?organization) (or (book ?doc) (proceedings ?doc)))
(function doc.institution) (range doc.institution organization)
(arity doc.institution 2))

(documentation doc.institution
"The institution that publishes a document, like a University or
trade association.")
(deffunction doc.conference (function doc.conference)
(domain doc.conference proceedings) (range doc.conference conference)
(arity doc.conference 2))

(documentation doc.conference "The conference associated with a proceedings.")

(defrelation doc.editor (?doc ?editor) :=> (or (book ?doc) (proceedings ?doc))
:axiom
(and (range doc.editor person) (relation doc.editor) (arity doc.editor 2)))

(documentation doc.editor "Named primary editors of a document.")

(defrelation doc.series-editor (?doc ?editor) :=>
(or (book ?doc) (proceedings ?doc)) :axiom
(and (range doc.series-editor person)
(relation doc.series-editor)
(arity doc.series-editor 2)))

(documentation doc.series-editor "Series editors of a document.")
(deffunction doc.series-title
(=> (doc.series-title ?doc ?title) (or (book ?doc) (proceedings ?doc)))
(function doc.series-title) (range doc.series-title title)
(arity doc.series-title 2))

(documentation doc.series-title "Series title of a document.")

(defrelation doc.translator (?doc ?translator) :=>
(or (book ?doc) (proceedings ?doc)) :axiom
(and (range doc.translator person)
(relation doc.translator)
(arity doc.translator 2)))

(documentation doc.translator "Named primary editors of a document.")
(deffunction doc.edition
(=> (doc.edition ?doc ?nth)
(or (book ?doc) (proceedings ?doc) (cartographic-map ?doc)))
(function doc.edition) (range doc.edition natural) (arity doc.edition 2))

(documentation doc.edition "Refers to the nth edition of a document.")
(deffunction doc.number-of-pages (function doc.number-of-pages)
(domain doc.number-of-pages document) (range doc.number-of-pages natural)
(arity doc.number-of-pages 2))

(documentation doc.number-of-pages
"Number of pages contained a document. Not the page numbers of an article")

(defrelation book (?x) :=>
(and (minimum-value-cardinality ?x doc.author 1)
(value-cardinality ?x doc.title 1)
(value-cardinality ?x doc.publication-date 1)
(value-cardinality ?x doc.publisher 1))
:axiom (and (subclass-of book document) (class book)))

(documentation book "pages in a bound cover. You can't judge it by its cover.")

(defrelation edited-book (?x) :=
(and (book ?x)
(minimum-value-cardinality ?x doc.editor 1)
(same-values ?x doc.editor doc.author))
:axiom (and (subclass-of edited-book book) (class edited-book)))

(documentation edited-book
"An edited book is a book whose authors are known as editors.")

(defrelation periodical-publication
(subclass-partition periodical-publication (setof journal magazine newspaper))
(subclass-of periodical-publication document) (class periodical-publication))

(documentation periodical-publication
"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.")

(defrelation journal (subclass-of journal periodical-publication)
(class journal))

(documentation journal
"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.")

(defrelation magazine (subclass-of magazine periodical-publication)
(class magazine))

(documentation magazine
"A magazine is a periodical publication that is considered to be of
more general interest than a journal.")

(defrelation newspaper (subclass-of newspaper periodical-publication)
(class newspaper))

(documentation newspaper
"A newspaper is a periodical publication that may be published as
frequently as once a day.")

(defrelation proceedings (?x) :=>
(and (value-cardinality ?x doc.conference 1)
(value-type ?x doc.conference conference)
(same-values ?x doc.title (compose conf.name doc.conference))
(same-values ?x doc.publication-date (compose conf.date doc.conference)))
:axiom (and (subclass-of proceedings document) (class proceedings)))

(documentation proceedings
"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.")

(defrelation thesis (?x) :=>
(and (value-cardinality ?x doc.author 1)
(value-cardinality ?x doc.title 1)
(value-cardinality ?x doc.publication-date 1)
(value-cardinality ?x thesis.university 1)
(value-type ?x thesis.university university))
:axiom
(and (exhaustive-subclass-partition thesis
(setof masters-thesis doctoral-thesis))
(subclass-of thesis document)
(class thesis)))

(documentation thesis
"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.")

(defrelation masters-thesis (subclass-of masters-thesis thesis)
(class masters-thesis))

(documentation masters-thesis "M.S. thesis document.")

(defrelation doctoral-thesis (subclass-of doctoral-thesis thesis)
(class doctoral-thesis))

(documentation doctoral-thesis "Ph.D. thesis document")
(deffunction thesis.university (function thesis.university)
(domain thesis.university thesis) (range thesis.university university)
(arity thesis.university 2))

(defrelation technical-report (?x) :=>
(and (minimum-value-cardinality ?x doc.author 1)
(value-cardinality ?x doc.title 1)
(value-cardinality ?x doc.publication-date 1)
(value-cardinality ?x doc.institution 1)
(value-type ?x doc.institution organization))
:axiom (and (subclass-of technical-report document) (class technical-report)))

(documentation technical-report
"A technical report is a paper published by some research
organization.")

(defrelation miscellaneous-publication (?x) :=>
(value-cardinality ?x doc.title 1) :axiom
(and (subclass-partition miscellaneous-publication
(setof technical-manual computer-program artwork cartographic-map
multimedia-document))
(subclass-of miscellaneous-publication document)
(class miscellaneous-publication)))

(documentation miscellaneous-publication
"A miscellaneous category of documents that are infrequently found
in bibliographic references.")

(defrelation technical-manual
(subclass-of technical-manual miscellaneous-publication)
(class technical-manual))

(documentation technical-manual "The doc.author is the technical writer.")

(defrelation computer-program
(subclass-of computer-program miscellaneous-publication)
(class computer-program))

(documentation computer-program "The doc.author is the programmer.")

(defrelation artwork (?x) :=> (value-cardinality ?x doc.author 1) :axiom
(and (subclass-of artwork miscellaneous-publication) (class artwork)))

(documentation artwork "The doc.author is the artist.")

(defrelation cartographic-map
(subclass-of cartographic-map miscellaneous-publication)
(class cartographic-map))

(documentation cartographic-map "The doc.author is the cartographer.")

(defrelation multimedia-document
(subclass-of multimedia-document miscellaneous-publication)
(class multimedia-document))

(documentation multimedia-document
"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.")

(defrelation reference
(exhaustive-subclass-partition reference
(setof publication-reference non-publication-reference))
(subclass-of reference biblio-thing) (class reference))

(documentation reference
"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.) .")
(deffunction ref.document (function ref.document)
(domain ref.document publication-reference) (range ref.document document)
(arity ref.document 2))

(documentation ref.document
"Function from references to associated documents.
Is only defined on publication-references, since by definition they are the
references associated with documents.")

(defrelation ref.author (domain ref.author reference)
(range ref.author author-name) (relation ref.author) (arity ref.author 2))

(documentation ref.author
"Relation between a reference and the name(s) of the
creator(s) of the publication.")
(deffunction ref.title (function ref.title) (domain ref.title reference)
(range ref.title title) (arity ref.title 2))

(documentation 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.")
(deffunction ref.booktitle (function ref.booktitle)
(domain ref.booktitle reference) (range ref.booktitle title)
(arity ref.booktitle 2))

(documentation ref.booktitle
"The title of the document that is a collection in which a reference
appears. For example, the ref.title of a paper in an edited collection
would be the name of the paper, and the ref.booktitle would be the name
of the edited book.")
(deffunction ref.year (function ref.year) (domain ref.year reference)
(range ref.year year-number) (arity ref.year 2))

(documentation ref.year
"The year field is a function from a reference to the year
in which the publication was published.")
(deffunction ref.periodical (function ref.periodical)
(domain ref.periodical reference) (range ref.periodical title)
(arity ref.periodical 2))

(documentation ref.periodical
"Most general relation between a reference and a journal.")
(deffunction ref.volume
(=> (ref.volume ?ref ?number)
(or (book-reference ?ref)
(book-section-reference ?ref)
(article-reference ?ref)))
(function ref.volume) (range ref.volume natural) (arity ref.volume 2))

(documentation ref.volume
"in a reference, the volume number of a journal or magazine
in which an article occurs.")
(deffunction ref.issue (function ref.issue)
(domain ref.issue article-reference) (range ref.issue natural)
(arity ref.issue 2))

(documentation ref.issue
"In a reference, the issue number of a journal or magazine
in which an article occurs.")
(deffunction ref.report-number (function ref.report-number)
(domain ref.report-number technical-report-reference)
(range ref.report-number biblio-name) (arity ref.report-number 2))

(documentation ref.report-number
"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.")
(deffunction ref.pages
(=> (ref.pages ?ref ?page-range)
(and (or (book-section-reference ?ref)
(article-reference ?ref)
(proceedings-paper-reference ?ref))
(integer (first ?page-range))
(integer (first (rest ?page-range)))))
(function ref.pages) (range ref.pages list) (arity ref.pages 2))

(documentation ref.pages
"In a reference, the pages of an article or analogous subdocument in which a
publication resides. Specified as a sequence of two integers.")
(deffunction ref.month
(=> (ref.month ?ref ?month)
(or (article-reference ?ref) (technical-report ?ref)))
(function ref.month) (range ref.month month-name) (arity ref.month 2))

(documentation ref.month
"In a reference, the month in which a publication is published.
Useful for magazines, conference proceedings, and technical reports.")
(deffunction ref.day
(=> (ref.day ?ref ?day)
(or (article-reference ?ref) (personal-communication-reference ?ref)))
(function ref.day) (range ref.day day-number) (arity ref.day 2))

(documentation ref.day
"In a reference, the day of the month in which a publication is published.
Useful for conference proceedings, personal communications.")

(defrelation ref.notes (domain ref.notes reference)
(range ref.notes biblio-nl-text) (relation ref.notes) (arity ref.notes 2))

(documentation ref.notes
"In a reference, the notes field contains a set of strings that is used
to describe all sorts of things.")
(deffunction ref.abstract (function ref.abstract)
(domain ref.abstract reference) (range ref.abstract biblio-nl-text)
(arity ref.abstract 2))

(documentation ref.abstract
"In a reference, the abstract field contains a string of natural
language text that is used to describe all sorts of things.")

(defrelation ref.keywords (domain ref.keywords reference)
(range ref.keywords keyword) (relation ref.keywords) (arity ref.keywords 2))

(documentation ref.keywords "Keywords associated with a reference.")

(defrelation ref.labels (domain ref.labels reference)
(range ref.labels biblio-name) (relation ref.labels) (arity ref.labels 2))

(documentation ref.labels "Labels associated with a reference.")

(defrelation ref.editor
(= ref.editor (compose agent.name doc.editor ref.document))
(relation ref.editor) (arity ref.editor 2))

(documentation ref.editor
"A reference's editor is the name of the document's editor.")

(defrelation ref.series-editor
(= ref.series-editor (compose agent.name doc.series-editor ref.document))
(relation ref.series-editor) (arity ref.series-editor 2))

(documentation ref.series-editor
"A reference's series editor is the name of a series editor of
the document.")

(defrelation ref.translator
(= ref.translator (compose agent.name doc.translator ref.document))
(relation ref.translator) (arity ref.translator 2))

(documentation ref.translator
"A reference's translator is the name of the document's translator.")

(defrelation ref.secondary-author (domain ref.secondary-author reference)
(range ref.secondary-author agent-name) (relation ref.secondary-author)
(arity ref.secondary-author 2))

(documentation ref.secondary-author
"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.")

(defrelation ref.tertiary-author (domain ref.tertiary-author reference)
(range ref.tertiary-author agent-name) (relation ref.tertiary-author)
(arity ref.tertiary-author 2))

(documentation ref.tertiary-author
"Teritiary author of a reference. Beats me what this is.")

(defrelation ref.secondary-title (domain ref.secondary-title reference)
(range ref.secondary-title title) (relation ref.secondary-title)
(arity ref.secondary-title 2))

(documentation ref.secondary-title
"In a reference, the secondary title usually names the book or
serial in which the publication is published.")

(defrelation ref.address (domain ref.address reference)
(range ref.address city-address) (relation ref.address) (arity ref.address 2))

(documentation ref.address
"The place (e.g., city) where a document is published. Means
different things depending on the reference type.")
(deffunction ref.organization (function ref.organization)
(domain ref.organization reference) (range ref.organization organization)
(arity ref.organization 2))

(documentation ref.organization
"The organization that publishes a referenced document.
May be inherited from a conference organization for proceedings.")
(deffunction ref.publisher (function ref.publisher)
(domain ref.publisher reference) (range ref.publisher publisher-name)
(arity ref.publisher 2))

(documentation ref.publisher
"The publisher field of a reference points to the publisher of
the associated document.")
(deffunction ref.number-of-volumes (function ref.number-of-volumes)
(domain ref.number-of-volumes reference) (range ref.number-of-volumes natural)
(arity ref.number-of-volumes 2))

(documentation ref.number-of-volumes
"In a reference, the number of volumes in the associated document.")
(deffunction ref.edition
(= (ref.edition ?ref) (doc.edition (ref.document ?ref)))
(function ref.edition) (domain ref.edition reference)
(range ref.edition natural) (arity ref.edition 2))

(documentation ref.edition "Refers to the nth edition of a document.")
(deffunction ref.type-of-work
(=> (ref.type-of-work ?ref ?name)
(or (thesis-reference ?ref)
(technical-report-reference ?ref)
(misc-publication-reference ?ref)))
(function ref.type-of-work) (range ref.type-of-work biblio-name)
(arity ref.type-of-work 2))

(documentation ref.type-of-work
"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.")

(defrelation publication-reference (?ref) :=>
(and (value-cardinality ?ref ref.document 1)
(value-type ?ref ref.document document)
(value-cardinality ?ref ref.title 1))
:axiom
(and (subclass-partition publication-reference
(setof book-reference book-section-reference article-reference
proceedings-paper-reference thesis-reference technical-report-reference
misc-publication-reference))
(subclass-of publication-reference reference)
(class publication-reference)))

(documentation publication-reference
"A reference associated with some kind of published document, where
publication and documenthood are interpreted broadly.")

(defrelation non-publication-reference (?ref) :=>
(value-cardinality ?ref ref.document 0) :axiom
(and (subclass-partition non-publication-reference
(setof personal-communication-reference generic-unpublished-reference))
(subclass-of non-publication-reference reference)
(class non-publication-reference)))

(documentation non-publication-reference
"A reference to something that just isn't a document.")

(defrelation book-reference (?ref) :=>
(and (value-cardinality ?ref ref.document 1)
(value-type ?ref ref.document book)
(same-values ?ref ref.secondary-author ref.series-editor)
(same-values ?ref ref.secondary-title doc.series-title))
:axiom
(and (subclass-of book-reference publication-reference)
(subclass-of book-reference inherits-author-from-document)
(subclass-of book-reference inherits-title-from-document)
(subclass-of book-reference book-publication-data-constraint)
(class book-reference)))

(documentation book-reference
"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
document.")

(defrelation edited-book-reference (?ref) :=
(and (book-reference ?ref)
(value-cardinality ?ref ref.document 1)
(value-type ?ref ref.document edited-book)
(minimum-value-cardinality ?ref ref.editor 1)
(same-values ?ref ref.author ref.editor))
:axiom
(and (subclass-of edited-book-reference book-reference)
(class edited-book-reference)))

(documentation edited-book-reference
"like a book-reference, except the document is an edited-book and
the author and editor are the same.")

(defrelation book-section-reference (?ref) :=>
(and (value-cardinality ?ref ref.document 1)
(value-type ?ref ref.document edited-book)
(minimum-value-cardinality ?ref ref.author 1)
(minimum-value-cardinality ?ref ref.editor 1)
(value-cardinality ?ref ref.booktitle 1)
(same-values ?ref ref.booktitle (compose doc.title ref.document))
(same-values ?ref ref.secondary-author ref.editor)
(same-values ?ref ref.tertiary-author ref.series-editor))
:axiom
(and (subclass-of book-section-reference publication-reference)
(subclass-of book-section-reference book-publication-data-constraint)
(class book-section-reference)))

(documentation book-section-reference
"A section of a book, like a chapter or a paper in an edited collection.")

(defrelation article-reference (?ref) :=>
(and (value-type ?ref ref.document periodical-publication)
(minimum-value-cardinality ?ref ref.author 1)
(value-cardinality ?ref ref.title 1)
(value-cardinality ?ref ref.year 1)
(value-cardinality ?ref ref.periodical 1)
(same-values ?ref ref.periodical (compose doc.title ref.document))
(same-values ?ref ref.secondary-title ref.periodical))
:axiom
(and (subclass-of article-reference publication-reference)
(class article-reference)))

(documentation article-reference
"An article is a piece published in a journal, magazine, or newspaper.")

(defrelation journal-article-reference (?ref) :=>
(and (value-type ?ref ref.document journal)
(value-cardinality ?ref ref.month 0))
:axiom
(and (subclass-of journal-article-reference article-reference)
(class journal-article-reference)))

(documentation journal-article-reference
"A reference to article in a journal must give information sufficient to
find the issue containing the article.")

(defrelation magazine-article-reference (?ref) :=>
(and (value-type ?ref ref.document magazine)
(value-cardinality ?ref ref.magazine-name 1)
(same-values ?ref ref.magazine-name ref.periodical))
:axiom
(and (subclass-of magazine-article-reference article-reference)
(class magazine-article-reference)))

(documentation magazine-article-reference
"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.")
(deffunction ref.magazine-name (function ref.magazine-name)
(domain ref.magazine-name magazine-article-reference)
(range ref.magazine-name title) (arity ref.magazine-name 2))

(documentation ref.magazine-name
"Field for name of the magazine in a magazine article reference.")

(defrelation newspaper-article-reference (?ref) :=>
(and (value-type ?ref ref.document newspaper)
(value-cardinality ?ref ref.newspaper-name 1)
(same-values ?ref ref.magazine-name ref.periodical)
(value-cardinality ?ref ref.month 1)
(value-cardinality ?ref ref.day 1)
(value-type ?ref ref.address city-address))
:axiom
(and (subclass-of newspaper-article-reference article-reference)
(class newspaper-article-reference)))

(documentation newspaper-article-reference
"A newspaper article reference is like a magazine article reference")
(deffunction ref.newspaper-name (function ref.newspaper-name)
(domain ref.newspaper-name newspaper-article-reference)
(range ref.newspaper-name title) (arity ref.newspaper-name 2))

(documentation ref.newspaper-name
"Field for name of a newspaper in a newspaper article reference.")

(defrelation proceedings-paper-reference (?ref) :=>
(and (value-type ?ref ref.document proceedings)
(minimum-value-cardinality ?ref ref.author 1)
(value-cardinality ?ref ref.title 1)
(value-cardinality ?ref ref.booktitle 1)
(same-values ?ref ref.booktitle (compose doc.title ref.document))
(same-values ?ref ref.secondary-title ref.booktitle)
(same-values ?ref ref.secondary-author ref.editor)
(same-values ?ref ref.organization
(compose conf.organization doc.conference ref.document))
(same-values ?ref ref.address
(compose conf.address doc.conference ref.document))
(same-values ?ref ref.month
(compose timepoint.month doc.publication-date ref.document))
(same-values ?ref ref.day
(compose timepoint.day doc.publication-date ref.document)))
:axiom
(and (subclass-of proceedings-paper-reference publication-reference)
(subclass-of proceedings-paper-reference inherits-year-from-document)
(class proceedings-paper-reference)))

(documentation proceedings-paper-reference
"An article appearing in the published proceedings of some conference or
workshop.")

(defrelation thesis-reference (?ref) :=>
(and (value-type ?ref ref.document thesis)
(value-cardinality ?ref ref.publisher 1)
(same-values ?ref ref.publisher
(compose organization.name thesis.university)))
:axiom
(and (subclass-partition thesis-reference
(setof doctoral-thesis-reference masters-thesis-reference))
(subclass-of thesis-reference publication-reference)
(subclass-of thesis-reference inherits-author-from-document)
(subclass-of thesis-reference inherits-title-from-document)
(subclass-of thesis-reference inherits-year-from-document)
(class thesis-reference)))

(documentation thesis-reference "A reference to a master's or doctoral thesis.")

(defrelation doctoral-thesis-reference (?ref) :=>
(and (value-type ?ref ref.document doctoral-thesis)
(has-value ?ref ref.type-of-work "Doctoral Thesis"))
:axiom
(and (subclass-of doctoral-thesis-reference thesis-reference)
(class doctoral-thesis-reference)))

(defrelation masters-thesis-reference (?ref) :=>
(and (value-type ?ref ref.document masters-thesis)
(has-value ?ref ref.type-of-work "Masters Thesis"))
:axiom
(and (subclass-of masters-thesis-reference thesis-reference)
(class masters-thesis-reference)))

(defrelation technical-report-reference (?ref) :=>
(and (value-cardinality ?ref ref.publisher 1)
(same-values ?ref ref.publisher
(compose organization.name doc.institution)))
:axiom
(and (subclass-of technical-report-reference publication-reference)
(subclass-of technical-report-reference inherits-author-from-document)
(subclass-of technical-report-reference inherits-title-from-document)
(subclass-of technical-report-reference inherits-year-from-document)
(class technical-report-reference)))

(defrelation misc-publication-reference
(subclass-partition misc-publication-reference
(setof technical-manual-reference computer-program-reference
cartographic-map-reference artwork-reference multimedia-document-reference))
(subclass-of misc-publication-reference publication-reference)
(class misc-publication-reference))

(defrelation technical-manual-reference
(subclass-of technical-manual-reference misc-publication-reference)
(subclass-of technical-manual-reference inherits-author-from-document)
(subclass-of technical-manual-reference inherits-title-from-document)
(subclass-of technical-manual-reference inherits-year-from-document)
(class technical-manual-reference))

(documentation technical-manual-reference
"A reference to a manual that may accompany a product but is otherwise
unpublished.")

(defrelation computer-program-reference
(subclass-of computer-program-reference misc-publication-reference)
(subclass-of computer-program-reference inherits-author-from-document)
(subclass-of computer-program-reference inherits-title-from-document)
(class computer-program-reference))

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

(defrelation cartographic-map-reference
(subclass-of cartographic-map-reference misc-publication-reference)
(subclass-of cartographic-map-reference inherits-author-from-document)
(subclass-of cartographic-map-reference inherits-title-from-document)
(subclass-of cartographic-map-reference inherits-year-from-document)
(class cartographic-map-reference))

(documentation cartographic-map-reference
"A reference to a map created by a cartographer.")

(defrelation artwork-reference
(subclass-of artwork-reference misc-publication-reference)
(subclass-of artwork-reference inherits-author-from-document)
(subclass-of artwork-reference inherits-title-from-document)
(subclass-of artwork-reference inherits-year-from-document)
(class artwork-reference))

(documentation artwork-reference
"A reference to a work of art that does not fit the other categories of
documents. The author is the artist.")

(defrelation multimedia-document-reference
(subclass-of multimedia-document-reference misc-publication-reference)
(subclass-of multimedia-document-reference inherits-author-from-document)
(subclass-of multimedia-document-reference inherits-title-from-document)
(subclass-of multimedia-document-reference inherits-year-from-document)
(class multimedia-document-reference))

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

(defrelation personal-communication-reference (?ref) :=>
(and (value-cardinality ?ref ref.author 1)
(value-cardinality ?ref ref.year 1)
(value-cardinality ?ref ref.month 1)
(value-cardinality ?ref ref.day 1))
:axiom
(and (subclass-of personal-communication-reference non-publication-reference)
(class personal-communication-reference)))

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

(defrelation generic-unpublished-reference
(subclass-of generic-unpublished-reference non-publication-reference)
(class generic-unpublished-reference))

(defrelation inherits-author-from-document (?ref) :=
(and (publication-reference ?ref)
(same-values ?ref ref.author (compose doc.author-name ref.document)))
:axiom
(and (subclass-of inherits-author-from-document publication-reference)
(class inherits-author-from-document)))

(documentation inherits-author-from-document
"When a reference is a one-to-one account of a document, then the author
in the reference (ref.author) is the name of the author of the document.
This relation captures this relationship.")

(defrelation inherits-publisher-from-document (?ref) :=
(and (publication-reference ?ref)
(same-values ?ref ref.publisher
(compose publisher.name doc.publisher ref.document))
(same-values ?ref ref.address
(compose publisher.address doc.publisher ref.document)))
:axiom
(and (subclass-of inherits-publisher-from-document publication-reference)
(class inherits-publisher-from-document)))

(documentation inherits-publisher-from-document
"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.")

(defrelation inherits-year-from-document (?ref) :=
(and (publication-reference ?ref)
(same-values ?ref ref.year
(compose timepoint.year doc.publication-date ref.document)))
:axiom
(and (subclass-of inherits-year-from-document publication-reference)
(class inherits-year-from-document)))

(documentation inherits-year-from-document
"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.")

(defrelation inherits-title-from-document (?ref) :=
(and (publication-reference ?ref)
(same-values ?ref ref.title (compose doc.title ref.document)))
:axiom
(and (subclass-of inherits-title-from-document publication-reference)
(class inherits-title-from-document)))

(defrelation book-publication-data-constraint (?ref) :=
(and (publication-reference ?ref)
(value-cardinality ?ref ref.document 1)
(value-type ?ref ref.document book)
(value-cardinality ?ref ref.publisher 1)
(inherits-publisher-from-document ?ref)
(value-cardinality ?ref ref.year 1)
(inherits-year-from-document ?ref))
:axiom
(and (subclass-of book-publication-data-constraint publication-reference)
(subclass-of book-publication-data-constraint
inherits-publisher-from-document)
(subclass-of book-publication-data-constraint
inherits-year-from-document)
(class book-publication-data-constraint)))

(documentation book-publication-data-constraint
"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.")