<?xml version="1.0" encoding="iso-8859-1"?>
<module name="Ft.Rdf.Parsers.Versa.CoreFunctions" file="/work/a/ports/textproc/py-4suite/work/4Suite-1.0b1/build/lib.freebsd-7.1-RELEASE-i386-2.4/Ft/Rdf/Parsers/Versa/CoreFunctions.py">
  <modification-date>2005-03-02 19:31:11</modification-date>
  <abstract>Core Versa functions</abstract>
  <description>Copyright 2005 Fourthought, Inc. (USA).
Detailed license and copyright information: http://4suite.org/COPYRIGHT
Project home, documentation, distributions: http://4suite.org/</description>
  <classes>
    <class name="curry" public="yes">
      <bases>
      </bases>
      <abstract># See http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52549
# This does slow down these functions, but to an extent that is drowned out by the general slowness of function dispatch in Versa</abstract>
      <description/>
      <method-resolution-order>
        <base name="curry" module="Ft.Rdf.Parsers.Versa.CoreFunctions"/>
      </method-resolution-order>
      <methods documented="yes" class="curry" module="Ft.Rdf.Parsers.Versa.CoreFunctions" inherited="no">
        <method public="no" name="__call__" id="curry-__call__">
          <abstract/>
          <description/>
          <arguments>
            <arg name="self"/>
            <var-args name="args"/>
            <var-keywords name="kwargs"/>
          </arguments>
        </method>
        <method public="no" name="__init__" id="curry-__init__">
          <abstract/>
          <description/>
          <arguments>
            <arg name="self"/>
            <arg name="fun"/>
            <var-args name="args"/>
            <var-keywords name="kwargs"/>
          </arguments>
        </method>
      </methods>
    </class>
  </classes>
  <functions>
    <function public="yes" name="All" id="All">
      <abstract>Get all resources in the system
returns a list of strings (resources)
Note, if this was all()[] Then a FilterFunction is created</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
      </arguments>
    </function>
    <function public="yes" name="And" id="And">
      <abstract>Logical conjunction</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <var-args name="args"/>
      </arguments>
    </function>
    <function public="yes" name="Boolean" id="Boolean">
      <abstract/>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="obj"/>
      </arguments>
    </function>
    <function public="yes" name="Concat" id="Concat">
      <abstract>Concatenate a list of strings</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <var-args name="args"/>
      </arguments>
    </function>
    <function public="yes" name="Contains" id="Contains">
      <abstract>contains(outer, inner)
Return true if inner is contained in outer.</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="arg1"/>
        <arg default="None" name="arg2"/>
      </arguments>
    </function>
    <function public="yes" name="ContainsCi" id="ContainsCi">
      <abstract>contains(outer, inner)
Return true if inner is contained in outer.
Case insensitive variation</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="arg1"/>
        <arg default="None" name="arg2"/>
      </arguments>
    </function>
    <function public="yes" name="Current" id="Current">
      <abstract>Return the current value, if there is one</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
      </arguments>
    </function>
    <function public="yes" name="Difference" id="Difference">
      <abstract>Set difference</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="arg1"/>
        <arg name="arg2"/>
      </arguments>
    </function>
    <function public="yes" name="Distribute" id="Distribute">
      <abstract>Apply a list of expression to a list of values, returning
a list of a list of the results.
sourceList - a list of values
exprs - the remaining arguments are all converted to
        strings and treated as Versa expressions which are
        applied to each item of sourceList</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="sourceList"/>
        <var-args name="exprs"/>
      </arguments>
    </function>
    <function public="yes" name="Evaluate" id="Evaluate">
      <abstract>Dynamically evaluate the given string</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="expr"/>
      </arguments>
    </function>
    <function public="yes" name="Filter" id="Filter">
      <abstract>Apply a boolean expression to each of the resources
The first argument must return a list of resources
The second is a list of boolean-expressions.
the return value is the list of filtered resources</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="sourceList"/>
        <var-args name="filters"/>
      </arguments>
    </function>
    <function public="yes" name="Head" id="Head">
      <abstract>Converts the first argument to a list L, and the second to a number N.
Returns a list consisting of the first N items in L.  N defaults to 1.
If N is negative, or exceeds the length of the list, the entire list is
the result.</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="l"/>
        <arg default="1" name="num"/>
      </arguments>
    </function>
    <function public="yes" name="Intersection" id="Intersection">
      <abstract>Set intersection</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <var-args name="args"/>
      </arguments>
    </function>
    <function public="yes" name="IsLiteral" id="IsLiteral">
      <abstract>If computed argument is a list or set, convert to list
and return true if the first member
is a literal, otherwise return true if arg is a literal</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="obj"/>
      </arguments>
    </function>
    <function public="yes" name="IsResource" id="IsResource">
      <abstract>Return true if the item is of type resource, or can be
successfully converted to resource</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="arg"/>
      </arguments>
    </function>
    <function public="yes" name="IsType" id="IsType">
      <abstract>If obj resolves to a list, return true if any member is of the types
If obj is not a list, return true if the item is of one of the specifed types</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="obj"/>
        <arg name="type_"/>
      </arguments>
    </function>
    <function public="yes" name="Item" id="Item">
      <abstract>Converts the first argument to a list L, and the second to a number N.
Returns the Nth item in L.  N defaults to 1.</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="l"/>
        <arg default="1" name="num"/>
      </arguments>
    </function>
    <function public="yes" name="Join" id="Join">
      <abstract>Create a new list</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <var-args name="args"/>
      </arguments>
    </function>
    <function public="yes" name="Length" id="Length">
      <abstract>Return the length of a list</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="obj"/>
      </arguments>
    </function>
    <function public="yes" name="List" id="List">
      <abstract>Create a new list</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <var-args name="args"/>
      </arguments>
    </function>
    <function public="yes" name="Map" id="Map">
      <abstract>Execute an expression using each item of a given list, in turn, as context
expr - converted to strings and treated as Versa expressions
argLists - remaining arguments are each iterated over in turn
           to form the argument
Apply the query to each of the resources in the resource Expression.
The first argument must be a list of resources
The second is a list of queries.
the results is a list of lists.  The nested list will can the result of each
of the queries.</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="expr"/>
        <var-args name="argLists"/>
      </arguments>
    </function>
    <function public="yes" name="Member" id="Member">
      <abstract>member(outer, inner)
Return true if inner is a member of outer.</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="arg1"/>
        <arg default="None" name="arg2"/>
      </arguments>
    </function>
    <function public="yes" name="Not" id="Not">
      <abstract>Logical negation</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="arg"/>
      </arguments>
    </function>
    <function public="yes" name="Number" id="Number">
      <abstract/>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="obj"/>
      </arguments>
    </function>
    <function public="yes" name="Or" id="Or">
      <abstract>Logical disjunction</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <var-args name="args"/>
      </arguments>
    </function>
    <function public="yes" name="Order" id="Order">
      <abstract/>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="subjs"/>
        <arg name="pred"/>
        <arg default="u'http://rdfinference.org/versa/0/2/traverse/forward'" name="dirn"/>
      </arguments>
    </function>
    <function public="yes" name="Properties" id="Properties">
      <abstract>Note: This could take advantage of RDF/RDFS/OWL entailment rules to *bypass* doing a brute
force search on the model or to augment the result with other properties infered via rdfs:subPropertyOf and rdfs7</abstract>
      <description>http://www.w3.org/TR/rdf-mt/#RDFRules [7.3 RDFS Entailment Rules]
Transitivity of rdfs:subPropertyOf (rdfs5) could be used to return additional properties related to those returned

Assuming res has a defining OWL ontology, the rdfs:domain relationships stated in that ontology could be used
to deduce properties of res.  So

scoped-subquery('res - rdfs:domain -&gt; infered-property',&lt;ontology&gt;)
where &lt;ontology&gt; is a defining model for res and other related resources

In addition, under extensional semantic conditions (http://www.w3.org/TR/2004/REC-rdf-mt-20040210/#RDFSExtRules)
additional rdfs:domain relationships can be deduced from within this defining ontology:
ext1, ext3,</description>
      <arguments>
        <arg name="con"/>
        <arg default="None" name="res"/>
      </arguments>
    </function>
    <function public="yes" name="RelFunc" id="RelFunc">
      <abstract/>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="left"/>
        <arg default="None" name="right"/>
        <arg default="None" name="cmp_results"/>
      </arguments>
    </function>
    <function public="yes" name="Resource" id="Resource">
      <abstract/>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="obj"/>
      </arguments>
    </function>
    <function public="yes" name="Rest" id="Rest">
      <abstract>Converts the first argument to a list L, and the second to a number N.
Returns a list consisting of all items in L after position N.
N defaults to 1.  If N is negative, or exceeds the length of the list,
an empty list is the result.  The following expression returns the same
list as L, regardless of the value of N:</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="l"/>
        <arg default="1" name="num"/>
      </arguments>
    </function>
    <function public="yes" name="Scope" id="Scope">
      <abstract>Returns the scope(s) in which the given typed subject(s) is/are defined.  i.e. the scope of it's
rdf:type statement (if one exists)</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="res"/>
      </arguments>
    </function>
    <function public="yes" name="ScopedSubquery" id="ScopedSubquery">
      <abstract>Evaluate a subexpression within the limits of a given scope</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="expr"/>
        <arg name="scope"/>
      </arguments>
    </function>
    <function public="yes" name="Set" id="Set">
      <abstract>Create a new set.
If the argument is a single list, it is converted to a similar set
If the argument is one or more scalar value, it is converted to a set with those values
Otherwise, it is an error, and you may have meant to use the flatten() function</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <var-args name="args"/>
      </arguments>
    </function>
    <function public="yes" name="ShiftContext" id="ShiftContext">
      <abstract/>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="new"/>
      </arguments>
    </function>
    <function public="yes" name="Sort" id="Sort">
      <abstract>Sort the given set or list.
If there are no arguments, the context is sorted using default params
The first argument is converted to a list
The second argument is the optional sort type
The third argument is the optional sort order
The results are the sorted list</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg default="None" name="sourceList"/>
        <arg default="u'http://rdfinference.org/versa/0/2/sort/string'" name="type_"/>
        <arg default="u'http://rdfinference.org/versa/0/2/sort/ascending'" name="order"/>
      </arguments>
    </function>
    <function public="yes" name="SortQ" id="SortQ">
      <abstract>Dynamically sort using the given set or list.
The first argument is converted to a list
The second argument is the expression to be dynamically evaluated per list item
The third argument is the optional sort type
The fourth argument is the optional sort order
The results are the sorted list</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="sourceList"/>
        <arg name="expr"/>
        <arg default="u'http://rdfinference.org/versa/0/2/sort/string'" name="type_"/>
        <arg default="u'http://rdfinference.org/versa/0/2/sort/ascending'" name="order"/>
      </arguments>
    </function>
    <function public="yes" name="StartsWith" id="StartsWith">
      <abstract>starts-with(outer, inner)
Return true if outer starts with inner.</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="arg1"/>
        <arg default="None" name="arg2"/>
      </arguments>
    </function>
    <function public="yes" name="String" id="String">
      <abstract/>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="obj"/>
      </arguments>
    </function>
    <function public="yes" name="StringLength" id="StringLength">
      <abstract>Return the length of a string</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="obj"/>
      </arguments>
    </function>
    <function public="yes" name="SubstringAfter" id="SubstringAfter">
      <abstract/>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="arg1"/>
        <arg default="None" name="arg2"/>
      </arguments>
    </function>
    <function public="yes" name="SubstringBefore" id="SubstringBefore">
      <abstract/>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="arg1"/>
        <arg default="None" name="arg2"/>
      </arguments>
    </function>
    <function public="yes" name="Tail" id="Tail">
      <abstract>Converts the first argument to a list L, and the second to a number N.
Returns a list consisting of the last N items in L.  N defaults to 1.
If N is negative, or exceeds the length of the list, an empty list is
the result.</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="l"/>
        <arg default="1" name="num"/>
      </arguments>
    </function>
    <function public="yes" name="Traverse" id="Traverse">
      <abstract/>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="subjs"/>
        <arg name="preds"/>
        <arg default="u'http://rdfinference.org/versa/0/2/traverse/forward'" name="dirn"/>
        <arg default="u'http://rdfinference.org/versa/0/2/traverse/simple'" name="trans"/>
      </arguments>
    </function>
    <function public="yes" name="Triples" id="Triples">
      <abstract>Return a list of triples matching the given criteria</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="matchSubj"/>
        <arg name="matchPred"/>
        <arg name="matchObj"/>
      </arguments>
    </function>
    <function public="yes" name="Type" id="Type">
      <abstract>Get all resources of a specific type.  This takes into account
rdfs:subClassOf ala RDFS Entailment rule rdfs9 (http://www.w3.org/TR/rdf-mt/#RDFRules)
7.3 RDFS Entailment Rules</abstract>
      <description>uuu rdfs:subClassOf xxx .
vvv rdf:type xxx .         --&gt;    vvv rdf:type uuu .

Other possible rdf:type entailments:

rdfs2
aaa rdfs:domain xxx .
uuu aaa yyy .              ---&gt;     uuu rdf:type xxx .

Versa solution (? - skolem variable):
Infered-member |- (list(types) &lt;- rdfs:domain - ?) -&gt; ?

rdfs3
aaa rdfs:range xxx .
uuu aaa vvv .               --&gt;     vvv rdf:type xxx .

Versa solution (? - skolem variable)
? - (list(types) &lt;- rdfs:range - ?) -&gt; Infered-member

Where infered-member is a resource returned amongst the list resulting from this evaluateion of type()</description>
      <arguments>
        <arg name="con"/>
        <arg name="types"/>
      </arguments>
    </function>
    <function public="yes" name="Union" id="Union">
      <abstract>Set union</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <var-args name="args"/>
      </arguments>
    </function>
    <function public="no" name="_depthFirst" id="_depthFirst">
      <abstract/>
      <description/>
      <arguments>
        <arg name="curr"/>
        <arg name="relation"/>
        <arg name="subresult"/>
        <arg name="seen"/>
      </arguments>
    </function>
    <function public="no" name="_expandSubTypes" id="_expandSubTypes">
      <abstract>Find any sub classes of this type
s = None
p = rdfs:subClassOf
o = baseType</abstract>
      <description/>
      <arguments>
        <arg name="con"/>
        <arg name="baseType"/>
        <arg name="found"/>
      </arguments>
    </function>
  </functions>
  <fields>
    <field public="yes" name="Eq" id="Eq">
      <value>&lt;Ft.Rdf.Parsers.Versa.CoreFunctions.curry instance&gt;</value>
    </field>
    <field public="yes" name="FUNCTIONS" id="FUNCTIONS">
      <value>{(None, 'all'): &lt;function All&gt;, (None, 'and'): &lt;function And&gt;, (None, 'boolean'): &lt;function Boolean&gt;, (None, 'concat'): &lt;function Concat&gt;, (None, 'contains'): &lt;function Contains&gt;, (None, 'contains-ci'): &lt;function ContainsCi&gt;, (None, 'current'): &lt;function Current&gt;, (None, 'difference'): &lt;function Difference&gt;, (None, 'distribute'): &lt;function Distribute&gt;, (None, 'eq'): &lt;Ft.Rdf.Parsers.Versa.CoreFunctions.curry instance&gt;, ...}</value>
    </field>
    <field public="yes" name="Gt" id="Gt">
      <value>&lt;Ft.Rdf.Parsers.Versa.CoreFunctions.curry instance&gt;</value>
    </field>
    <field public="yes" name="Gte" id="Gte">
      <value>&lt;Ft.Rdf.Parsers.Versa.CoreFunctions.curry instance&gt;</value>
    </field>
    <field public="yes" name="Lt" id="Lt">
      <value>&lt;Ft.Rdf.Parsers.Versa.CoreFunctions.curry instance&gt;</value>
    </field>
    <field public="yes" name="Lte" id="Lte">
      <value>&lt;Ft.Rdf.Parsers.Versa.CoreFunctions.curry instance&gt;</value>
    </field>
    <field public="yes" name="RDF_MS_BASE" id="RDF_MS_BASE">
      <value>'http://www.w3.org/1999/02/22-rdf-syntax-ns#'</value>
    </field>
    <field public="yes" name="RDF_SCHEMA_BASE" id="RDF_SCHEMA_BASE">
      <value>'http://www.w3.org/2000/01/rdf-schema#'</value>
    </field>
    <field public="yes" name="RDF_SUBCLASSOF_PROP" id="RDF_SUBCLASSOF_PROP">
      <value>u'http://www.w3.org/2000/01/rdf-schema#subClassOf'</value>
    </field>
    <field public="yes" name="RDF_SUBPROPOF_PROP" id="RDF_SUBPROPOF_PROP">
      <value>u'http://www.w3.org/2000/01/rdf-schema#subPropertyOf'</value>
    </field>
    <field public="yes" name="RDF_TYPE_PROP" id="RDF_TYPE_PROP">
      <value>u'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'</value>
    </field>
  </fields>
</module>
