4Suite™ API Documentation

# ► Module Ft.Rdf.Parsers.Versa.DataTypes

Data type checking, conversion and ordering for Versa
Copyright 2005 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/

Classes: NumberFunction, Resource, Set, StringFunction |  |  |  | Functions: Cmp, CmpBoolean, CmpList, CmpNumber, CmpResource, CmpSet, CmpString, IsBoolean, IsList, IsNumber, IsResource, IsSet, IsString, SyncType, ToBoolean, ToList, ToNumber, ToResource, ToSet, ToString |  |  |  | Fields: OBJECT_TYPE_RESOURCE, OBJECT_TYPE_UNKNOWN

## Classes

class NumberFunction
Create a new number

### Methods

__init__(self, args)
evaluate(self, con)

class Resource(__builtin__.unicode)

### Methods

__init__(self, s)

### Methods inherited from class __builtin__.unicode

__add__, __cmp__, __contains__, __getattribute__, __getitem__, __getnewargs__, __getslice__, __hash__, __len__, __mod__, __mul__, __new__, __repr__, __rmod__, __rmul__, __str__, capitalize, center, count, decode, encode, endswith, expandtabs, find, index, isalnum, isalpha, isdecimal, isdigit, islower, isnumeric, isspace, istitle, isupper, join, ljust, lower, lstrip, replace, rfind, rindex, rjust, rsplit, rstrip, split, splitlines, startswith, strip, swapcase, title, translate, upper, zfill

### Methods inherited from class __builtin__.object

__delattr__, __reduce__, __reduce_ex__, __setattr__

### Fields

__dict__ = <attribute '__dict__' of 'Resource' objects>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'Resource' objects>
list of weak references to the object (if defined)

### Fields

class Set
#FIXME: Implement more efficiently

### Methods

__add__(self, other)
#__get/set/delitem__ & __get/set/delslice__ are shaky ground without 2.2 iterators
__cmp__(self, other)
__hash__(self)
#FIXME: should be updated to match comparison rules
__init__(self, l=None)
__len__(self)
__radd__ = __add__(self, other)
#__get/set/delitem__ & __get/set/delslice__ are shaky ground without 2.2 iterators
__repr__(self)
append(self, item)
remove(self, item)

class StringFunction
Create a new string

### Methods

__init__(self, args)
evaluate(self, con)

## Functions

Cmp(a, b)
CmpBoolean(a, b)
CmpList(a, b)
CmpNumber(a, b)
CmpResource = CmpString(a, b)
CmpSet(a, b)
CmpString(a, b)
IsBoolean = lambda(x)
IsList = lambda(x)
IsNumber = lambda(x)
IsResource = lambda(x)
IsSet = lambda(x)
IsString = lambda(x)
SyncType(testObject, obj)
ToBoolean(obj)
Convert to boolean
ToList(obj)
Convert to list
ToNumber(obj)
Convert to number
ToResource(obj)
Convert to resource
ToSet(obj)
Convert to set
ToString(obj)
Convert to string 1. If it is a string, then return 2. If it is a number then convert to a string 3. If it is a boolean, then convert to true or false 4. If a list or set, the coerce the first item. If empty ''

## Fields

OBJECT_TYPE_RESOURCE = 'R'
OBJECT_TYPE_UNKNOWN = '?'