4Suite™ API Documentation

# ► Module Ft.Rdf.RdfsHandler

An RDF schema validator for statements in a Model
Copyright 2005 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/

Classes: RdfsConstraintViolation, RdfsHandler |  |  |  | Fields: RDFS_XML, RDF_MS_BASE, RDF_SCHEMA_BASE

## Classes

class RdfsConstraintViolation(Ft.FtException)

### Methods

__init__(self, errorCode, *args)

### Methods inherited from class Ft.FtException

__getattr__, __repr__, __str__

### Methods inherited from class exceptions.Exception

__getitem__

### Fields

INVALID_DOMAIN_FOR_PROPERTY = 2
INVALID_RANGE_FOR_PROPERTY = 3
PROPERTY_HAS_MULTIPLE_RANGES = 1

class RdfsHandler(Ft.Rdf.SchemaHandler)
Processing of RDF schema information on behalf of a model instance. Note that a RdfsHandler is designed to be associated with a single model in its lifecycle, which is basically: init -> initModel -> <user's schema operations> -> reclaim Do not attempt to reuse a RdfsHandler with multiple models unless you really know what you're doing

### Methods

__init__(self)
Initializer for a RdfsHandler. There are no parameters.
checkConstraints(self, newStmts)
Raises exception if constraint violation found, else returns normally Does not yet check Extended Constraints (provide hooks?)
initModel(self, model)
Make sure that the core schema statements are in the model
isCoreRdfs(self, stmt)
Checks whether a statement comes from the core RDF meta-model.
isInstance(self, obj, class_)
Checks whether a resource is an instance of a class. Note that this is also true if the resource is an instance of any subclass of the given class.
isSubClass(self, class1, class2)
Checks whether a class is an instance of another class.
processNewStatements(self, newStmts)
Called by the Mode when a new statement is about to be added.

### Methods inherited from class Ft.Rdf.SchemaHandler

add, contains, remove, resume, setActivity, suspend

## Fields

RDFS_XML = '<?xml version="1.0" encoding="utf-8"?>\n<rdf:RDF\n...f-schema-more"/>\n </rdf:Description>\n\n</rdf:RDF>'
RDF_MS_BASE = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'
RDF_SCHEMA_BASE = 'http://www.w3.org/2000/01/rdf-schema#'