Reading
from and Saying to the Internet
Revised 7/10/2002 by Seth Russell
[sailor agents]
The Perdicament:
Internally a sailor
agent interacts with the computer platform on which it is hosted and it's
knowledge base to produce behaviro. Externally agents read, write, and respond
to languistic statements from the internet and from their owners.
Language:
It takes three
things to make a language:
- A grammar
- A vocabulary
- A group of interacting
agents using that grammar and vocabulary.
Several languages have been
defined for sailor agents. Each language has a file that defines it's
grammar. These files reside in the /homePath/grammar/ directory. They
define the grammar for both reading and saying. The vocabulary of sailor
agents is primarialy learned by reading from the Internet and is independant of the grammar in which it
is read or written. In other words an agent can read in knowledge in
one grammar and write it out in another grammar.
Additionaly a running instance of a sailor agent will respond to instructions,
called semenglish imperatives. Every public method of the sailor's running
instance is a vocabulary word in the instruction language. The grammar of
this language is given @here@.
Note that by convention
all grammar names are lower case. Here is a list of proposed
grammars for agents with their current implementation status:
- semenglish (saying)
- rdf
- quads (reading, saying)
- n3 (partual reading)
- kif
- cycl
- html (saying)
- semenglishImparitives (reading)
Designating a grammar for
reading:
Prior to instructing
the agent to read, the grammar must be designated. This is done with
the command 'reading' which takes for its only argument the name of the grammar.
For example: if you are communicating with the agent from a HTML internet
page that is served by a sailorServer and want to designate that the grammar
of the next read instruction will be RDF, then the command would be:
{! reading(rdf) !}
Or from a query:
http://host:port/path?reading=rdf
Or from a python script:
me.reading('rdf') Where me is the name of your
sailor instance.
Reading commands can be nested.
To revert to the prior
grammar for the next read instruction, issue the command:
me.endReading()
Designating a grammar for
saying:
Prior to instructing
the agent to write, the grammar must be designated. This is done with
the command 'saying' which takes for its only argument the name of the grammar.
saying commands can be nested. For example: if you are communicating
with the agent from a HTML internet page that is served by a sailorServer
and want to designate that the grammar of the next write instruction will
be Semenglish, then the command would be:
{! saying(semenglish) !}
However it is well to note
that the sailorServer starts each page defaulted to saying 'html'.
Or from a query:
http://host:port/?saying=semenglish&at=Seth&say=node
Note that the sailorServer will send the designated query back in the language
specified prior to serving the designated page. In the case above, there
is no application page specified; so the node named 'Seth' will be returned
in the language semenglish.
Or from a python script:
me.saying('rdf') Where me is the name of your
sailor instance.
Note that by convention all
grammar names are lower case.
Reading:
me.read('Url')
Or from a html form:
<form>
<input type="hidden" name="reading" value="rdf">
<input type="text" name="read" size="90" maxlength="255" value="">
<input type="submit" value="read">
<input type="hidden" name="endReading" >
</form>
saying:
me.say('production')