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

sparql2cwm
 
This is meant to be used with a sparql.n3 based SPARQL parser, to add the query to cwm
 
$Id: sparql2cwm.py,v 1.23 2007/06/26 02:36:15 syosi Exp $

 
Modules
       
diag
uripath

 
Classes
       
__builtin__.dict(__builtin__.object)
multimap
__builtin__.object
AST
Coerce
NotNot
RulesMaker
productionHandler
FilterExpr
FromSparql
__builtin__.tuple(__builtin__.object)
TripleHolder
andExtra
__builtin__.unicode(__builtin__.basestring)
typedThing

 
class AST(__builtin__.object)
     Methods defined here:
__init__(self, ast, sink=None)
abbr(self, prodURI)
onFinish(self)
onStart(self, prod)
onToken(self, prod, tok)
prod(self, thing)
run(self)

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'AST' objects>
list of weak references to the object (if defined)

 
class Coerce(__builtin__.object)
     Methods defined here:
__call__(self, expr, coerce=True)
__init__(self)
atom(self, p, coerce)
on_And(self, p, coerce)
on_BoolVal(self, p, coerce)
on_Boolean(self, p, coerce)
on_Bound(self, p, coerce)
on_Not(self, p, coerce)
on_Or(self, p, coerce)
on_Regex(self, p, coerce)
on_function(self, p, coerce)
on_isBlank(self, p, coerce)
on_isLiteral(self, p, coerce)
on_isURI(self, p, coerce)
on_math(self, p, coerce)
on_pred(self, p, coerce)

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Coerce' objects>
list of weak references to the object (if defined)

 
class FilterExpr(productionHandler)
    
Method resolution order:
FilterExpr
productionHandler
__builtin__.object

Methods defined here:
__init__(self, store, parent)
arithmetic(self, p, op)
compare(self, p, op)
on_And(self, p)
on_BoolVal(self, p)
on_Boolean(self, p)
on_Bound(self, var)
on_Literal(self, p)
on_Not(self, p)
on_Number(self, p)
on_Or(self, p)
on_Regex(self, p)
on_String(self, p)
on_Var(self, p)
on_add(self, p)
on_datatype(self, p)
on_divide(self, p)
on_equal(self, p)
on_funcName(self, p)
on_function(self, p)
on_greater(self, p)
on_isNotURI(self, p)
on_isURI(self, p)
on_lang(self, p)
on_less(self, p)
on_multiply(self, p)
on_notBound(self, var)
on_notEqual(self, p)
on_notGreater(self, p)
on_notLess(self, p)
on_subtract(self, p)
on_symbol(self, p)
typeConvert(self, keepGoing, uri, val)

Methods inherited from productionHandler:
prod(self, production)

Data and other attributes inherited from productionHandler:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'productionHandler' objects>
list of weak references to the object (if defined)

 
class FromSparql(productionHandler)
    
Method resolution order:
FromSparql
productionHandler
__builtin__.object

Methods defined here:
__init__(self, store, formula=None, ve=0, why=None)
absolutize(self, uri)
anonymize(self, formula, uri=None)
makePatterns(self, f, node, patterns)
new_bnode(self)
on_AdditiveExpression(self, p)
on_ArgList(self, p)
on_AskQuery(self, p)
on_BaseDecl(self, p)
on_BlankNode(self, p)
on_BlankNodePropertyList(self, p)
on_BooleanLiteral(self, p)
on_BrackettedExpression(self, p)
on_BuiltinCallExpression(self, p)
on_CallExpression(self, p)
on_Collection(self, p)
on_ConditionalAndExpression(self, p)
on_ConditionalOrExpression(self, p)
on_Constraint(self, p)
on_ConstructQuery(self, p)
on_ConstructTemplate(self, p)
on_DatasetClause(self, p)
on_DefaultGraphClause(self, p)
on_DescribeQuery(self, p)
on_Expression(self, p)
on_FunctionCall(self, p)
on_GraphGraphPattern(self, p)
on_GraphNode(self, p)
on_GraphPatternList(self, p)
on_GraphPatternListTail(self, p)
on_GraphPatternNotTriples(self, p)
on_GraphPatternNotTriplesList(self, p)
on_GraphPatternNotTriplesTail(self, p)
on_GraphTerm(self, p)
on_GroupGraphPattern(self, p, fromFilter=False)
on_GroupOrUnionGraphPattern(self, p)
on_IRIref(self, p)
on_IRIrefOrFunc(self, p)
on_LimitClause(self, p)
on_MultiplicativeExpression(self, p)
on_NamedGraphClause(self, p)
on_NamelessBlank(self, p)
on_NumericExpression(self, p)
on_NumericLiteral(self, p)
on_Object(self, p)
on_ObjectList(self, p)
on_OffsetClause(self, p)
on_OptionalGraphPattern(self, p)
on_OrderClause(self, p)
on_OrderCondition(self, p)
on_PrefixDecl(self, p)
on_PrimaryExpression(self, p)
on_Prolog(self, p)
on_PropertyList(self, p)
on_PropertyListNotEmpty(self, p)
on_QName(self, p)
on_Query(self, p)
on_RDFLiteral(self, p)
on_RDFTerm(self, p)
on_RDFTermOrFunc(self, p)
on_RegexExpression(self, p)
on_RelationalExpression(self, p)
on_SelectQuery(self, p)
on_SolutionModifier(self, p)
on_SourceSelector(self, p)
on_String(self, p)
on_Triples(self, p)
on_Triples1(self, p)
on_Triples2(self, p)
on_Triples3(self, p)
on_TriplesNode(self, p)
on_UnaryExpression(self, p)
on_ValueLogical(self, p)
on_Var(self, p)
on_VarOrBlankNodeOrIRIref(self, p)
on_VarOrIRIref(self, p)
on_VarOrTerm(self, p)
on_Verb(self, p)
on_WhereClause(self, p)
on__O_QAND_E____QValueLogical_E__C(self, p)
on__O_QASC_E__Or__QDESC_E__C(self, p)
on__O_QASC_E__Or__QDESC_E____QBrackettedExpression_E__C(self, p)
on__O_QBrackettedExpression_E__Or__QCallExpression_E__C(self, p)
see normalize for an explanation of what we are doing
on__O_QCOMMA_E____QExpression_E__C(self, p)
on__O_QCOMMA_E____QObjectList_E__C(self, p)
on__O_QDTYPE_E____QIRIref_E__C(self, p)
on__O_QDefaultGraphClause_E__Or__QNamedGraphClause_E__C(self, p)
on__O_QDot_E_Opt___QGraphPatternList_E__C(self, p)
on__O_QDot_E____QGraphPatternList_E__C(self, p)
on__O_QDot_E____QTriples_E_Opt_C(self, p)
on__O_QEQUAL_E____QNumericExpression_E__Or__QNEQUAL_E____QNumericExpression_E__Or__QLT_E____QNumericExpression_E__Or__QGT_E____QNumericExpression_E__Or__QLE_E____QNumericExpression_E__Or__QGE_E____QNumericExpression_E__C(self, p)
on__O_QExpression_E____QCOMMA_E____QExpression_E_Star_C(self, p)
on__O_QFunctionCall_E__Or__QVar_E__Or__QBrackettedExpression_E__C(self, p)
on__O_QLANGTAG_E__Or__QDTYPE_E____QIRIref_E__C(self, p)
on__O_QOR_E____QConditionalAndExpression_E__C(self, p)
on__O_QPLUS_E____QMultiplicativeExpression_E__Or__QMINUS_E____QMultiplicativeExpression_E__C(self, p)
on__O_QSEMI_E____QPropertyList_E__C(self, p)
on__O_QSelectQuery_E__Or__QConstructQuery_E__Or__QDescribeQuery_E__Or__QAskQuery_E__C(self, p)
on__O_QTIMES_E____QUnaryExpression_E__Or__QDIVIDE_E____QUnaryExpression_E__C(self, p)
on__O_QTriples1_E____QGraphPatternListTail_E__Or__QGraphPatternNotTriples_E____QGraphPatternNotTriplesTail_E__C(self, p)
on__O_QUNION_E____QGroupGraphPattern_E__C(self, p)
on__O_QVarOrIRIref_E_Plus_Or__QTIMES_E__C(self, p)
on__O_QVar_E_Plus_Or__QTIMES_E__C(self, p)
on__QArgList_E_Opt(self, p)
on__QBaseDecl_E_Opt(self, p)
on__QDISTINCT_E_Opt(self, p)
on__QDatasetClause_E_Star(self, p)
on__QDot_E_Opt(self, p)
on__QGraphNode_E_Plus(self, p)
on__QGraphNode_E_Star(self, p)
on__QLimitClause_E_Opt(self, p)
on__QOffsetClause_E_Opt(self, p)
on__QOrderClause_E_Opt(self, p)
on__QOrderCondition_E_Plus(self, p)
on__QPrefixDecl_E_Star(self, p)
on__QPropertyListNotEmpty_E_Opt(self, p)
on__QTriples_E_Opt(self, p)
on__QVarOrIRIref_E_Plus(self, p)
on__QVar_E_Plus(self, p)
on__QWHERE_E_Opt(self, p)
on__QWhereClause_E_Opt(self, p)
on__Q_O_QAND_E____QValueLogical_E__C_E_Star(self, p)
on__Q_O_QCOMMA_E____QExpression_E__C_E_Opt(self, p)
on__Q_O_QCOMMA_E____QExpression_E__C_E_Star(self, p)
on__Q_O_QCOMMA_E____QObjectList_E__C_E_Opt(self, p)
on__Q_O_QDot_E____QGraphPatternList_E__C_E_Opt(self, p)
on__Q_O_QDot_E____QTriples_E_Opt_C_E_Opt(self, p)
on__Q_O_QEQUAL_E____QNumericExpression_E__Or__QNEQUAL_E____QNumericExpression_E__Or__QLT_E____QNumericExpression_E__Or__QGT_E____QNumericExpression_E__Or__QLE_E____QNumericExpression_E__Or__QGE_E____QNumericExpression_E__C_E_Opt(self, p)
on__Q_O_QExpression_E____QCOMMA_E____QExpression_E_Star_C_E_Opt(self, p)
on__Q_O_QLANGTAG_E__Or__QDTYPE_E____QIRIref_E__C_E_Opt(self, p)
on__Q_O_QOR_E____QConditionalAndExpression_E__C_E_Star(self, p)
on__Q_O_QPLUS_E____QMultiplicativeExpression_E__Or__QMINUS_E____QMultiplicativeExpression_E__C_E_Star(self, p)
on__Q_O_QSEMI_E____QPropertyList_E__C_E_Opt(self, p)
on__Q_O_QTIMES_E____QUnaryExpression_E__Or__QDIVIDE_E____QUnaryExpression_E__C_E_Star(self, p)
on__Q_O_QTriples1_E____QGraphPatternListTail_E__Or__QGraphPatternNotTriples_E____QGraphPatternNotTriplesTail_E__C_E_Opt(self, p)
on__Q_O_QUNION_E____QGroupGraphPattern_E__C_E_Star(self, p)

Methods inherited from productionHandler:
prod(self, production)

Data and other attributes inherited from productionHandler:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'productionHandler' objects>
list of weak references to the object (if defined)

 
class NotNot(__builtin__.object)
    This class is used to figure out the inverses of all SPARQL boolean tests, and invert all functions
 
  Methods defined here:
__call__(self, expr, inv=False, Ored=False)
__init__(self)
atom(self, p, inv, ored)
expr(self, p, inv, ored)
on_And(self, p, inv, ored)
on_BoolVal(self, p, inv, ored)
on_Not(self, p, inv, ored)
on_Or(self, p, inv, ored)
on_Regex(self, p, inv, ored)
on_notMatches(self, p, inv)

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'NotNot' objects>
list of weak references to the object (if defined)
inverse_operators = {'Bound': 'notBound', 'equal': 'notEqual', 'greater': 'notGreater', 'isBlank': 'isNotBlank', 'isLiteral': 'isNotLiteral', 'isNotBlank': 'isBlank', 'isNotLiteral': 'isLiteral', 'isNotURI': 'isURI', 'isURI': 'isNotURI', 'less': 'notLess', ...}

 
class RulesMaker(__builtin__.object)
     Methods defined here:
__init__(self, ns)
find_vars(self, vars, f)
implications(self, query, formula, totalResult)
matching_subformula(self, retF, illegals, F)

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'RulesMaker' objects>
list of weak references to the object (if defined)

 
class TripleHolder(__builtin__.tuple)
    
Method resolution order:
TripleHolder
__builtin__.tuple
__builtin__.object

Static methods defined here:
__new__(cls, *args, **keywords)

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)

Methods inherited from __builtin__.tuple:
__add__(...)
x.__add__(y) <==> x+y
__contains__(...)
x.__contains__(y) <==> y in x
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getnewargs__(...)
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)
__rmul__(...)
x.__rmul__(n) <==> n*x

 
class andExtra(__builtin__.tuple)
    
Method resolution order:
andExtra
__builtin__.tuple
__builtin__.object

Methods defined here:
__repr__(self)

Static methods defined here:
__new__(cls, val, extra)

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)

Methods inherited from __builtin__.tuple:
__add__(...)
x.__add__(y) <==> x+y
__contains__(...)
x.__contains__(y) <==> y in x
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getnewargs__(...)
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__rmul__(...)
x.__rmul__(n) <==> n*x

 
class multimap(__builtin__.dict)
    A class to handle where each element maps to a set of elements
 
It would perhaps be simpler to have used dict.setdefault(), but this has the
advantage of merging instead of nesting sets
 
 
Method resolution order:
multimap
__builtin__.dict
__builtin__.object

Methods defined here:
__add__(self, other)
__init__(self, olddict={}, **values)
__setitem__(self, key, value)
translate(self, fromkey, tokey)
update(self, other={}, **values)

Class methods defined here:
fromTuples = _fromTuples(cls, iterator) from __builtin__.type

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'multimap' objects>
list of weak references to the object (if defined)
innerSet = <class 'sparql2cwm.innerSet'>

Methods inherited from __builtin__.dict:
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__contains__(...)
D.__contains__(k) -> True if D has a key k, else False
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)
clear(...)
D.clear() -> None.  Remove all items from D.
copy(...)
D.copy() -> a shallow copy of D
get(...)
D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.
has_key(...)
D.has_key(k) -> True if D has a key k, else False
items(...)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(...)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(...)
D.iterkeys() -> an iterator over the keys of D
itervalues(...)
D.itervalues() -> an iterator over the values of D
keys(...)
D.keys() -> list of D's keys
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value
If key is not found, d is returned if given, otherwise KeyError is raised
popitem(...)
D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
values(...)
D.values() -> list of D's values

Data and other attributes inherited from __builtin__.dict:
__new__ = <built-in method __new__ of type object at 0xfde34>
T.__new__(S, ...) -> a new object with type S, a subtype of T
fromkeys = <built-in method fromkeys of type object>
dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.

 
class productionHandler(__builtin__.object)
     Methods defined here:
prod(self, production)

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'productionHandler' objects>
list of weak references to the object (if defined)

 
class typedThing(__builtin__.unicode)
    
Method resolution order:
typedThing
__builtin__.unicode
__builtin__.basestring
__builtin__.object

Methods defined here:
__call__(self)

Static methods defined here:
__new__(cls, val, retType=None, ArgTypes=[], trueOnError=False)

Data and other attributes defined here:
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'typedThing' objects>
list of weak references to the object (if defined)

Methods inherited from __builtin__.unicode:
__add__(...)
x.__add__(y) <==> x+y
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__contains__(...)
x.__contains__(y) <==> y in x
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getnewargs__(...)
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__hash__(...)
x.__hash__() <==> hash(x)
__len__(...)
x.__len__() <==> len(x)
__mod__(...)
x.__mod__(y) <==> x%y
__mul__(...)
x.__mul__(n) <==> x*n
__repr__(...)
x.__repr__() <==> repr(x)
__rmod__(...)
x.__rmod__(y) <==> y%x
__rmul__(...)
x.__rmul__(n) <==> n*x
__str__(...)
x.__str__() <==> str(x)
capitalize(...)
S.capitalize() -> unicode
 
Return a capitalized version of S, i.e. make the first character
have upper case.
center(...)
S.center(width[, fillchar]) -> unicode
 
Return S centered in a Unicode string of length width. Padding is
done using the specified fill character (default is a space)
count(...)
S.count(sub[, start[, end]]) -> int
 
Return the number of occurrences of substring sub in Unicode string
S[start:end].  Optional arguments start and end are
interpreted as in slice notation.
decode(...)
S.decode([encoding[,errors]]) -> string or unicode
 
Decodes S using the codec registered for encoding. encoding defaults
to the default encoding. errors may be given to set a different error
handling scheme. Default is 'strict' meaning that encoding errors raise
a UnicodeDecodeError. Other possible values are 'ignore' and 'replace'
as well as any other name registerd with codecs.register_error that is
able to handle UnicodeDecodeErrors.
encode(...)
S.encode([encoding[,errors]]) -> string or unicode
 
Encodes S using the codec registered for encoding. encoding defaults
to the default encoding. errors may be given to set a different error
handling scheme. Default is 'strict' meaning that encoding errors raise
a UnicodeEncodeError. Other possible values are 'ignore', 'replace' and
'xmlcharrefreplace' as well as any other name registered with
codecs.register_error that can handle UnicodeEncodeErrors.
endswith(...)
S.endswith(suffix[, start[, end]]) -> bool
 
Return True if S ends with the specified suffix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
expandtabs(...)
S.expandtabs([tabsize]) -> unicode
 
Return a copy of S where all tab characters are expanded using spaces.
If tabsize is not given, a tab size of 8 characters is assumed.
find(...)
S.find(sub [,start [,end]]) -> int
 
Return the lowest index in S where substring sub is found,
such that sub is contained within s[start,end].  Optional
arguments start and end are interpreted as in slice notation.
 
Return -1 on failure.
index(...)
S.index(sub [,start [,end]]) -> int
 
Like S.find() but raise ValueError when the substring is not found.
isalnum(...)
S.isalnum() -> bool
 
Return True if all characters in S are alphanumeric
and there is at least one character in S, False otherwise.
isalpha(...)
S.isalpha() -> bool
 
Return True if all characters in S are alphabetic
and there is at least one character in S, False otherwise.
isdecimal(...)
S.isdecimal() -> bool
 
Return True if there are only decimal characters in S,
False otherwise.
isdigit(...)
S.isdigit() -> bool
 
Return True if all characters in S are digits
and there is at least one character in S, False otherwise.
islower(...)
S.islower() -> bool
 
Return True if all cased characters in S are lowercase and there is
at least one cased character in S, False otherwise.
isnumeric(...)
S.isnumeric() -> bool
 
Return True if there are only numeric characters in S,
False otherwise.
isspace(...)
S.isspace() -> bool
 
Return True if all characters in S are whitespace
and there is at least one character in S, False otherwise.
istitle(...)
S.istitle() -> bool
 
Return True if S is a titlecased string and there is at least one
character in S, i.e. upper- and titlecase characters may only
follow uncased characters and lowercase characters only cased ones.
Return False otherwise.
isupper(...)
S.isupper() -> bool
 
Return True if all cased characters in S are uppercase and there is
at least one cased character in S, False otherwise.
join(...)
S.join(sequence) -> unicode
 
Return a string which is the concatenation of the strings in the
sequence.  The separator between elements is S.
ljust(...)
S.ljust(width[, fillchar]) -> int
 
Return S left justified in a Unicode string of length width. Padding is
done using the specified fill character (default is a space).
lower(...)
S.lower() -> unicode
 
Return a copy of the string S converted to lowercase.
lstrip(...)
S.lstrip([chars]) -> unicode
 
Return a copy of the string S with leading whitespace removed.
If chars is given and not None, remove characters in chars instead.
If chars is a str, it will be converted to unicode before stripping
replace(...)
S.replace (old, new[, maxsplit]) -> unicode
 
Return a copy of S with all occurrences of substring
old replaced by new.  If the optional argument maxsplit is
given, only the first maxsplit occurrences are replaced.
rfind(...)
S.rfind(sub [,start [,end]]) -> int
 
Return the highest index in S where substring sub is found,
such that sub is contained within s[start,end].  Optional
arguments start and end are interpreted as in slice notation.
 
Return -1 on failure.
rindex(...)
S.rindex(sub [,start [,end]]) -> int
 
Like S.rfind() but raise ValueError when the substring is not found.
rjust(...)
S.rjust(width[, fillchar]) -> unicode
 
Return S right justified in a Unicode string of length width. Padding is
done using the specified fill character (default is a space).
rsplit(...)
S.rsplit([sep [,maxsplit]]) -> list of strings
 
Return a list of the words in S, using sep as the
delimiter string, starting at the end of the string and
working to the front.  If maxsplit is given, at most maxsplit
splits are done. If sep is not specified, any whitespace string
is a separator.
rstrip(...)
S.rstrip([chars]) -> unicode
 
Return a copy of the string S with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
If chars is a str, it will be converted to unicode before stripping
split(...)
S.split([sep [,maxsplit]]) -> list of strings
 
Return a list of the words in S, using sep as the
delimiter string.  If maxsplit is given, at most maxsplit
splits are done. If sep is not specified or is None,
any whitespace string is a separator.
splitlines(...)
S.splitlines([keepends]]) -> list of strings
 
Return a list of the lines in S, breaking at line boundaries.
Line breaks are not included in the resulting list unless keepends
is given and true.
startswith(...)
S.startswith(prefix[, start[, end]]) -> bool
 
Return True if S starts with the specified prefix, False otherwise.
With optional start, test S beginning at that position.
With optional end, stop comparing S at that position.
strip(...)
S.strip([chars]) -> unicode
 
Return a copy of the string S with leading and trailing
whitespace removed.
If chars is given and not None, remove characters in chars instead.
If chars is a str, it will be converted to unicode before stripping
swapcase(...)
S.swapcase() -> unicode
 
Return a copy of S with uppercase characters converted to lowercase
and vice versa.
title(...)
S.title() -> unicode
 
Return a titlecased version of S, i.e. words start with title case
characters, all remaining cased characters have lower case.
translate(...)
S.translate(table) -> unicode
 
Return a copy of the string S, where all characters have been mapped
through the given translation table, which must be a mapping of
Unicode ordinals to Unicode ordinals, Unicode strings or None.
Unmapped characters are left untouched. Characters mapped to None
are deleted.
upper(...)
S.upper() -> unicode
 
Return a copy of S converted to uppercase.
zfill(...)
S.zfill(width) -> unicode
 
Pad a numeric string x with zeros on the left, to fill a field
of the specified width. The string x is never truncated.

 
Functions
       
abbr(prodURI)
getExtra(ex)
getTrueOnError(ex)
getType(ex)
intConvert(self, keepGoing, val)
makeSafeVal(val, (subj, pred, obj), safeVersion=False)
makeTriple(subj, pred, obj, safeVersion=False)
makeTripleObjList(subj, pred, obj)
normalize(expr)
The mapping from SPARQL syntax to n3 is decidedly nontrivial
at this point, we have done the first step, building an AST that is (relatively) independant of all of the oddities that
you get from the grammar
 
Normalize does a couple of top down transforms on the tree. The first is a type determiner; it determines what
needs to be coerced to a boolean. The second does boolean logic and pushes ``not''s all the way in.
 
After normalize, the last bottom up step to generate the n3 can be done.
on_Boolean_Gen(true, false)
reason2 = value(self, newVal=None) method of __builtin__.list instance
sparqlLookup(uri, server, property)
unEscape(string)
value(self, newVal=None)
verbose = value(self, newVal=None) method of __builtin__.list instance

 
Data
        AND = u'And'
NOT = u'Not'
OR = u'Or'
ORED_AND = u'And'
ORED_NOT = u'Not'
SPARQL_NS = 'http://www.w3.org/2000/10/swap/sparqlCwm'
knownFunctions = {'http://www.w3.org/2001/XMLSchema#integer': <function intConvert>}