<?xml version="1.0"?>
<?xml-stylesheet href="http://xslt.fourthought.com/api.xslt" type="text/xsl"?>
<tech:ApiSpec title="4RDF"
  xmlns:tech="http://namespaces.fourthought.com/technical"
  xmlns="http://docbook.org/docbook/xml/4.0/namespace"
>

<para>
</para>

  <articleinfo>
    <title>4RDF API</title>

     <author>
       <firstname>Uche</firstname>
       <surname>Ogbuji</surname>
       <affiliation>
         <orgname><ulink url="http://Fourthought.com">Fourthought, Inc.</ulink></orgname>
         <address><email>uche.ogbuji@fourthought.com</email></address>
       </affiliation>
     </author>
     <revhistory>
       <revision>
         <revnumber>1.1</revnumber>
         <date>2000-08-31</date>
         <authorinitials>UO</authorinitials>
         <revremark>Distributed with 4Suite 0.11.1</revremark>
       </revision>
     </revhistory>

     <legalnotice>
       <para>This document can be freely translated and distributed. It's released under the <ulink url="http://www.linuxdoc.org/manifesto.html">LDP License</ulink>.</para>
     </legalnotice>

     <keywordset>
       <keyword>help</keyword>
       <keyword>4Suite</keyword>
       <keyword>API</keyword>
       <keyword>4RDF</keyword>
       <keyword>RDF</keyword>
       <keyword>RIL</keyword>
       <keyword>Inference</keyword>
     </keywordset>

  </articleinfo>


<dc:Description>Application Programming Interface for 4RDF</dc:Description>


<sect1>
<title>The 4RDF API</title>

<para>
There is no standard API for RDF processors.  We put together a simple, clean API that suits our uses of RDF very well.  There are other APIs such as SIRPaC, RAX, none of which are supported by 4RDF now.
</para>

<para>
  Please see the <ulink url="4rdf-command-line.html">4RDF command line documentation</ulink>
  for command line help
</para>


<!--
<tech:Module>
  <tech:Name></tech:Name>
  <tech:Desc></tech:Desc>
  <tech:Class>
    <tech:Name></tech:Name>
    <tech:Desc></tech:Desc>
    <tech:Method>
      <tech:Name></tech:Name>
      <tech:Desc></tech:Desc>
      <tech:Arg><tech:Name></tech:Name><tech:Type></tech:Type><tech:Desc></tech:Desc></tech:Arg>
      <tech:Return><tech:Type></tech:Type><tech:Desc></tech:Desc></tech:Return>
      <tech:exception></tech:exception>
    </tech:Method>
  </tech:Class>

  <tech:Function>
    <tech:Name></tech:Name>
    <tech:Desc></tech:Desc>
    <tech:Arg><tech:Name></tech:Name><tech:Type></tech:Type><tech:Desc></tech:Desc></tech:Arg>
    <tech:Return><tech:Type></tech:Type><tech:Desc></tech:Desc></tech:Return>
    <tech:exception></tech:exception>
  </tech:Function>

</tech:Module>
-->

<tech:Module>
  <tech:Name>Ft.Rdf.Model</tech:Name>
  <tech:Constant>
    <tech:Type>integer</tech:Type>
    <tech:Name>NORMAL</tech:Name>
    <tech:Value>0</tech:Value>
    <tech:Desc>A flag used in querying: indicates that search terms are to be exactly matched</tech:Desc>
  </tech:Constant>
  <tech:Constant>
    <tech:Type>integer</tech:Type>
    <tech:Name>IGNORE_CASE</tech:Name>
    <tech:Value>1</tech:Value>
    <tech:Desc>A flag used in querying: indicates that search terms are to be matched regardless of case</tech:Desc>
  </tech:Constant>
  <tech:Constant>
    <tech:Type>integer</tech:Type>
    <tech:Name>REGEX</tech:Name>
    <tech:Value>2</tech:Value>
    <tech:Desc>A flag used in querying: indicates that search terms are to be treated as regular expressions and matched accordingly</tech:Desc>
  </tech:Constant>

  <tech:Class>
    <tech:Name>Model</tech:Name>
    <tech:Desc>Represents a universe of RDF statements, which at the abstract level represents a set of graphs that make up an RDF model</tech:Desc>

    <tech:Method>
      <tech:Name>__init__</tech:Name>
      <tech:Desc>Initializer for an RDF model instance</tech:Desc>
      <tech:Arg>
        <tech:Name>driver</tech:Name>
        <tech:Type>Any object meeting the protocol of Ft.Rdf.Drivers.Memory.Memory</tech:Type>
        <tech:Desc>This is the object used to abstract the storage and management of the RDF statements.  It could be a memory buffer, a DBMS connection, or even some code around a UserList</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>schemaHandler</tech:Name>
        <tech:Type>Ft.Rdf.SchemaHandler.SchemaHandler</tech:Type>
        <tech:Desc>This object is used to provide RDF schema support.  If None, no schema support will be available for the resulting model.  The default is None</tech:Desc>
      </tech:Arg>
    </tech:Method>

    <tech:Method>
      <tech:Name>addContainer</tech:Name>
      <tech:Desc>Add a container to the model.  This involves adding a statement for the container type, and a container statement for each item in the collection</tech:Desc>
      <tech:Arg>
        <tech:Name>container</tech:Name>
        <tech:Type>Ft.Rdf.Container.Container</tech:Type>
        <tech:Desc>The container instance</tech:Desc>
      </tech:Arg>
    </tech:Method>

    <tech:Method>
      <tech:Name>extractContainer</tech:Name>
      <tech:Desc>Build a container object from the container item relationships in the model (_1, _2, etc.).</tech:Desc>
      <tech:Arg>
        <tech:Name>uri</tech:Name>
        <tech:Type>Ft.Rdf.Container.Container</tech:Type>
        <tech:Desc>The uri of the represented container</tech:Desc>
      </tech:Arg>
      <tech:Return>
        <tech:Type>Ft.Rdf.Container.Container</tech:Type>
        <tech:Desc>A container object (Bag, Alt or Set) representing all the container item relationships.  Note that the returned object is not live.  Changes to the model after the container is extracted will not affect the extracted container.</tech:Desc>
      </tech:Return>
    </tech:Method>

    <tech:Method>
      <tech:Name>add</tech:Name>
      <tech:Desc>Add statement(s) to the model</tech:Desc>
      <tech:Arg>
        <tech:Name>statements</tech:Name>
        <tech:Type>list of Rdf.Statement.Statement</tech:Type>
        <tech:Desc>The new statement(s) to add to the model.  Can be either a list of or a single Statement instance.</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>checkSchema</tech:Name>
        <tech:Type>boolean</tech:Type>
        <tech:Default>1</tech:Default>
        <tech:Desc>True enforces that the addition does not violate the RDF schema.</tech:Desc>
      </tech:Arg>
    </tech:Method>

    <tech:Method>
      <tech:Name>contains</tech:Name>
      <tech:Desc>Check if a statement is in the model</tech:Desc>
      <tech:Arg>
        <tech:Name>statement</tech:Name>
        <tech:Type>Rdf.Statement.Statement</tech:Type>
        <tech:Desc>The statement to check.</tech:Desc>
      </tech:Arg>
    </tech:Method>

    <tech:Method>
      <tech:Name>containsPattern</tech:Name>
      <tech:Desc>Determine if any statement matching the given criteria is in the model.</tech:Desc>
      <tech:Arg>
        <tech:Name>subject</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>If not None, statements must have the given subject to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>predicate</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>If not None, statements must have the given predicate to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>object</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>If not None, statements must have the given object to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>statementUri</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Default>None</tech:Default>
        <tech:Desc>If not None, statements must have the given statementUri to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>sourceUri</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Default>None</tech:Default>
        <tech:Desc>If not None, statements must have the given sourceUri to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>subjectFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the subject</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>predicateFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the predicate</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>objectFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the object</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>statementUriFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the statementUri</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>sourceUriFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the sourceUri</tech:Desc>
      </tech:Arg>
      <tech:Return>
        <tech:Type>boolean</tech:Type>
        <tech:Desc>True if any statements in the model match the given pattern</tech:Desc>
      </tech:Return>
    </tech:Method>

    <tech:Method>
      <tech:Name>statements</tech:Name>
      <tech:Desc>Returns all the statments in the model</tech:Desc>
      <tech:Return>
        <tech:Type>list of Ft.Rdf.Statement.Statement</tech:Type>
        <tech:Desc>Sll the statements in the model</tech:Desc>
      </tech:Return>
    </tech:Method>

    <tech:Method>
      <tech:Name>remove</tech:Name>
      <tech:Desc>Remove statement(s) from the model</tech:Desc>
      <tech:Arg>
        <tech:Name>statements</tech:Name>
        <tech:Type>list of Rdf.Statement.Statement</tech:Type>
        <tech:Desc>The statement(s) to remove.  Can be either list of or single Ft.Rdf.Statement.Statement</tech:Desc>
      </tech:Arg>
    </tech:Method>

    <tech:Method>
      <tech:Name>removePattern</tech:Name>
      <tech:Desc>Remove all statements from the model that match the specified pattern</tech:Desc>
      <tech:Arg>
        <tech:Name>subject</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>If not None, statements must have the given subject to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>predicate</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>If not None, statements must have the given predicate to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>object</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>If not None, statements must have the given object to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>statementUri</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Default>None</tech:Default>
        <tech:Desc>If not None, statements must have the given statementUri to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>sourceUri</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Default>None</tech:Default>
        <tech:Desc>If not None, statements must have the given sourceUri to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>subjectFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the subject</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>predicateFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the predicate</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>objectFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the object</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>statementUriFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the statementUri</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>sourceUriFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the sourceUri</tech:Desc>
      </tech:Arg>
    </tech:Method>

    <tech:Method>
      <tech:Name>size</tech:Name>
      <tech:Desc>Returns the number of statements in the model</tech:Desc>
      <tech:Return>
        <tech:Type>integer</tech:Type>
        <tech:Desc>The number of statements in the model. Will be equal to or greater than 0</tech:Desc>
      </tech:Return>
    </tech:Method>

    <tech:Method>
      <tech:Name>complete</tech:Name>
      <tech:Desc>Return all the statements in the model that match the given pattern.</tech:Desc>
      <tech:Arg>
        <tech:Name>subject</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>If not None, statements must have the given subject to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>predicate</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>If not None, statements must have the given predicate to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>object</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>If not None, statements must have the given object to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>statementUri</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Default>None</tech:Default>
        <tech:Desc>If not None, statements must have the given statementUri to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>sourceUri</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Default>None</tech:Default>
        <tech:Desc>If not None, statements must have the given sourceUri to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>subjectFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the subject</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>predicateFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the predicate</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>objectFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the object</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>statementUriFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the statementUri</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>sourceUriFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the sourceUri</tech:Desc>
      </tech:Arg>
      <tech:Return>
        <tech:Type>list of Ft.Rdf.Statement.Statement</tech:Type>
        <tech:Desc>The matching statements in the model.</tech:Desc>
      </tech:Return>
    </tech:Method>

    <tech:Method>
      <tech:Name>exclude</tech:Name>
      <tech:Desc>Return all the statements in the model that DO NOT match the given pattern.</tech:Desc>
      <tech:Arg>
        <tech:Name>subject</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>If not None, statements must have the given subject to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>predicate</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>If not None, statements must have the given predicate to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>object</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>If not None, statements must have the given object to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>statementUri</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Default>None</tech:Default>
        <tech:Desc>If not None, statements must have the given statementUri to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>sourceUri</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Default>None</tech:Default>
        <tech:Desc>If not None, statements must have the given sourceUri to match</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>subjectFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the subject</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>predicateFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the predicate</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>objectFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the object</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>statementUriFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the statementUri</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>sourceUriFlags</tech:Name>
        <tech:Type>integer</tech:Type>
        <tech:Default>0</tech:Default>
        <tech:Desc>Bit-wise OR'd module constants for matching the sourceUri</tech:Desc>
      </tech:Arg>
      <tech:Return>
        <tech:Type>list of Ft.Rdf.Statement.Statement</tech:Type>
        <tech:Desc>All statements in the model not matching the pattern.</tech:Desc>
      </tech:Return>
    </tech:Method>

    <tech:Method>
      <tech:Name>generateUri</tech:Name>
      <tech:Desc>Generates URIs for "anonymous" resources, such as reified statements.  The default method is to generate a UUID URN, but this can be easily overriden.</tech:Desc>
      <tech:Return>
        <tech:Type>string</tech:Type>
        <tech:Desc>A generated URI</tech:Desc>
      </tech:Return>
    </tech:Method>

  </tech:Class>

</tech:Module>


<tech:Module>
  <tech:Name>Ft.Rdf.Statement</tech:Name>
  <tech:Desc></tech:Desc>

  <tech:Class>
    <tech:Name>Statement</tech:Name>
    <tech:Desc>Represents an RDF triple or statement</tech:Desc>
    <tech:Method>
      <tech:Name>__init__</tech:Name>
      <tech:Desc>Initializer for an RDF statement instance</tech:Desc>
      <tech:Arg>
        <tech:Name>subject</tech:Name>
        <tech:Type>string</tech:Type><tech:Desc>The subject of the statement</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>predicate</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>The predicate of the statement</tech:Desc>
        </tech:Arg>
      <tech:Arg>
        <tech:Name>object</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>The object of the statement</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>uri</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Default>''</tech:Default>
        <tech:Desc>The URI of the statement.  This is an empty string except for very sophisticated use.</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>sourceUri</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Default>''</tech:Default>
        <tech:Desc>The uri of the document containing this statement.  This is an empty string except for very sophisticated use.</tech:Desc>
      </tech:Arg>
    </tech:Method>
    <tech:Method>
      <tech:Name>reify</tech:Name>
      <tech:Desc>Prepare the statement in the model so that it can be the subject of other statements.  See the RDF spec for details of how statements are expanded for reification.  Note that the original statement is not removed by reification.  The statement's uri is used as the subject of the added statements, or a URI is generated if the statement's uri is an empty string.</tech:Desc>
      <tech:Arg>
        <tech:Name>model</tech:Name>
        <tech:Type>Ft.Rdf.Model</tech:Type>
        <tech:Desc>The model that is used to add the additional statements generated bu reification.</tech:Desc>
        </tech:Arg>
      <tech:Arg>
        <tech:Name>uri</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Default>None</tech:Default>
        <tech:Desc>URI to be assigned to the statement.  If None, then first the statement object is checked for a URI, otherwise the model generates a URI for the reified statement.  Default is None.</tech:Desc>
      </tech:Arg>
    </tech:Method>

  </tech:Class>

</tech:Module>


<tech:Module>
  <tech:Name>Ft.Rdf.SchemaHandler</tech:Name>
  <tech:Desc></tech:Desc>

  <tech:Class>
    <tech:Name>SchemaHandler</tech:Name>
    <tech:Desc>Processing of RDF schema information on behalf of a model instance.</tech:Desc>
    <tech:Method>
      <tech:Name>__init__</tech:Name>
      <tech:Desc>Initializer for a SchemaHandler.  There are no parameters.</tech:Desc>
    </tech:Method>
    <tech:Method>
      <tech:Name>isCoreRdfs</tech:Name>
      <tech:Desc>Checks whether a statement comes from the core RDF meta-model.</tech:Desc>
      <tech:Arg><tech:Name>stmt</tech:Name><tech:Type>Rdf.Statement.Statement</tech:Type><tech:Desc>The statement to check.</tech:Desc></tech:Arg>
      <tech:Return><tech:Type>boolean</tech:Type><tech:Desc>1 if the statement comes from the core RDF meta-model, otherwise 0.</tech:Desc></tech:Return>
    </tech:Method>
    <tech:Method>
      <tech:Name>isInstance</tech:Name>
      <tech:Desc>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.</tech:Desc>
      <tech:Arg><tech:Name>model</tech:Name><tech:Type>Rdf.Model.Model</tech:Type><tech:Desc>The model in which the condition is be checked</tech:Desc></tech:Arg>
      <tech:Arg><tech:Name>obj</tech:Name><tech:Type>string</tech:Type><tech:Desc>The URI of the resource to check for class membership.</tech:Desc></tech:Arg>
      <tech:Arg><tech:Name>class_</tech:Name><tech:Type>string</tech:Type><tech:Desc>The URI of the class to be checked.</tech:Desc></tech:Arg>
      <tech:Return><tech:Type>boolean</tech:Type><tech:Desc>1 if the statement is an instance of the class, otherwise 0.</tech:Desc></tech:Return>
    </tech:Method>
    <tech:Method>
      <tech:Name>isSubClass</tech:Name>
      <tech:Desc>Checks whether a class is an instance of another class.</tech:Desc>
      <tech:Arg><tech:Name>model</tech:Name><tech:Type>Rdf.Model.Model</tech:Type><tech:Desc>The model in which the condition is be checked</tech:Desc></tech:Arg>
      <tech:Arg><tech:Name>class1</tech:Name><tech:Type>string</tech:Type><tech:Desc>The URI of the class to check as descendant.</tech:Desc></tech:Arg>
      <tech:Arg><tech:Name>class2</tech:Name><tech:Type>string</tech:Type><tech:Desc>The URI of the class to check as ancestor.</tech:Desc></tech:Arg>
      <tech:Return><tech:Type>boolean</tech:Type><tech:Desc>1 if the first class is a descendant of the second, otherwise 0.</tech:Desc></tech:Return>
    </tech:Method>
  </tech:Class>
</tech:Module>

<para>
Serializers create a serialized representation from an RDF model, or populate a model with statements from a serialized form.  Currently the only built-in serializer for 4RDF handles a DOM form representing the XML serialization from the <ulink url="http://www.w3.org/TR/REC-rdf-syntax/">RDF Model and syntax recommendation</ulink>.
</para>

<tech:Module>
  <tech:Name>Ft.Rdf.Serializers.Dom</tech:Name>
  <tech:Desc>Serialize or deserialize a model based on the XML serialization in the RDF Model and Syntax recommendation.</tech:Desc>
  <tech:Class>
    <tech:Name>Serializer</tech:Name>
    <tech:Desc>Serialize or deserialize a model based on the XML serialization in the RDF Model and Syntax recommendation.</tech:Desc>
    <tech:Method>
      <tech:Name>serialize</tech:Name>
      <tech:Desc>Construct a DOM representing statements in the model.</tech:Desc>
      <tech:Arg>
        <tech:Name>model</tech:Name>
        <tech:Type>Ft.Rdf.Model</tech:Type>
        <tech:Desc>The model from which the serialization is to be extracted</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>nsMap</tech:Name>
        <tech:Type>dictionary</tech:Type>
        <tech:Default>None</tech:Default>
        <tech:Desc>A mapping from URIs that are found in the model to prefixes that will be used for the corresponding XML namespaces in the serialization.  If none, prefixes will be generated for each unique namespaceURI</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>selectUri</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Default>None</tech:Default>
        <tech:Desc>Only statements with this URI will be selected for serialization.  If None, all statements will be serialized.  Note that if the model is set up for schema validation, the RDFS schema statements are suppressed from the output.</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>implementation</tech:Name>
        <tech:Type>xml.dom.DOMImplementation</tech:Type>
        <tech:Default>Ft.Lib.pDomlette.DOMImplementation</tech:Default>
        <tech:Desc>An instance of a DOM implementation used to create the serialized document</tech:Desc>
      </tech:Arg>
      <tech:Return>
        <tech:Type>xml.dom.Document</tech:Type>
        <tech:Desc>The DOM Document node that represents the serialized document.</tech:Desc>
      </tech:Return>
<!--      <tech:exception></tech:exception>   -->
    </tech:Method>

    <tech:Method>
      <tech:Name>deserialize</tech:Name>
      <tech:Desc>Generate RDF statements from an XML serialization and insert these into a Model.</tech:Desc>
      <tech:Arg>
        <tech:Name>model</tech:Name>
        <tech:Type>Ft.Rdf.Model</tech:Type>
        <tech:Desc>The model into which the statements generated by the deserialization is to be entered.</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>node</tech:Name>
        <tech:Type>xml.dom.Node</tech:Type>
        <tech:Desc>The DOM node representing the serialization from which the statements are extracted.</tech:Desc>
      </tech:Arg>
      <tech:Arg>
        <tech:Name>sourceUri</tech:Name>
        <tech:Type>string</tech:Type>
        <tech:Desc>The base URI of the serialization.  Usually this would be the URI of the document where the serialization is found.</tech:Desc>
      </tech:Arg>
<!--      <tech:exception></tech:exception>   -->
    </tech:Method>
  </tech:Class>
</tech:Module>

</sect1>

</tech:ApiSpec>
