4Suite API Documentation

Module Ft.Server.Server.Xslt.Model

XSLT and XPath extensions supporting the 4Suite RDF API
Copyright 2004 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/
Classes:
Functions:
Globals:

Classes

class DeserializeAndAddElement(Ft.Xml.Xslt.cStylesheetTree.XsltElement)
Deserializes an RDF document into statements, and adds them to a scope
The content of the frdf:deserialize-and-add element is a template for the
RDF/XML source from which the statements are parsed.

Methods

instantiate(self, context, processor)
Overrides: instantiate from class XsltElement

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

__getstate__, __init__, __iter__, __new__, __repr__, __setstate__, appendChild, insertChild, processChildren, removeChild, replaceChild, setAttribute

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

__reduce__, idle, isLastChild, pprint, prime, setup

Methods inherited from class object

__delattr__, __getattribute__, __hash__, __reduce_ex__, __setattr__, __str__

Members

__dict__ = <attribute '__dict__' of 'DeserializeAndAddElement' objects>
__weakref__ = <attribute '__weakref__' of 'DeserializeAndAddElement' objects>
content = <ContentModel object>
legalAttrs = {'base-path': <Ft.Xml.Xslt.AttributeInfo.UriReferenceAvt instance>, 'path': <Ft.Xml.Xslt.AttributeInfo.UriReferenceAvt instance>}

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

attributes, baseUri, children, columnNumber, expandedName, importIndex, lineNumber, namespaces, nodeName, prefix

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

doesIdle, doesPrime, doesSetup, isPseudoNode, parent, root

Members inherited from class object

__class__
class DeserializeAndRemoveElement(Ft.Xml.Xslt.cStylesheetTree.XsltElement)
Deserializes an RDF document into statements, and removes any statements in the given scope with matching triple values.
The content of the frdf:deserialize-and-remove element is a template for
the RDF/XML source from which the statements are parsed.

Methods

instantiate(self, context, processor)
Overrides: instantiate from class XsltElement

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

__getstate__, __init__, __iter__, __new__, __repr__, __setstate__, appendChild, insertChild, processChildren, removeChild, replaceChild, setAttribute

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

__reduce__, idle, isLastChild, pprint, prime, setup

Methods inherited from class object

__delattr__, __getattribute__, __hash__, __reduce_ex__, __setattr__, __str__

Members

__dict__ = <attribute '__dict__' of 'DeserializeAndRemoveElement' objects>
__weakref__ = <attribute '__weakref__' of 'DeserializeAndRemoveElement' objects>
content = <ContentModel object>
legalAttrs = {'base-path': <Ft.Xml.Xslt.AttributeInfo.UriReferenceAvt instance>, 'path': <Ft.Xml.Xslt.AttributeInfo.UriReferenceAvt instance>}

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

attributes, baseUri, children, columnNumber, expandedName, importIndex, lineNumber, namespaces, nodeName, prefix

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

doesIdle, doesPrime, doesSetup, isPseudoNode, parent, root

Members inherited from class object

__class__
class RdfAddElement(RdfBaseElement)
Adds statements to the repository model. The subject, predicates and objects can be strings or node sets node sets are converted to a list of strings by taking the string value of each item. String values are treated a list with one string. The cartesian product of statements that come from the list of subject, predicate and object strings are all added to the model using the given scope and statement URI.

Methods

instantiate(self, context, processor)
Overrides: instantiate from class RdfBaseElement

Methods inherited from class RdfBaseElement

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

__getstate__, __init__, __iter__, __new__, __repr__, __setstate__, appendChild, insertChild, processChildren, removeChild, replaceChild, setAttribute

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

__reduce__, idle, isLastChild, pprint, prime, setup

Methods inherited from class object

__delattr__, __getattribute__, __hash__, __reduce_ex__, __setattr__, __str__

Members inherited from class RdfBaseElement

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

attributes, baseUri, children, columnNumber, expandedName, importIndex, lineNumber, namespaces, nodeName, prefix

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

doesIdle, doesPrime, doesSetup, isPseudoNode, parent, root

Members inherited from class object

__class__
class RdfBaseElement(Ft.Xml.Xslt.cStylesheetTree.XsltElement)

Methods

getStatementInfo(self, context)

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

__getstate__, __init__, __iter__, __new__, __repr__, __setstate__, appendChild, insertChild, instantiate, processChildren, removeChild, replaceChild, setAttribute

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

__reduce__, idle, isLastChild, pprint, prime, setup

Methods inherited from class object

__delattr__, __getattribute__, __hash__, __reduce_ex__, __setattr__, __str__

Members

__dict__ = <attribute '__dict__' of 'RdfBaseElement' objects>
__weakref__ = <attribute '__weakref__' of 'RdfBaseElement' objects>
content = <ContentModel object>
legalAttrs = {'o': <Ft.Xml.Xslt.AttributeInfo.Expression instance>, 'p': <Ft.Xml.Xslt.AttributeInfo.Expression instance>, 's': <Ft.Xml.Xslt.AttributeInfo.Expression instance>, 'scope': <Ft.Xml.Xslt.AttributeInfo.StringExpression instance>, 'stmt-uri': <Ft.Xml.Xslt.AttributeInfo.StringExpression instance>, 'type': <Ft.Xml.Xslt.AttributeInfo.Expression instance>}

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

attributes, baseUri, children, columnNumber, expandedName, importIndex, lineNumber, namespaces, nodeName, prefix

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

doesIdle, doesPrime, doesSetup, isPseudoNode, parent, root

Members inherited from class object

__class__
class RdfCompleteElement(RdfPatternBaseElement)

Methods

instantiate(self, context, processor)
Overrides: instantiate from class RdfPatternBaseElement

Methods inherited from class RdfPatternBaseElement

Methods inherited from class RdfBaseElement

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

__getstate__, __init__, __iter__, __new__, __repr__, __setstate__, appendChild, insertChild, processChildren, removeChild, replaceChild, setAttribute

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

__reduce__, idle, isLastChild, pprint, prime, setup

Methods inherited from class object

__delattr__, __getattribute__, __hash__, __reduce_ex__, __setattr__, __str__

Members inherited from class RdfPatternBaseElement

Members inherited from class RdfBaseElement

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

attributes, baseUri, children, columnNumber, expandedName, importIndex, lineNumber, namespaces, nodeName, prefix

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

doesIdle, doesPrime, doesSetup, isPseudoNode, parent, root

Members inherited from class object

__class__
class RdfPatternBaseElement(RdfBaseElement)

Methods

getRdfPatternCriteria(self, context)

Methods inherited from class RdfBaseElement

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

__getstate__, __init__, __iter__, __new__, __repr__, __setstate__, appendChild, insertChild, instantiate, processChildren, removeChild, replaceChild, setAttribute

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

__reduce__, idle, isLastChild, pprint, prime, setup

Methods inherited from class object

__delattr__, __getattribute__, __hash__, __reduce_ex__, __setattr__, __str__

Members

legalAttrs = {'o': <Ft.Xml.Xslt.AttributeInfo.Expression instance>, 'o-flags': <Ft.Xml.Xslt.AttributeInfo.ChoiceAvt instance>, 'p': <Ft.Xml.Xslt.AttributeInfo.Expression instance>, 'p-flags': <Ft.Xml.Xslt.AttributeInfo.ChoiceAvt instance>, 's': <Ft.Xml.Xslt.AttributeInfo.Expression instance>, 's-flags': <Ft.Xml.Xslt.AttributeInfo.ChoiceAvt instance>, 'scope': <Ft.Xml.Xslt.AttributeInfo.StringExpression instance>, 'scope-flags': <Ft.Xml.Xslt.AttributeInfo.ChoiceAvt instance>, 'stmt-uri': <Ft.Xml.Xslt.AttributeInfo.StringExpression instance>, 'stmt-uri-flags': <Ft.Xml.Xslt.AttributeInfo.ChoiceAvt instance>, ...}

Members inherited from class RdfBaseElement

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

attributes, baseUri, children, columnNumber, expandedName, importIndex, lineNumber, namespaces, nodeName, prefix

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

doesIdle, doesPrime, doesSetup, isPseudoNode, parent, root

Members inherited from class object

__class__
class RdfRemoveElement(RdfPatternBaseElement)
Removes statements to the repository model. The subject, predicates and objects can be strings or node sets node sets are converted to a list of strings by taking the string value of each item. String values are treated a list with one string. The cartesian product of statements that come from the list of subject, predicate and object strings and that match the given scope and statement URI are all removed from the model.

Methods

instantiate(self, context, processor)
Overrides: instantiate from class RdfPatternBaseElement

Methods inherited from class RdfPatternBaseElement

Methods inherited from class RdfBaseElement

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

__getstate__, __init__, __iter__, __new__, __repr__, __setstate__, appendChild, insertChild, processChildren, removeChild, replaceChild, setAttribute

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

__reduce__, idle, isLastChild, pprint, prime, setup

Methods inherited from class object

__delattr__, __getattribute__, __hash__, __reduce_ex__, __setattr__, __str__

Members inherited from class RdfPatternBaseElement

Members inherited from class RdfBaseElement

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

attributes, baseUri, children, columnNumber, expandedName, importIndex, lineNumber, namespaces, nodeName, prefix

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

doesIdle, doesPrime, doesSetup, isPseudoNode, parent, root

Members inherited from class object

__class__
class RdfVersaAssignElement(Ft.Xml.Xslt.cStylesheetTree.XsltElement)
Execute a Versa query and assign the result to a Versa variable, for use in further queries. The variable becomes bound in the Versa context for the current stylesheet invokation, and thus will be defined on all Versa queries performed subsequently, through <frdf:versa-query> or <frdf:versa-assign>.
The content of the frdf:versa-assign element is a template for the
extra namespace mappings for the query (see /ftss/dashboard/NsMappings.xml
for an example of the xml format).

For example, if you have the following:

<frdf:versa-assign query="type(rdfs:Class)" name="classes"/>

You can later execute

<frdf:versa-query query="$classes - rdfs:label -> *"/>

Methods

instantiate(self, context, processor)
Overrides: instantiate from class XsltElement

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

__getstate__, __init__, __iter__, __new__, __repr__, __setstate__, appendChild, insertChild, processChildren, removeChild, replaceChild, setAttribute

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

__reduce__, idle, isLastChild, pprint, prime, setup

Methods inherited from class object

__delattr__, __getattribute__, __hash__, __reduce_ex__, __setattr__, __str__

Members

__dict__ = <attribute '__dict__' of 'RdfVersaAssignElement' objects>
__weakref__ = <attribute '__weakref__' of 'RdfVersaAssignElement' objects>
content = <ContentModel object>
legalAttrs = {'name': <Ft.Xml.Xslt.AttributeInfo.QNameAvt instance>, 'query': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>, 'scope': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>}

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

attributes, baseUri, children, columnNumber, expandedName, importIndex, lineNumber, namespaces, nodeName, prefix

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

doesIdle, doesPrime, doesSetup, isPseudoNode, parent, root

Members inherited from class object

__class__
class RdfVersaQueryElement(Ft.Xml.Xslt.cStylesheetTree.XsltElement)
Execute a Versa query and put the results in serialized XML form to the XSLT processor output.
The content of the frdf:versa-query element is a template for the
extra namespace mappings for the query (see /ftss/dashboard/NsMappings.xml
for an example of the xml format).

The form of the Versa output is as documented in
http://rdfinference.org/versa-xml.

Methods

instantiate(self, context, processor)
Overrides: instantiate from class XsltElement

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

__getstate__, __init__, __iter__, __new__, __repr__, __setstate__, appendChild, insertChild, processChildren, removeChild, replaceChild, setAttribute

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

__reduce__, idle, isLastChild, pprint, prime, setup

Methods inherited from class object

__delattr__, __getattribute__, __hash__, __reduce_ex__, __setattr__, __str__

Members

__dict__ = <attribute '__dict__' of 'RdfVersaQueryElement' objects>
__weakref__ = <attribute '__weakref__' of 'RdfVersaQueryElement' objects>
content = <ContentModel object>
legalAttrs = {'query': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>, 'scope': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>}

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

attributes, baseUri, children, columnNumber, expandedName, importIndex, lineNumber, namespaces, nodeName, prefix

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

doesIdle, doesPrime, doesSetup, isPseudoNode, parent, root

Members inherited from class object

__class__
class RdfVisualizeElement(Ft.Xml.Xslt.cStylesheetTree.XsltElement)
This extension element uses GraphViz to generate a diagram of a given resource, a set of resources in a particular scope, or of the entire system model. It adds an HTML imagemap (a chunk of text that can be placed in a MAP element) to the result tree, and has the side effect of generating in the repository an SVG or JPEG image resource representing the corresponding diagram.
output-path specifies the repo path of the diagram to generate. If the
resource exists already, its content will be overwritten.

If provided, resourcePath must to refer to either a specific resource in
the system model or an RDF document in the repository. If it refers to an
RDF document, then all RDF statements with that document's URI as their
scope will be graphed. If the resourcePath refers to any other kind of
resource, then only statements about it will be graphed. If no
resourcePath is specified, then the entire system model will be graphed.

The image map text placed in the result tree uses the uriFormat string
to generate (by appying the uris of all resources against this string)
the links for all resources in the image. imagemap information is
generated and returned only if the uriFormat string is specified.

Most RDF graphs are width heavy and the visualizer can be told to rotate
the image 90 degrees which can be helpful far larger graphs (which could
great widths).  This is specified by the rotate attribute. If present,
the graph is rotated, otherwise it isn't.

The max-arcs attribute specifies the maximum number of arcs. If the graph
requires more arcs, then nothing will be generated at all.

This element can also take a versa query result as its child nodes. In
this case, all the resources in the result are graphed and resource-path
is ignored.

Methods

instantiate(self, context, processor)
Overrides: instantiate from class XsltElement

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

__getstate__, __init__, __iter__, __new__, __repr__, __setstate__, appendChild, insertChild, processChildren, removeChild, replaceChild, setAttribute

Methods inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

__reduce__, idle, isLastChild, pprint, prime, setup

Methods inherited from class object

__delattr__, __getattribute__, __hash__, __reduce_ex__, __setattr__, __str__

Members

__dict__ = <attribute '__dict__' of 'RdfVisualizeElement' objects>
__weakref__ = <attribute '__weakref__' of 'RdfVisualizeElement' objects>
content = <ContentModel object>
legalAttrs = {'graph-vis': <Ft.Xml.Xslt.AttributeInfo.UriReferenceAvt instance>, 'map-name': <Ft.Xml.Xslt.AttributeInfo.IdAvt instance>, 'max-arcs': <Ft.Xml.Xslt.AttributeInfo.NumberAvt instance>, 'namespaces': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>, 'output-path': <Ft.Xml.Xslt.AttributeInfo.UriReferenceAvt instance>, 'resourcePath': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>, 'rotate': <Ft.Xml.Xslt.AttributeInfo.YesNoAvt instance>, 'scoped': <Ft.Xml.Xslt.AttributeInfo.YesNoAvt instance>, 'svg': <Ft.Xml.Xslt.AttributeInfo.YesNoAvt instance>, 'uri-format': <Ft.Xml.Xslt.AttributeInfo.StringAvt instance>}

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltElement

attributes, baseUri, children, columnNumber, expandedName, importIndex, lineNumber, namespaces, nodeName, prefix

Members inherited from class Ft.Xml.Xslt.cStylesheetTree.XsltNode

doesIdle, doesPrime, doesSetup, isPseudoNode, parent, root

Members inherited from class object

__class__

Functions

RdfAny(context)
RdfComplete(context, subj, pred, obj=None)
Runs a complete on the repository model, which matches patterns among the triples in the model. You provide whichever of the subject, predicate and object you'd like to match, and use the frdf:any() function as a wildcard. The return value is a generated node set which has one or more "Statement" elements, each with 5 children: "Subject", "Predicate", "Object", "StatementUri", "Scope" which represent the respective components of the RDF statement.
for example:

frdf:complete("http://spam.com", frdf:any(), frdf:any())

would return all statements with "http://spam.com" as the subjects.
RdfContains(context, subj, pred, obj=None)
Runs a conatins on the repository model, which matches patterns among the triples in the model. You provide whichever of the subject, predicate and object you'd like to match, and use the frdf:any() function as a wildcard. The return value is a boolean indicating whether or not a matching statement exists.
RdfVersaQueryFunction(context, query, scope=None)
Perform a Versa Query as a function, return a node-set representing the outside list.
WriteVersaResults(processor, results)

Globals

CONTAINERS = [1]
DOCUMENT_DEFINITIONS = [9, 11]
DUMMY_MODEL = <RDF Resource at 1100527916: [URI: ]>
ExtElements = {('http://xmlns.4suite.org/4ss/rdf', 'add'): <class 'Ft.Server.Server.Xslt.Model.RdfAddElement'>, ('http://xmlns.4suite.org/4ss/rdf', 'complete'): <class 'Ft.Server.Server.Xslt.Model.RdfCompleteElement'>, ('http://xmlns.4suite.org/4ss/rdf', 'deserialize-and-add'): <class 'Ft.Server.Server.Xslt.Model.DeserializeAndAddElement'>, ('http://xmlns.4suite.org/4ss/rdf', 'deserialize-and-remove'): <class 'Ft.Server.Server.Xslt.Model.DeserializeAndRemoveElement'>, ('http://xmlns.4suite.org/4ss/rdf', 'remove'): <class 'Ft.Server.Server.Xslt.Model.RdfRemoveElement'>, ('http://xmlns.4suite.org/4ss/rdf', 'versa-assign'): <class 'Ft.Server.Server.Xslt.Model.RdfVersaAssignElement'>, ('http://xmlns.4suite.org/4ss/rdf', 'versa-query'): <class 'Ft.Server.Server.Xslt.Model.RdfVersaQueryElement'>, ('http://xmlns.4suite.org/4ss/rdf', 'visualize'): <class 'Ft.Server.Server.Xslt.Model.RdfVisualizeElement'>}
ExtFunctions = {('http://xmlns.4suite.org/4ss/rdf', 'any'): <function RdfAny>, ('http://xmlns.4suite.org/4ss/rdf', 'complete'): <function RdfComplete>, ('http://xmlns.4suite.org/4ss/rdf', 'contains'): <function RdfContains>, ('http://xmlns.4suite.org/4ss/rdf', 'versa-query'): <function RdfVersaQueryFunction>}
OBJECT_TYPE_LITERAL = 'L'
OBJECT_TYPE_RESOURCE = 'R'
OBJECT_TYPE_UNKNOWN = '?'
OBJ_TYPE_LOOKUP = {'LITERAL': 'L', 'RESOURCE': 'R'}
RAW_FILES = [1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 14, 15, 17]
RDF_NS = 'http://xmlns.4suite.org/4ss/rdf'
RESERVED_NAMESPACE = 'http://xmlns.4suite.org/reserved'
RESOURCE_CACHE = 3
RESOURCE_CONTENT = 2
RESOURCE_METADATA = 1
SESSION_DATA = 4
VB_PARAM = ('http://xmlns.4suite.org/reserved', 'versa-variable-bindings')
XML_DOCUMENTS = [1, 2, 4, 5, 6, 7, 8, 9, 11, 12, 14, 15]
g_resourceTypeMap = {0: 'Unknown Resource', 1: 'Container', 2: 'Alias', 3: 'Raw File', 4: 'XML Document', 5: 'XSLT Document', 6: 'Schematron Document', 7: 'User', 8: 'Group', 9: 'XPath Document Definition', ...}