Pentals (second rough draft)

Revised: 5/28/2002 6PM PST  by Seth Russell

Abstract:

Pentals is a language designed to be easily read and written by both humans and automated agents. It is an an extension of  N-Triples. This means that every well formed N-Triple is also a well formed Pental.  Pentals extends N-triples by adding the optional attributes: context, sequence, and the dialogue performatives: ". ? !".   Names are allowed in the place of uriref; and they may be prefixed with namespaces. Compound names are supported.  

Authors:

Seth Russell  <mailto:seth@robustai.net>
Sean B. Palmer <mailto:sean@mysterylights.com>

EBNF definition of Pentals grammar:

1
pentalsDoc
::=
line*
2
line
::=
ws* (comment | pental) ? eoln
3
comment
::=
'#' (character - ( cr | lf ) )* 
4
pental ::=
subject ws+ predicateSlot ws+ object ws+ ((context | ',') seq?)? terminal? ws*  
5
context
::=
name | nodeID |  compoundName
6
subject
::=
name | nodeID |  compoundName
7
predicateSlot
::=
name | compoundName
8
object
::=
name | compoundName | literal
9
seq
::=
realNumber
10
terminal
::=
'.' | '?' | '!'
11
uriref
::=
'<' absoluteURIref '>'  
12
compoundName ::=
'(' ws* name (ws+ name)+ ws* ')'
13
name
::=
uriref | nameToken | namespacePrefix ':' nameToken
14
namespacePrefix
::=
namespacePrefix ::= [A-Za-z][A-Za-z0-9_]*
15
nodeID ::=
'_:' nameToken
16
literal
::=
langstring | xmlString
17
langString
::=
'"' string '"' ('-' language)?
18
xmlString
::=
'xml' langString
19
language
::=
( character - ( '.' | ws ) )+
and containing any allowed xml:lang content as defined in
http://www.w3.org/TR/REC-xml#sec-lang-tag
20
ws
::=
space | tab  
21
eoln
::=
cr | lf | cr lf  
22
space
::=
#x20 /* US-ASCII space - decimal 32 */  
23
cr
::=
#xD /* US-ASCII carriage return - decimal 13 */  
24
lf
::=
#xA /* US-ASCII linefeed - decimal 10 */  
25
tab
::=
#x9 /* US-ASCII horizontal tab - decimal 9 */  
26
string ::=
character* with escapes. Defined in section Strings  
27
nameToken
::=
 [A-Za-z0-9_]+
28
realNumber
::=
[0-9]+  ('.' [0-9]+)?
29
absoluteURIref
::=
defined in section URI References  also see #rdfig discussion
30
character
::=
[#x20-#x7E] /* US-ASCII space to decimal 127 */

Implementations:

A parser for this grammar has been implemented as the python function parsePentals(string) in the module seagent.py.

Examples:

1
SethBot ownedBy Seth.
......mentograph here.....................................
2
<http://


References:

    N-Triples <http://www.w3.org/TR/rdf-testcases/#ntrip_grammar>
    EBNF <http://www.w3.org/TR/REC-xml#sec-notation>
    SEAGENT <http://robustai.net/mentography/seagent.py>