QFACTS (Version 921124)
The central goal of Qfacts is to define a standard for
representing, analyzing and retrieving information, facts, and
knowledge as quickly, easily, efficiently, and tersely as
possible, using simple tools.
Any basic propositions that can be stored in a database,
spreadsheet, or knowledgebase can be stored as one-line
statements in plain text Qfacts files.
A Qfacts fact/record consists of an object or head followed by
any number of descriptive property/value pairs, all on one line:
obj val1 val2 val3 ...
France Paris $724.1b 1986
Qfacts statements are written in SGML (Standard Generalized
Markup Language) style, but do not strictly follow SGML rules and
conventions. Qfacts properties are roughly equivalent to SGML
tags.
Qfacts is an effort to define a scheme for representing
well-structured information and knowledge that is maximally
simple and intelligible for non-programmers. The kinds of
knowledge structures that should be represented in Qfacts should
usually be no longer than 1000 characters, and will as a rule be
between 50 and 200 characters. More complicated and lengthy
knowledge structures will burst the bounds of Qfacts' line
limits. But a surprising number of factual propositions about the
world can be comfortably represented within the conventions of
Qfacts.
A Qfacts file consists of a list of facts (or records) in Qfacts
format. A Qfacts file is headed by the tag
#qfacts
which signals the beginning of an object of record type "qfacts."
(This convention is part of another tagging scheme called
Knotes--for Knowledge Notes--which is not necessary to discuss
here.) The beginning of a set of Qfacts records is defined by the
tag
The end of a Qfacts file is defined in SGML style by the tag
or by the end of the file, whichever comes first.
Qfacts files are designed to be easily searched by boolean grep
programs like Maxfind or KWS, merged with other plain text Qfacts
files, and analyzed by knowledgebase software which understands
the Qfacts format. A typical way to use Qfacts files is to store
tens, or hundreds, or thousands of them under a single directory,
and to retrieve records with a favorite grep program accessed
through a well-tuned batch file.
Qfacts statements can be easily composed on the fly with a simple
text editor, and are fully self-documented and portable.
Multiple values for any property can be stored as a list enclosed
in parentheses and by separating each item in the value list by a
semicolon:
France (Paris; Marseille; Lyon; Toulouse; Nice)
Values themselves can be treated as objects or heads by storing
their property/value pairs in parentheses:
France Paris ( 2,188,918 1982)
Parentheses can be nested at any level of depth.
Generally, however, the best style is to store only one
property/value pair in each record.
Some sample Qfacts statements:
Electronic Data Systems $4,744.6m 1988 Universal Almanac 1990
Exxon 3 1988 Universal Almanac 1990
France Paris
Huntington, Samuel pro-Clinton ad signer 1992 New York Times 8/17/1992
Los Angeles, Calif 2,969,528 1980
Massachusetts Weld, William ( Republican) 1992
Mean Streets movie Scorcese, Martin 1973
Mosley, Walter A Red Death (New York: Pocket Books) 1992
Perot, Ross 19 November 4, 1992
Turner, Ted CNN, One CNN Center, Atlanta, GA 30348 1992 Boston Globe 11/16/1992 p22
Will, George syndicated columnist
Vanity Fair The Conde Naste Publications Inc. 1992
There are a number of reserved property tags and other keywords
in Qfacts:
= a category to which an object belongs
= abbreviation for = date that property/value pair(s) was true for object
= abbreviation for date
= keyword describing an object and statement
= abbreviation for = miscellaneous note
= abbreviation for = quote about an object
= positive quote about an object
= negative quote about an object
= abbreviation for = abbreviation for = abbreviation for = the source of a qfact
= abbreviation for = time that property/value pair(s) was true for object
= abbreviation for = user who composed qfact
= abbreviation for = write date: date qfact was composed
= year that property/value pair(s) was true for object
= abbreviation for
!rule: = a rule directive
!abb: = an abbreviation definition
There are two other special types of Qfacts statement.
Rules and other commands for manipulating, analyzing, and
generating inferences from Qfacts statements are expressed as
special directives preceded by an exclamation point:
!rule: if x y then y x
The variables "x" and "y" always point to an object and value
respectively.
For the statement
617 Boston
Qfacts on command would automatically generate the statement:
Boston 617
Rule directives must appear on single lines, and can be stored in
the same file with other Qfacts statements.
Abbreviation directives are stored in a similar way:
!abb: lang = language
!abb: hfac = House Foreign Affairs Committee
A Qfacts statement with an object/head enclosed by a leading
pound sign and following colon is a pointer to a record type:
#movie: Amadeus Forman, Milos 1984
#book: Vidal, Gore Live from Golgatha New York Random House 1992
One could write the rule:
!rule: in #movie if y then y movie
In other words, Amadeus belongs to the category "movie."
The left and right angle brackets which delimit Qfacts tags can
be forced into their conventional meaning by preceding them with
a tilde:
~< ~>
A Qfacts record without any property tags is perfectly legal, and
is considered to be a miscellaneous unstructured note.
The best style for storing source information is minimal but
sufficient to track down the source:
New York Times 11/24/1992 p3 //a newspaper source
Steele Common Lisp 1990 p251 //a book source
With today's powerful and omnipresent databases, for most folks
expanding these brief source pointers to their full cites is a
trivial matter. The goal behind Qfacts is to provide a mechanism
for representing knowledge as easily, quickly and tersely (but
intelligibly) as possible.
A sample use of Qfacts files: unzip them to C:\QFDATA and search
them with QF.BAT:
@echo off
kws c:\qfdata\*.* %1 %2 %3 %4 > c:\tmp\tmp.qf
list c:\tmp\tmp.qf /w
This batch file assumes that QF.BAT, KWS and LIST are in your
path.
In the latest version of KWS the above batch statement will
assume a boolean "and" between arguments.
This scheme for doing simple knowledge representation in plain
ASCII files is entirely arbitrary. Suggestions are welcome for
improving these conventions. If enough people can agree on a
standard for basic knowledge representation, useful software
tools should appear in due time for processing plain
knowledgebase files.
Wayne McGuire
Compuserve: 71330,2074
Genie: w.mcguire
Internet: wmcguire@world.std.com
Internet: 71330.2074@compuserve.com
Internet: wayne.mcguire@channel1.com
Channel One (BBS): 617-354-8873