pretty
index
/Users/yosi/CVSROOT/WWW/2000/10/swap/pretty.py

$Id: pretty.py,v 1.40 2007/06/26 02:36:15 syosi Exp $
 
Printing of N3 and RDF formulae
 
20003-8-20 split offf from llyn.py
 
This is or was http://www.w3.org/2000/10/swap/pretty.py

 
Modules
       
diag
string
types

 
Classes
       
exceptions.Exception
TooMuchRecursion
Serializer

 
class Serializer
    A serializer to serialize the formula F into the given
abstract syntax sink
 
  Methods defined here:
__init__(self, F, sink, flags='', sorting=0)
dumpBySubject(self, sorting=1)
Dump one formula only by order of subject except
forSome's first for n3=a mode
dumpChronological(self)
Fast as possible. Only dumps data. No formulae or universals.
dumpFormulaContents(self, context, sink, sorting, equals=0)
Iterates over statements in formula, bunching them up into a set
for each subject.
dumpLists(self)
Dump lists out as first and rest. Not used in pretty.
dumpNested(self)
Iterates over all URIs ever seen looking for statements
dumpPrefixes(self)
dumpStatement(self, sink, triple, sorting)
Dump one statement, including structure within object
dumpVariables(self, context, sink, sorting=1, pretty=0, dataOnly=0)
Dump the forAlls and the forSomes at the top of a formula
selectDefaultPrefix(self, printFunction)
Symbol whose fragments have the most occurrences.
we suppress the RDF namespace itself because the XML syntax
has problems with it being default as it is used for attributes.
 
This also outputs the prefixes.
tmDumpNested(self)

 
class TooMuchRecursion(exceptions.Exception)
     Methods inherited from exceptions.Exception:
__getitem__(...)
__init__(...)
__str__(...)

 
Functions
       
auPair(x)
Encode as object-free form for unparser interface
auxPairs(t)
canItbeABNode(formula, symbol)

 
Data
        ALL4 = (0, 1, 2, 3)
ANONYMOUS = 3
BNodePossibles = None
CONTEXT = 0
DAML_sameAs_URI = 'http://www.w3.org/2002/07/owl#sameAs'
FLOAT_DATATYPE = 'http://www.w3.org/2001/XMLSchema#double'
INTEGER_DATATYPE = 'http://www.w3.org/2001/XMLSchema#integer'
LITERAL = 2
LITERAL_DT = 21
LITERAL_LANG = 22
List_NS = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
Logic_NS = 'http://www.w3.org/2000/10/swap/log#'
META_NS_URI = 'http://www.w3.org/2000/10/swap/meta#'
N3_Empty = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#Empty')
N3_List = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#List')
N3_first = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first')
N3_nil = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil')
N3_rest = (0, 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest')
OBJ = 3
OWL_NS = 'http://www.w3.org/2002/07/owl#'
PARTS = (1, 2, 3)
PRED = 1
RDF_NS_URI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
RDF_type_URI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'
STRING_NS_URI = 'http://www.w3.org/2000/10/swap/string#'
SUBJ = 2
SYMBOL = 0
XMLLITERAL = 25
cvsRevision = '$Revision: 1.40 $'
forAllSym = 'http://www.w3.org/2000/10/swap/log#forAll'
forSomeSym = 'http://www.w3.org/2000/10/swap/log#forSome'
prefixchars = 'abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
tracking = 0