4Suite™ API Documentation

# ► Module Ft.Rdf.Parsers.Versa

Classes: CompiletimeException, Constants, RuntimeException |  |  |  | Functions: Compile, CreateContext, Evaluate |  |  |  | Fields: RDF_MS_BASE, RDF_SCHEMA_BASE, RDF_SUBCLASSOF_PROP, RDF_SUBPROPOF_PROP, RDF_TYPE_PROP, VERSA_NS, g_extFunctions

## Modules

BooleanExpressions | Definition for the boolean expressions in versa
Context | Context that is passed around for the current evaluation
CoreFunctions | Core Versa functions
DataTypes | Data type checking, conversion and ordering for Versa
Literals | Definition of Literal Types
MessageSource | Versa error codes and messages
NamedExpressions | Versa variables WWW: http://4suite.org/4RDF e-mail: support@4suite.org
Optimizer | Support routines for Versa optimizations WWW: http://4suite.org/4XSLT e-mail: support@4suite.org
ResourceExpressions | Implementation and utilities for resource processing Versa
Traversal | the classes that perform traversal in Versa WWW: http://4suite.org e-mail: support@4suite.org
Util | Versa implementation utilities WWW: http://4suite.org/4RDF e-mail: support@4suite.org
Variables | Versa variables WWW: http://4suite.org/4RDF e-mail: support@4suite.org
VersaParserc |

## Classes

class CompiletimeException(Ft.FtException)

### Methods

__init__(self, errorCode, *args)

### Methods inherited from class Ft.FtException

__getattr__, __repr__, __str__

### Methods inherited from class exceptions.Exception

__getitem__

### Fields

INTERNAL = 1
PROCESSING = 3
SYNTAX = 2

class Constants

### Fields

SORT_ASCENDING = u'http://rdfinference.org/versa/0/2/sort/ascending'
SORT_DESCENDING = u'http://rdfinference.org/versa/0/2/sort/descending'
SORT_NUMBER = u'http://rdfinference.org/versa/0/2/sort/number'
SORT_STRING = u'http://rdfinference.org/versa/0/2/sort/string'
TRAVERSE_ANY = u'http://rdfinference.org/versa/0/2/traverse/any'
TRAVERSE_FWD = u'http://rdfinference.org/versa/0/2/traverse/forward'
TRAVERSE_INV = u'http://rdfinference.org/versa/0/2/traverse/inverse'
TRAVERSE_SIMPLE = u'http://rdfinference.org/versa/0/2/traverse/simple'
TRAVERSE_TRANS = u'http://rdfinference.org/versa/0/2/traverse/transitive'

class RuntimeException(Ft.FtException)

### Methods

__init__(self, errorCode, *args)

### Methods inherited from class Ft.FtException

__getattr__, __repr__, __str__

### Methods inherited from class exceptions.Exception

__getitem__

### Fields

INTERNAL = 1
NO_CONTEXT = 10
UNDEFINED_PREFIX = 101
UNDEFINED_VARIABLE = 100
WRONG_ARGUMENTS = 200

## Functions

Compile(expression)
Compile a Versa expression into a compilied object. You can then call evaluate on the object passing in a Context. See CreateContext
CreateContext(**kw)
Create a new context for processing, allowed params: model = an instance of an Ft.Rdf.Model.Model driver = an instance of Ft.Rdf.Drivers.* nsMapping = a dictionary that map prefix to namespace varBindings = a dictionary. keys are a tuple of (namepsace,localName) and values are any allowed data type
Evaluate(expression, **kw)
Creates a context for the expression. See Context.ContextFromKeyWord for a complete description Then Compiles and evaluates the expression

## Fields

RDF_MS_BASE = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
RDF_SCHEMA_BASE = 'http://www.w3.org/2000/01/rdf-schema#'
RDF_SUBCLASSOF_PROP = u'http://www.w3.org/2000/01/rdf-schema#subClassOf'
RDF_SUBPROPOF_PROP = u'http://www.w3.org/2000/01/rdf-schema#subPropertyOf'
RDF_TYPE_PROP = u'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'
VERSA_NS = 'http://rdfinference.org/versa/0/2/'
g_extFunctions = {}