[Mulgara-svn] r145 - in trunk/docs/site: . descriptors img img-layout inferencing integration itqlcommands itqloperations legal oldsite oldsite/images oldsite/images/images oldsite/images/images/icons oldsite/styles oldsite/svn187 overview resolvers script style system
thomas at mulgara.org
thomas at mulgara.org
Fri Dec 8 00:02:43 UTC 2006
Author: thomas
Date: 2006-12-07 18:02:42 -0600 (Thu, 07 Dec 2006)
New Revision: 145
Added:
trunk/docs/site/backofbook.html
trunk/docs/site/descriptors/
trunk/docs/site/descriptors/descadvantages.html
trunk/docs/site/descriptors/descriptorex.html
trunk/docs/site/descriptors/descriptorhw.html
trunk/docs/site/descriptors/descriptorlist.html
trunk/docs/site/descriptors/descriptorsfaq.html
trunk/docs/site/descriptors/descriptortag.html
trunk/docs/site/descriptors/descriptorvcard.html
trunk/docs/site/descriptors/descwhat.html
trunk/docs/site/descriptors/includeTOC.inc
trunk/docs/site/descriptors/index.html
trunk/docs/site/descriptors/mistakes.html
trunk/docs/site/descriptors/nsdesc.html
trunk/docs/site/descriptors/querytag.html
trunk/docs/site/descriptors/reserved.html
trunk/docs/site/img-layout/
trunk/docs/site/img-layout/atlassian-160.png
trunk/docs/site/img-layout/backLeft.jpg
trunk/docs/site/img-layout/backTop.jpg
trunk/docs/site/img-layout/black-20.png
trunk/docs/site/img-layout/black-30.png
trunk/docs/site/img-layout/black-40.png
trunk/docs/site/img-layout/black-50.png
trunk/docs/site/img-layout/black-55.png
trunk/docs/site/img-layout/black-60.png
trunk/docs/site/img-layout/black-70.png
trunk/docs/site/img-layout/black-80.png
trunk/docs/site/img-layout/black-90.png
trunk/docs/site/img-layout/bosatsu-160.gif
trunk/docs/site/img-layout/bosatsu-160.png
trunk/docs/site/img-layout/dash.gif
trunk/docs/site/img-layout/herzum-160.png
trunk/docs/site/img-layout/herzum.gif
trunk/docs/site/img-layout/herzum.png
trunk/docs/site/img-layout/ieBack-2.jpg
trunk/docs/site/img-layout/ieBack-3.jpg
trunk/docs/site/img-layout/ieBack.jpg
trunk/docs/site/img-layout/logo856s.png
trunk/docs/site/img-layout/mbackLeft.jpg
trunk/docs/site/img-layout/mbackTop.jpg
trunk/docs/site/img-layout/mulgara-logo.png
trunk/docs/site/img-layout/netymon-160-l.gif
trunk/docs/site/img-layout/netymon-160-l.png
trunk/docs/site/img-layout/opensource-55x48.png
trunk/docs/site/img-layout/siteicon.png
trunk/docs/site/img-layout/sm-160.jpg
trunk/docs/site/img-layout/w3css30.gif
trunk/docs/site/img-layout/w3css30.png
trunk/docs/site/img-layout/w3xhtml10.gif
trunk/docs/site/img-layout/w3xhtml10.png
trunk/docs/site/img-layout/white-30.png
trunk/docs/site/img-layout/white-40.png
trunk/docs/site/img-layout/white-50.png
trunk/docs/site/img-layout/white-60.png
trunk/docs/site/img-layout/white-70.png
trunk/docs/site/img-layout/white-80.png
trunk/docs/site/img-layout/white-85.png
trunk/docs/site/img-layout/white-90.png
trunk/docs/site/img-layout/white-95.png
trunk/docs/site/img/
trunk/docs/site/img/descriptorhw791.gif
trunk/docs/site/img/descriptorhw792.gif
trunk/docs/site/img/descriptorhw793.gif
trunk/docs/site/img/descriptorhw794.gif
trunk/docs/site/img/descriptorlist799.gif
trunk/docs/site/img/descriptorlist800.gif
trunk/docs/site/img/descriptorlist801.gif
trunk/docs/site/img/descriptorvcard918.gif
trunk/docs/site/img/descriptorvcard919.png
trunk/docs/site/img/jrdfgraphs2490.gif
trunk/docs/site/img/loadexistingrdf.gif
trunk/docs/site/img/select1536.gif
trunk/docs/site/img/viewerscreen.gif
trunk/docs/site/img/viewerstep1.gif
trunk/docs/site/img/viewerstep1result.gif
trunk/docs/site/img/viewerstep2.gif
trunk/docs/site/img/viewerstep3.gif
trunk/docs/site/img/viewerstep4.gif
trunk/docs/site/includeBottom.inc
trunk/docs/site/includeMiddle.inc
trunk/docs/site/includeTOC.inc
trunk/docs/site/includeTop.inc
trunk/docs/site/index.html
trunk/docs/site/inferencing/
trunk/docs/site/inferencing/consistency.html
trunk/docs/site/inferencing/entailment.html
trunk/docs/site/inferencing/includeTOC.inc
trunk/docs/site/inferencing/index.html
trunk/docs/site/inferencing/inferexample.html
trunk/docs/site/inferencing/inferintro.html
trunk/docs/site/inferencing/infermulgara.html
trunk/docs/site/inferencing/infersemweb.html
trunk/docs/site/inferencing/infersitu.html
trunk/docs/site/inferencing/infersummary.html
trunk/docs/site/inferencing/ontomanage.html
trunk/docs/site/inferencing/owl.html
trunk/docs/site/inferencing/sofa.html
trunk/docs/site/integration/
trunk/docs/site/integration/compiling.html
trunk/docs/site/integration/contenthandlers.html
trunk/docs/site/integration/contenthandlersdev.html
trunk/docs/site/integration/includeTOC.inc
trunk/docs/site/integration/index.html
trunk/docs/site/integration/integrate.html
trunk/docs/site/integration/jena.html
trunk/docs/site/integration/jrdfaddtriples.html
trunk/docs/site/integration/jrdfcreategraph.html
trunk/docs/site/integration/jrdfcreatenodes.html
trunk/docs/site/integration/jrdfprereq.html
trunk/docs/site/integration/jrdfreify.html
trunk/docs/site/integration/jrdfremove.html
trunk/docs/site/integration/jrdftutorial.html
trunk/docs/site/integration/jsptutorial.html
trunk/docs/site/integration/parsers.html
trunk/docs/site/integration/perl.html
trunk/docs/site/integration/resolveprot.html
trunk/docs/site/integration/resolverfactories.html
trunk/docs/site/integration/resolverhttpmp3.html
trunk/docs/site/integration/resolverpre.html
trunk/docs/site/integration/resolverwrapper.html
trunk/docs/site/integration/resolverwrite.html
trunk/docs/site/integration/searchgraph.html
trunk/docs/site/integration/statements.html
trunk/docs/site/itqlcommands/
trunk/docs/site/itqlcommands/alias.html
trunk/docs/site/itqlcommands/backup.html
trunk/docs/site/itqlcommands/comment.html
trunk/docs/site/itqlcommands/commit.html
trunk/docs/site/itqlcommands/create.html
trunk/docs/site/itqlcommands/delete.html
trunk/docs/site/itqlcommands/drop.html
trunk/docs/site/itqlcommands/execute.html
trunk/docs/site/itqlcommands/help.html
trunk/docs/site/itqlcommands/includeTOC.inc
trunk/docs/site/itqlcommands/index.html
trunk/docs/site/itqlcommands/insert.html
trunk/docs/site/itqlcommands/load.html
trunk/docs/site/itqlcommands/quit.html
trunk/docs/site/itqlcommands/restore.html
trunk/docs/site/itqlcommands/rollback.html
trunk/docs/site/itqlcommands/select.html
trunk/docs/site/itqlcommands/set.html
trunk/docs/site/itqloperations/
trunk/docs/site/itqloperations/datatypingmodels.html
trunk/docs/site/itqloperations/filesysmodel.html
trunk/docs/site/itqloperations/fulltextmodels.html
trunk/docs/site/itqloperations/includeTOC.inc
trunk/docs/site/itqloperations/index.html
trunk/docs/site/itqloperations/nodetyping.html
trunk/docs/site/itqloperations/views.html
trunk/docs/site/legal/
trunk/docs/site/legal/fdl.txt
trunk/docs/site/oldsite/
trunk/docs/site/oldsite/images/
trunk/docs/site/oldsite/images/cbook.gif
trunk/docs/site/oldsite/images/collapse.gif
trunk/docs/site/oldsite/images/collapseall.gif
trunk/docs/site/oldsite/images/contents1.gif
trunk/docs/site/oldsite/images/contents2.gif
trunk/docs/site/oldsite/images/expand.gif
trunk/docs/site/oldsite/images/expandall.gif
trunk/docs/site/oldsite/images/images/
trunk/docs/site/oldsite/images/images/Picasa.ini
trunk/docs/site/oldsite/images/images/icons/
trunk/docs/site/oldsite/images/images/icons/siteicon.png
trunk/docs/site/oldsite/images/images/mulgara.jpg
trunk/docs/site/oldsite/images/images/mulgara_banner.png
trunk/docs/site/oldsite/images/images/siteicon.png
trunk/docs/site/oldsite/images/images/tksv.png
trunk/docs/site/oldsite/images/images/tksv2.png
trunk/docs/site/oldsite/images/images/top.gif
trunk/docs/site/oldsite/images/index1.gif
trunk/docs/site/oldsite/images/index2.gif
trunk/docs/site/oldsite/images/minus.gif
trunk/docs/site/oldsite/images/mulgara_banner.gif
trunk/docs/site/oldsite/images/next.gif
trunk/docs/site/oldsite/images/obook.gif
trunk/docs/site/oldsite/images/plus.gif
trunk/docs/site/oldsite/images/previous.gif
trunk/docs/site/oldsite/images/space.gif
trunk/docs/site/oldsite/images/tail.gif
trunk/docs/site/oldsite/images/tucana logo.gif
trunk/docs/site/oldsite/images/whitespace.gif
trunk/docs/site/oldsite/news.html
trunk/docs/site/oldsite/styles/
trunk/docs/site/oldsite/styles/mulgara_stylesheet.css
trunk/docs/site/oldsite/svn187/
trunk/docs/site/oldsite/svn187/187.htm.mine
trunk/docs/site/oldsite/svn187/187.htm.r139
trunk/docs/site/oldsite/svn187/187.htm.r91
trunk/docs/site/overview/
trunk/docs/site/overview/about.html
trunk/docs/site/overview/aboutsite.html
trunk/docs/site/overview/contact.html
trunk/docs/site/overview/convertingxml.html
trunk/docs/site/overview/convertrdbms.html
trunk/docs/site/overview/downloads.html
trunk/docs/site/overview/faq.html
trunk/docs/site/overview/history.html
trunk/docs/site/overview/includeTOC.inc
trunk/docs/site/overview/index.html
trunk/docs/site/overview/install.html
trunk/docs/site/overview/itql.html
trunk/docs/site/overview/itqlbasics.html
trunk/docs/site/overview/itqlshellsession.html
trunk/docs/site/overview/krule.html
trunk/docs/site/overview/legal.html
trunk/docs/site/overview/legalinfo.html
trunk/docs/site/overview/license.html
trunk/docs/site/overview/links.html
trunk/docs/site/overview/loadingrdf.html
trunk/docs/site/overview/optcomponents.html
trunk/docs/site/overview/oscomponents.html
trunk/docs/site/overview/starting.html
trunk/docs/site/overview/suncomponents.html
trunk/docs/site/overview/sysreq.html
trunk/docs/site/overview/tools.html
trunk/docs/site/overview/trademarks.html
trunk/docs/site/overview/tutorial.html
trunk/docs/site/overview/viewer.html
trunk/docs/site/resolvers/
trunk/docs/site/resolvers/includeTOC.inc
trunk/docs/site/resolvers/index.html
trunk/docs/site/resolvers/resolverdbclass.html
trunk/docs/site/script/
trunk/docs/site/script/bodyswitcher.js
trunk/docs/site/style/
trunk/docs/site/style/oldStyle.css
trunk/docs/site/style/style.css
trunk/docs/site/style/styleIE6.css
trunk/docs/site/system/
trunk/docs/site/system/driver.html
trunk/docs/site/system/includeTOC.inc
trunk/docs/site/system/index.html
trunk/docs/site/system/itqlbean.html
trunk/docs/site/system/itqlshell.html
trunk/docs/site/system/jrdf.html
trunk/docs/site/system/jrdfapis.html
trunk/docs/site/system/jrdfconcol.html
trunk/docs/site/system/jrdfexamples.html
trunk/docs/site/system/jrdfgraphs.html
trunk/docs/site/system/jrdfmemory.html
trunk/docs/site/system/jrdftks.html
trunk/docs/site/system/jrdfvisitor.html
trunk/docs/site/system/jsptaglib.html
trunk/docs/site/system/soap.html
trunk/docs/site/template.html
trunk/docs/site/toc.html
Log:
importing the revamped documentation
Added: trunk/docs/site/backofbook.html
===================================================================
--- trunk/docs/site/backofbook.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/backofbook.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,465 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Index</title>
+ <meta name="keywords" content="Index, Descriptor, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+ <h1>Index</h1>
+
+ <div class="anchor"><a name="_top_"> </a></div>
+
+
+ <div class="indexatoz">
+ <a href="#65">A</a>
+ <a href="#66">B</a>
+ <a href="#67">C</a>
+ <a href="#68">D</a>
+ <a href="#69">E</a>
+ <a href="#70">F</a>
+ <a href="#71">G</a>
+ <a href="#72">H</a>
+ <a href="#73">I</a>
+ <a href="#74">J</a>
+ <a href="#75">K</a>
+ <a href="#76">L</a>
+ <a href="#77">M</a>
+ <a href="#78">N</a>
+ <a href="#79">O</a>
+ <a href="#80">P</a>
+ <a href="#81">Q</a>
+ <a href="#82">R</a>
+ <a href="#83">S</a>
+ <a href="#84">T</a>
+ <a href="#85">U</a>
+ <a href="#86">V</a>
+ <a href="#87">W</a>
+ X
+ Y
+ Z
+ </div>
+
+ <div id="indexlist">
+ <div class="indexlist">
+ <a href="/overview/index.html#o1024">64-bit Data Structures</a><br />
+ </div>
+ <div class="indexanchor"><a name="65">A</a></div>
+ <div class="indexlist">
+ <a href="/overview/about.html">About the Mulgara Project</a><br />
+ <a href="/overview/aboutsite.html">About this site</a><br />
+ <a href="/overview/aboutsite.html#access">Accessibility</a><br />
+ <a href="/integration/jrdfaddtriples.html">Adding Triples to the Graph</a><br />
+ <a href="/inferencing/infersemweb.html#o2647">Additional Features for Describing Classes and Properties</a><br />
+ <a href="254.htm">Advanced iTQL Operations</a><br />
+ <a href="/descriptors/descadvantages.html">Advantages and Disadvantages of Descriptors</a><br />
+ <a href="/itqlcommands/alias.html">alias</a><br />
+ <a href="/inferencing/infermulgara.html#o2730">An Example</a><br />
+ <a href="/system/jsptaglib.html#o493">answer</a><br />
+ <a href="/overview/faq.html#o1051">Applications built with Mulgara</a><br />
+ <a href="/itqlcommands/select.html#o1531">Assigning a Value to a Variable (mulgara:is)</a><br />
+ <a href="/overview/faq.html#o1052">Available APIs</a><br />
+ <a href="/integration/jena.html#o3187">Available Jena Interfaces</a><br />
+ <a href="/overview/faq.html#o1053">Available Versions</a>
+ </div>
+ <div class="indexanchor"><a name="66">B</a></div>
+ <div class="indexlist">
+ <a href="/itqlcommands/backup.html">backup</a><br />
+ <a href="/inferencing/infermulgara.html#o2727">Base Model</a><br />
+ <a href="/overview/itqlbasics.html">Basic iTQL Operations</a><br />
+ <a href="/integration/jsptutorial.html#o991">Before you Begin</a><br />
+ <a href="/system/jrdfgraphs.html#o2475">BlankNodes</a><br />
+ <a href="/overview/contact.html#bugs">Bug Reports and Feature Requests</a><br />
+ <a href="/overview/install.html#o1143">Build Targets</a><br />
+ <a href="/overview/faq.html#o1054">Building applications with Mulgara</a><br />
+ <a href="/system/jrdfvisitor.html">Built-in Visitor Pattern</a>
+ </div>
+ <div class="indexanchor"><a name="67">C</a></div>
+ <div class="indexlist">
+ <a href="/inferencing/consistency.html#o2820">Cardinality Operations</a><br />
+ <a href="/inferencing/sofa.html#o2627">Changing the Backing of an Ontology</a><br />
+ <a href="/overview/install.html#o1142">Checkout Setup</a><br />
+ <a href="/inferencing/entailment.html#o2934">Class Equivalence</a><br />
+ <a href="/inferencing/infersemweb.html#o2645">Classes</a><br />
+ <a href="/itqlcommands/comment.html">comment (#)</a><br />
+ <a href="/itqlcommands/commit.html">commit</a><br />
+ <a href="/descriptors/mistakes.html">Common Mistakes</a><br />
+ <a href="/integration/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations</a><br />
+ <a href="/inferencing/sofa.html#o2639">Compiling and Running the Example</a><br />
+ <a href="/integration/compiling.html">Compiling with Ant</a><br />
+ <a href="/integration/parsers.html#o2704">Configuration and Initialisation</a><br />
+ <a href="/system/jsptaglib.html#o487">Configuring your Web Application</a><br />
+ <a href="/overview/index.html#o1025">Connectivity</a><br />
+ <a href="/inferencing/consistency.html">Consistency Checking</a><br />
+ <a href="/overview/contact.html">Contact Information</a><br />
+ <a href="/system/jrdfconcol.html">Containers and Collections</a><br />
+ <a href="/integration/contenthandlers.html">Content Handlers</a><br />
+ <a href="/integration/resolverwrapper.html">Content Wrappers</a><br />
+ <a href="/overview/convertrdbms.html">Converting Data in Relational Databases to RDF</a><br />
+ <a href="/overview/convertingxml.html">Converting XML Data to RDF</a><br />
+ <a href="/overview/aboutsite.html#copyright">Copyright</a><br />
+ <a href="/itqlcommands/select.html#o194">count Function</a><br />
+ <a href="/itqlcommands/create.html">create</a><br />
+ <a href="/system/jrdfexamples.html#o2515">Create a JRDF Graph and add Triples</a><br />
+ <a href="/system/jrdfexamples.html#o2524">Create a JRDF Graph from the Results</a><br />
+ <a href="/system/jrdfexamples.html#o2520">Create a Mulgara Backed JRDF Graph</a><br />
+ <a href="/system/jrdfexamples.html#o2519">Create a Mulgara Session</a><br />
+ <a href="/itqloperations/datatypingmodels.html#o263">Creating Datatyping Models</a><br />
+ <a href="/itqloperations/filesysmodel.html#o3202">Creating Filesystem Models</a><br />
+ <a href="/itqloperations/fulltextmodels.html#o258">Creating Full-Text Models</a><br />
+ <a href="/overview/itqlbasics.html#o231">Creating New Models</a><br />
+ <a href="/integration/jrdfcreatenodes.html">Creating Nodes and Triples</a><br />
+ <a href="/itqloperations/nodetyping.html#o2780">Creating Nodetyping Models</a><br />
+ <a href="/integration/jena.html#o3186">Creating Sessions</a><br />
+ <a href="/integration/jrdfcreategraph.html">Creating the Graph</a><br />
+ <a href="/inferencing/sofa.html#o2626">Creating the Ontology</a><br />
+ <a href="/itqloperations/views.html#o3012">Creating Views</a><br />
+ <a href="/overview/index.html#o1026">Cross OS/Platform Support</a><br />
+ <a href="/inferencing/infersitu.html">Current Situation</a>
+ </div>
+ <div class="indexanchor"><a name="68">D</a></div>
+ <div class="indexlist">
+ <a href="/itqloperations/datatypingmodels.html">Datatyping Models</a><br />
+ <a href="/itqlcommands/delete.html">delete</a><br />
+ <a href="/integration/jsptutorial.html#o995">Deploy the JSPs</a><br />
+ <a href="/descriptors/descriptorex.html">Descriptor Examples</a><br />
+ <a href="/descriptors/index.html">Descriptors</a><br />
+ <a href="/descriptors/descriptorsfaq.html">Descriptors FAQ</a><br />
+ <a href="/integration/jsptutorial.html#o994">Develop the JSPs</a><br />
+ <a href="/overview/contact.html#developers">Developers</a><br />
+ <a href="/integration/contenthandlersdev.html">Developing Content Handlers</a><br />
+ <a href="/integration/resolveprot.html">Developing Protocol Resolvers</a><br />
+ <a href="/system/jrdfexamples.html#o2521">Display iTQL Results as an JRDF Graph</a><br />
+ <a href="/index.html#o1010">Documentation</a><br />
+ <a href="/inferencing/infersemweb.html#o3018">Domains</a><br />
+ <a href="/overview/faq.html#o1055">Downloading</a><br />
+ <a href="/index.html#o1011">Downloads</a><br />
+ <a href="/itqlcommands/drop.html">drop</a>
+ </div>
+ <div class="indexanchor"><a name="69">E</a></div>
+ <div class="indexlist">
+ <a href="/inferencing/infersemweb.html#o2644">Elements of the Semantic Web</a><br />
+ <a href="/inferencing/entailment.html">Entailment</a><br />
+ <a href="/overview/viewer.html#o738">Example Commands</a><br />
+ <a href="/overview/itqlshellsession.html">Example iTQL Shell Session</a><br />
+ <a href="/system/jrdfexamples.html">Examples</a><br />
+ <a href="/integration/jena.html#o950">Exceptions and Logging</a><br />
+ <a href="/itqlcommands/select.html#o2768">exclude Function</a><br />
+ <a href="/itqlcommands/select.html#o2770">exclude($s $p $o)</a><br />
+ <a href="/itqlcommands/execute.html">execute</a><br />
+ <a href="/system/jrdfexamples.html#o2523">Execute an iTQL Query</a><br />
+ <a href="/resolvers/resolverdbclass.html#o2560">External Resolvers</a>
+ </div>
+ <div class="indexanchor"><a name="70">F</a></div>
+ <div class="indexlist">
+ <a href="/integration/resolverfactories.html">Factories</a><br />
+ <a href="/itqloperations/filesysmodel.html">Filesystem Models</a><br />
+ <a href="/inferencing/infersitu.html#o3015">First Search</a><br />
+ <a href="/itqlcommands/select.html#o189">from Clause</a><br />
+ <a href="/itqloperations/fulltextmodels.html">Full-Text Models</a>
+ </div>
+ <div class="indexanchor"><a name="71">G</a></div>
+ <div class="indexlist">
+ <a href="/overview/index.html#o1028">General</a><br />
+ <a href="/overview/install.html#o1144">Generating Mulgara javadoc</a><br />
+ <a href="/overview/install.html#o1145">Generating the Server and the iTQL Shell</a><br />
+ <a href="/inferencing/sofa.html#o2625">Getting Started</a><br />
+ <a href="/system/jrdfgraphs.html#o2478">GraphElementFactory</a>
+ </div>
+ <div class="indexanchor"><a name="72">H</a></div>
+ <div class="indexlist">
+ <a href="/overview/faq.html#o1056">Hardware</a><br />
+ <a href="/itqlcommands/select.html#o2776">having Clause</a><br />
+ <a href="/descriptors/descriptorhw.html">Hello World Descriptor</a><br />
+ <a href="/itqlcommands/help.html">help</a><br />
+ <a href="/overview/faq.html#o1057">How do I pronounce it?</a><br />
+ <a href="/overview/aboutsite.html#htmlcss">HTML and CSS</a><br />
+ <a href="/integration/resolverhttpmp3.html">HTTP Resolver and MP3 Content Handler Tutorial</a>
+ </div>
+ <div class="indexanchor"><a name="73">I</a></div>
+ <div class="indexlist">
+ <a href="/inferencing/infersemweb.html#o2648">Implementing Inferencing</a><br />
+ <a href="/integration/statements.html#o2952">Implementing the Interface</a><br />
+ <a href="/itqlcommands/select.html#o1530">in Specifier</a><br />
+ <a href="/inferencing/entailment.html#o2946">Inconsistencies</a><br />
+ <a href="/inferencing/infermulgara.html#o2729">Inference Model</a><br />
+ <a href="/inferencing/index.html">Inferencing</a><br />
+ <a href="/inferencing/infermulgara.html">Inferencing and Mulgara</a><br />
+ <a href="/inferencing/inferexample.html">Inferencing Examples Using SOFA and iTQL</a><br />
+ <a href="/system/jsptaglib.html#o488">init</a><br />
+ <a href="/itqlcommands/insert.html">insert</a><br />
+ <a href="/overview/itqlbasics.html#o232">Inserting and Deleting Statements</a><br />
+ <a href="/overview/faq.html#o1058">Installation</a><br />
+ <a href="/overview/install.html">Installation Guide</a><br />
+ <a href="/overview/install.html#o1141">Installing Java</a><br />
+ <a href="/integration/integrate.html">Integrating into Mulgara</a><br />
+ <a href="/inferencing/sofa.html#o2629">Integration</a><br />
+ <a href="/integration/index.html">Integration Tutorials</a><br />
+ <a href="/resolvers/resolverdbclass.html#o2559">Internal Resolvers</a><br />
+ <a href="/inferencing/inferintro.html">Introduction to Inferencing</a><br />
+ <a href="/overview/faq.html#o1059">Is Mulgara secure?</a><br />
+ <a href="/overview/itql.html">iTQL</a><br />
+ <a href="/system/itqlbean.html">iTQL Bean</a><br />
+ <a href="/itqlcommands/index.html">iTQL Commands</a><br />
+ <a href="/inferencing/inferexample.html#o2734">iTQL Inferencing</a><br />
+ <a href="/system/itqlshell.html">iTQL Shell</a>
+ </div>
+ <div class="indexanchor"><a name="74">J</a></div>
+ <div class="indexlist">
+ <a href="/system/jrdf.html">Java RDF (JRDF)</a><br />
+ <a href="/overview/install.html#o1256">Java System Properties</a><br />
+ <a href="/integration/jsptutorial.html">JavaServer Pages Tag Library</a><br />
+ <a href="/integration/jena.html">Jena</a><br />
+ <a href="/system/jrdfapis.html">JRDF APIs</a><br />
+ <a href="/integration/jrdfcreategraph.html#o2901">JRDF Graph (Memory Graph)</a><br />
+ <a href="/system/jrdfexamples.html#o2514">JRDF Graph (Memory)</a><br />
+ <a href="/system/jrdfgraphs.html">JRDF Graphs</a><br />
+ <a href="/system/jrdfmemory.html">JRDF Memory Implementation</a><br />
+ <a href="/integration/jrdftutorial.html">JRDF Tutorial</a>
+ </div>
+ <div class="indexanchor"><a name="75">K</a></div>
+ <div class="indexlist">
+ <a href="/index.html">Mulgara | Semantic Store</a><br />
+ <a href="/overview/faq.html#o1060">Mulgara and RDF</a><br />
+ <a href="/system/jrdfexamples.html#o2518">Mulgara Backed JRDF Graph (Client)</a><br />
+ <a href="/overview/install.html#o2581">Mulgara Command Line Options</a><br />
+ <a href="/overview/install.html#o402">Mulgara Configuration File</a><br />
+ <a href="/overview/index.html#semstore">Mulgara Documentation</a><br />
+ <a href="/overview/downloads.html">Mulgara Downloads</a><br />
+ <a href="/system/driver.html">Mulgara Driver</a><br />
+ <a href="/overview/faq.html">Mulgara FAQ</a><br />
+ <a href="/overview/legal.html">Mulgara Legal Statements</a><br />
+ <a href="/overview/faq.html#o1062">Mulgara Lite</a><br />
+ <a href="/overview/index.html#overview">Mulgara Overview</a><br />
+ <a href="/overview/viewer.html#o416">Mulgara Sample Data</a><br />
+ <a href="1081.htm">Mulgara Tools</a><br />
+ <a href="/overview/tutorial.html">Mulgara Tutorial</a><br />
+ <a href="/overview/viewer.html">Mulgara Viewer</a>
+ </div>
+ <div class="indexanchor"><a name="76">L</a></div>
+ <div class="indexlist">
+ <a href="/overview/legalinfo.html">Legal Information</a><br />
+ <a href="/index.html#o1013">Licence</a><br />
+ <a href="/overview/license.html">License</a><br />
+ <a href="/itqlcommands/select.html#o191">limit Clause</a><br />
+ <a href="/itqloperations/datatypingmodels.html#o266">Limitations of Datatyping Models</a><br />
+ <a href="/itqloperations/fulltextmodels.html#o261">Limitations of Full-Text Models</a><br />
+ <a href="/itqloperations/views.html#o256">Limitations of Views</a><br />
+ <a href="/overview/links.html">Links to Other Resources</a><br />
+ <a href="/descriptors/descriptorlist.html">List Models Descriptor</a><br />
+ <a href="/system/jrdfgraphs.html#o2476">Literals</a><br />
+ <a href="/itqlcommands/load.html">load</a><br />
+ <a href="/integration/jsptutorial.html#o993">Load the Sample Data</a><br />
+ <a href="/itqloperations/datatypingmodels.html#o264">Loading Datatyping Models</a><br />
+ <a href="/overview/loadingrdf.html">Loading Existing RDF Data</a><br />
+ <a href="/overview/itqlbasics.html#o233">Loading Statements</a>
+ </div>
+ <div class="indexanchor"><a name="77">M</a></div>
+ <div class="indexlist">
+ <a href="/overview/contact.html#mailing">Mailing Lists</a><br />
+ <a href="/overview/index.html#o1029">Manageability</a><br />
+ <a href="/inferencing/infermulgara.html#o2726">Models Required</a><br />
+ <a href="/itqloperations/fulltextmodels.html#o259">Modifying Full-Text Models</a><br />
+ <a href="/overview/index.html#o1030">Multiple Sessions with no Lock Contention</a>
+ </div>
+ <div class="indexanchor"><a name="78">N</a></div>
+ <div class="indexlist">
+ <a href="/descriptors/nsdesc.html">Namespaces and Descriptors</a><br />
+ <a href="/resolvers/resolverdbclass.html#o2554">Node Pools</a><br />
+ <a href="/itqloperations/nodetyping.html">Nodetyping Models</a><br />
+ <a href="/inferencing/entailment.html#o2937">Note on Consistency Checking and Inferences</a>
+ </div>
+ <div class="indexanchor"><a name="79">O</a></div>
+ <div class="indexlist">
+ <a href="/system/jrdfgraphs.html#o2473">ObjectNodes</a><br />
+ <a href="/integration/jrdfprereq.html#o2898">Obtaining a Session from a Mulgara Server</a><br />
+ <a href="/itqlcommands/select.html#o192">offset Clause</a><br />
+ <a href="/overview/index.html#o1032">On-Line Backups</a><br />
+ <a href="/inferencing/ontomanage.html">Ontology Management</a><br />
+ <a href="/overview/oscomponents.html">Open Source Components</a><br />
+ <a href="/integration/jsptutorial.html#o996">Open the Application</a><br />
+ <a href="/overview/faq.html#o1063">Operating systems</a><br />
+ <a href="/itqlcommands/select.html#o190">order by Clause</a><br />
+ <a href="/inferencing/owl.html">OWL-Lite Operations Using iTQL</a><br />
+ <a href="/inferencing/entailment.html#o2802">owl:AllDifferent</a><br />
+ <a href="/inferencing/consistency.html#o2818">owl:allValuesFrom</a><br />
+ <a href="/inferencing/ontomanage.html#o2828">owl:AnnotationProperty</a><br />
+ <a href="/inferencing/ontomanage.html#o2829">owl:backwardCompatibleWith</a><br />
+ <a href="/inferencing/consistency.html#o2821">owl:cardinality</a><br />
+ <a href="/inferencing/entailment.html#o2804">owl:Class</a><br />
+ <a href="/inferencing/ontomanage.html#o2830">owl:DeprecatedClass</a><br />
+ <a href="/inferencing/ontomanage.html#o2831">owl:DeprecatedProperty</a><br />
+ <a href="/inferencing/entailment.html#o2808">owl:differentFrom</a><br />
+ <a href="/inferencing/entailment.html#o2803">owl:distinctMembers</a><br />
+ <a href="/inferencing/entailment.html#o2813">owl:equivalentClass</a><br />
+ <a href="/inferencing/entailment.html#o2814">owl:equivalentProperty</a><br />
+ <a href="/inferencing/entailment.html#o2805">owl:FunctionalProperty</a><br />
+ <a href="/inferencing/ontomanage.html#o2832">owl:imports</a><br />
+ <a href="/inferencing/ontomanage.html#o2833">owl:incompatibleWith</a><br />
+ <a href="/inferencing/entailment.html#o2815">owl:intersectionOf</a><br />
+ <a href="/inferencing/entailment.html#o2807">owl:InverseFunctionalProperty</a><br />
+ <a href="/inferencing/entailment.html#o2809">owl:inverseOf</a><br />
+ <a href="/inferencing/consistency.html#o2823">owl:maximumCardinality</a><br />
+ <a href="/inferencing/consistency.html#o2822">owl:minimumCardinality</a><br />
+ <a href="/inferencing/consistency.html#o2824">owl:Nothing</a><br />
+ <a href="/inferencing/ontomanage.html#o2834">owl:Ontology</a><br />
+ <a href="/inferencing/ontomanage.html#o2835">owl:OntologyProperty</a><br />
+ <a href="/inferencing/ontomanage.html#o2836">owl:priorVersion</a><br />
+ <a href="/inferencing/consistency.html#o2825">owl:Restriction</a><br />
+ <a href="/inferencing/entailment.html#o2930">owl:sameAs</a><br />
+ <a href="/inferencing/consistency.html#o2819">owl:someValuesFrom</a><br />
+ <a href="/inferencing/entailment.html#o2811">owl:SymmetricProperty</a><br />
+ <a href="/inferencing/consistency.html#o2826">owl:Thing</a><br />
+ <a href="/inferencing/entailment.html#o2812">owl:TransitiveProperty</a><br />
+ <a href="/inferencing/ontomanage.html#o2837">owl:versionInfo</a>
+ </div>
+ <div class="indexanchor"><a name="80">P</a></div>
+ <div class="indexlist">
+ <a href="/integration/parsers.html">Parsers</a><br />
+ <a href="/overview/index.html#o1033">Performance and Scalability</a><br />
+ <a href="/integration/perl.html">Perl</a><br />
+ <a href="/overview/index.html#o1034">Permanent Integrity</a><br />
+ <a href="/resolvers/resolverdbclass.html#o2557">Persistent Pools</a><br />
+ <a href="/inferencing/sofa.html#o2628">Populating the Ontology</a><br />
+ <a href="/integration/jena.html#o952">Porting an Existing Jena Application</a><br />
+ <a href="/system/jrdfgraphs.html#o2472">PredicateNodes</a><br />
+ <a href="/inferencing/sofa.html#o2624">Prerequisites</a><br />
+ <a href="/integration/parsers.html#o2705">Processing ID3 Tags into RDF</a><br />
+ <a href="/inferencing/infersemweb.html#o2646">Properties</a><br />
+ <a href="/inferencing/entailment.html#o2935">Property Equivalence</a>
+ </div>
+ <div class="indexanchor"><a name="81">Q</a></div>
+ <div class="indexlist">
+ <a href="/overview/itqlbasics.html#o235">Queries</a><br />
+ <a href="/system/jsptaglib.html#o491">query</a><br />
+ <a href="/system/jrdfexamples.html#o2516">Query the JRDF Graph</a><br />
+ <a href="/system/jrdfgraphs.html#o2479">Querying a JRDF Graph</a><br />
+ <a href="/itqloperations/datatypingmodels.html#o265">Querying Datatyping Models</a><br />
+ <a href="/itqloperations/filesysmodel.html#o3203">Querying Filesystem Models</a><br />
+ <a href="/itqloperations/fulltextmodels.html#o260">Querying Full-Text Models</a><br />
+ <a href="/itqloperations/nodetyping.html#o2781">Querying Nodetyping Models</a><br />
+ <a href="/itqloperations/views.html#o3013">Querying View Definitions</a><br />
+ <a href="/itqlcommands/quit.html">quit</a>
+ </div>
+ <div class="indexanchor"><a name="82">R</a></div>
+ <div class="indexlist">
+ <a href="/inferencing/infersemweb.html#o3019">Ranges</a><br />
+ <a href="/overview/links.html#o759">RDF Data</a><br />
+ <a href="/overview/links.html#o753">RDF Training</a><br />
+ <a href="/integration/jrdfcreategraph.html#o2903">Read Only iTQL Result JRDF Graph (iTQL Graph)</a><br />
+ <a href="/inferencing/entailment.html#o2932">Reflexivity</a><br />
+ <a href="/integration/jrdfreify.html">Reify Triples</a><br />
+ <a href="/overview/faq.html#o1064">Relational databases</a><br />
+ <a href="/overview/index.html#o1035">Reliability</a><br />
+ <a href="/system/jrdfexamples.html#o2517">Remove a Triple from the JRDF Graph</a><br />
+ <a href="/overview/itqlbasics.html#o234">Removing Models</a><br />
+ <a href="/integration/jrdfremove.html">Removing Triples from the Graph</a><br />
+ <a href="/system/jsptaglib.html#o489">render</a><br />
+ <a href="/descriptors/reserved.html">Reserved Parameters</a><br />
+ <a href="/resolvers/resolverdbclass.html">Resolver Database Class</a><br />
+ <a href="/integration/resolverwrite.html">Resolvers</a><br />
+ <a href="/itqlcommands/restore.html">restore</a><br />
+ <a href="/inferencing/consistency.html#o2817">Restricting Data Types</a><br />
+ <a href="/itqlcommands/rollback.html">rollback</a><br />
+ <a href="/overview/install.html#o1146">Running a Mulgara Server</a><br />
+ <a href="/overview/faq.html#o1065">Running Mulgara</a><br />
+ <a href="/overview/install.html#o1148">Running the Test Cases</a>
+ </div>
+ <div class="indexanchor"><a name="83">S</a></div>
+ <div class="indexlist">
+ <a href="/overview/index.html#o1020">Scalability</a><br />
+ <a href="/inferencing/infermulgara.html#o2728">Schema Model</a><br />
+ <a href="/integration/searchgraph.html">Searching the Graph</a><br />
+ <a href="/inferencing/infersitu.html#o3016">Second Search</a><br />
+ <a href="/itqlcommands/select.html">select</a><br />
+ <a href="/itqlcommands/select.html#o188">select Clause</a><br />
+ <a href="/inferencing/infersemweb.html">Semantic Web</a><br />
+ <a href="/integration/jrdfcreategraph.html#o2902">Server Backed JRDF Graph (Client Graph)</a><br />
+ <a href="/integration/jrdfcreategraph.html#o3189">Server-side JRDF Graph (Server Graph)</a><br />
+ <a href="/itqlcommands/set.html">set</a><br />
+ <a href="/inferencing/inferexample.html#o2736">Should I use SOFA or iTQL?</a><br />
+ <a href="/system/soap.html">Simple Object Access Protocol (SOAP)</a><br />
+ <a href="/inferencing/sofa.html">SOFA</a><br />
+ <a href="/inferencing/inferexample.html#o2735">SOFA Inferencing</a><br />
+ <a href="/system/jsptaglib.html#o486">Software Requirements</a><br />
+ <a href="/itqlcommands/select.html#o2769">Standard Queries</a><br />
+ <a href="/overview/starting.html">Starting a Mulgara Semantic Store Server</a><br />
+ <a href="/system/jsptaglib.html#o490">statement</a><br />
+ <a href="/integration/statements.html">Statements</a><br />
+ <a href="/integration/parsers.html#o2706">Storing Data</a><br />
+ <a href="/resolvers/resolverdbclass.html#o2555">String Pools</a><br />
+ <a href="/system/jrdfgraphs.html#o2471">SubjectNodes</a><br />
+ <a href="/itqlcommands/select.html#o2771">Subqueries</a><br />
+ <a href="/itqlcommands/select.html#o193">subquery Function</a><br />
+ <a href="/inferencing/infersummery.html">Summary</a><br />
+ <a href="/overview/suncomponents.html">Sun Microsystems Components</a><br />
+ <a href="/overview/contact.html#support">Support</a><br />
+ <a href="/overview/optcomponents.html">Supporting Optional Packages</a><br />
+ <a href="/inferencing/entailment.html#o2945">Symmetry</a><br />
+ <a href="/system/index.html">System Architecture</a><br />
+ <a href="/overview/sysreq.html">System Requirements</a><br />
+ <a href="/resolvers/resolverdbclass.html#o2558">System Resolver Factory</a>
+ </div>
+ <div class="indexanchor"><a name="84">T</a></div>
+ <div class="indexlist">
+ <a href="/overview/faq.html#o1066">Technologies</a><br />
+ <a href="/resolvers/resolverdbclass.html#o2556">Temporary Pools</a><br />
+ <a href="/descriptors/descriptortag.html">The <descriptor> Tag</a><br />
+ <a href="/descriptors/querytag.html">The <query> Tag</a><br />
+ <a href="/inferencing/infersitu.html#o3017">Third Search</a><br />
+ <a href="/integration/jena.html#o951">Threading</a><br />
+ <a href="/system/jrdftks.html">TKS Client Support</a><br />
+ <a href="/overview/trademarks.html">Trademarks</a><br />
+ <a href="/itqlcommands/select.html#o1535">Transitive Closure (trans Function)</a><br />
+ <a href="/inferencing/entailment.html#o2931">Transitivity</a><br />
+ <a href="/itqlcommands/select.html#o1532">Traversing a Graph (walk Function)</a><br />
+ <a href="/system/jrdfconcol.html#o2527">Triple Factory</a><br />
+ <a href="/system/jrdfgraphs.html#o2470">Triples</a><br />
+ <a href="/descriptors/descriptorvcard.html#o921">Try the VCards Example</a><br />
+ <a href="/system/jrdfvisitor.html#o2529">TypedNodeVisitable</a><br />
+ <a href="/system/jrdfvisitor.html#o2530">TypedNodeVisitor</a>
+ </div>
+ <div class="indexanchor"><a name="85">U</a></div>
+ <div class="indexlist">
+ <a href="/itqloperations/filesysmodel.html#o3204">Updating Filesystem Models</a><br />
+ <a href="/system/jrdfgraphs.html#o2474">URIReferences</a><br />
+ <a href="/overview/index.html#o1036">Use of Java NIO</a><br />
+ <a href="/integration/jena.html#o949">Using Iterators</a><br />
+ <a href="/integration/jena.html#o3188">Using the Jena Maker Interfaces</a>
+ </div>
+ <div class="indexanchor"><a name="86">V</a></div>
+ <div class="indexlist">
+ <a href="/descriptors/descriptorvcard.html">VCard Descriptors</a><br />
+ <a href="/itqloperations/views.html">Views</a>
+ </div>
+ <div class="indexanchor"><a name="87">W</a></div>
+ <div class="indexlist">
+ <a href="/descriptors/descwhat.html">What are Descriptors?</a><br />
+ <a href="/overview/faq.html#o1067">What is a Mulgara?</a><br />
+ <a href="/overview/faq.html#o1068">What is Mulgara?</a><br />
+ <a href="/itqlcommands/select.html#o197">where Clause</a><br />
+ <a href="/descriptors/descriptorlist.html#o803">Where To From Here?</a><br />
+ <a href="/integration/resolverfactories.html#o2692">Writing a Factory</a><br />
+ <a href="/integration/resolverwrite.html#o2950">Writing a Resolver</a><br />
+ </div>
+
+ </div>
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
\ No newline at end of file
Added: trunk/docs/site/descriptors/descadvantages.html
===================================================================
--- trunk/docs/site/descriptors/descadvantages.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/descriptors/descadvantages.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,71 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Advantages and Disadvantages of Descriptors</title>
+ <meta name="keywords" content="Advantages and Disadvantages of Descriptors, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/descriptors/descwhat.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/descriptors/nsdesc.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/descriptors/index.html">Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/descwhat.html">What are Descriptors?</a></p>
+<p class="relateditem"><a href="/descriptors/nsdesc.html">Namespaces and Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/querytag.html">The <query> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/descriptortag.html">The <descriptor> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/reserved.html">Reserved Parameters</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorsfaq.html">Descriptors FAQ</a></p>
+<p class="relateditem"><a href="/descriptors/mistakes.html">Common Mistakes</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorex.html">Descriptor Examples</a></p>
+
+ -->
+
+
+
+
+<h2>Advantages and Disadvantages of Descriptors</h2>
+
+<p>The advantages of working with Descriptors over using APIs include:</p>
+<ul><li>You can define an interface for a client while allowing the implementation to evolve, even at runtime. That is, you can have live development using loosely coupled components.</li><li>Descriptors are referenced as URLs, so Mulgara servers can use Descriptors from remote machines.</li><li>Descriptor interfaces are well defined in RDF, so humans or applications can discover Descriptors that meet their needs.</li><li>Descriptors are SOAP accessible and described in WSDL, and are therefore usable from other languages and platforms such as Perl, Microsoft<sup>®</sup> Visual Basic<sup>®</sup> and the Microsoft .NET Framework.</li><li>Descriptors are fast because they use optimized XSL objects and queries are performed on the server. They are not much slower than working with APIs directly.</li></ul>
+<div class="anchor"><a name="o3130"> </a></div>
+
+
+<p>The disadvantages of <em>developing</em> Descriptors include:</p>
+<ul><li>Developing Descriptors requires knowledge of XSL.</li><li>Debugging Descriptors is difficult when using deeply embedded Descriptors due to the layers of components involved.</li><li>Large XML results have higher memory and CPU requirements than when using APIs directly.</li></ul>
+<div class="anchor"><a name="o3131"> </a></div>
+
+
+<p>The disadvantages of <em>using</em> Descriptors include:</p>
+<ul><li>Only string parameters are allowed, although this may change in the future to support complex data types.</li><li>Session type functionality is not available when developing HTML web applications, unless used from the application server.</li><li>Descriptors declare their input parameters in a machine understandable format, but not their output capabilities.</li></ul>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/descriptors/descriptorex.html
===================================================================
--- trunk/docs/site/descriptors/descriptorex.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/descriptors/descriptorex.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,65 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Descriptor Examples</title>
+ <meta name="keywords" content="Descriptor Examples, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/descriptors/descriptorhw.html">Hello World Descriptor</a></p> |
+ <a href="/descriptors/descriptorlist.html">List Models Descriptor</a></p> |
+ <a href="/descriptors/descriptorvcard.html">VCard Descriptors</a></p>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/descriptors/mistakes.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/descriptors/descriptorhw.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/descriptors/index.html">Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/descwhat.html">What are Descriptors?</a></p>
+<p class="relateditem"><a href="/descriptors/descadvantages.html">Advantages and Disadvantages of Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/nsdesc.html">Namespaces and Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/querytag.html">The <query> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/descriptortag.html">The <descriptor> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/reserved.html">Reserved Parameters</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorsfaq.html">Descriptors FAQ</a></p>
+<p class="relateditem"><a href="/descriptors/mistakes.html">Common Mistakes</a></p>
+
+
+ -->
+
+
+
+
+<h2>Descriptor Examples</h2>
+
+<p>The following three examples walk through the steps on how to develop Descriptors:</p>
+<ol><li>Hello World. A simple Descriptor.</li><li>List Models. List the models in a Mulgara database.</li><li>VCards. Uses several Descriptors to generate a HTML page listing the VCards in a specified Mulgara model</li></ol>
+<p class="note"><strong>Note -</strong> Knowledge of the <a class="internetlinktemplate" title="" href="http://www.w3.org/style/xsl/">W3C Extensible Stylesheet Language</a> (XSL) is strongly recommended when developing Descriptors. Using Descriptors does not require any XSL knowledge.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/descriptors/descriptorhw.html
===================================================================
--- trunk/docs/site/descriptors/descriptorhw.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/descriptors/descriptorhw.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,164 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Hello World Descriptor</title>
+ <meta name="keywords" content="Hello World Descriptor, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="#o796">Where To From Here?</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/descriptors/descriptorex.html"><img src="/img/descriptorhwprevious.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/descriptors/descriptorlist.html"><img src="/img/descriptorhwnext.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+ -->
+
+
+
+<h3>Hello World Descriptor</h3>
+
+<p>The purpose of this example is to create and deploy a simple Descriptor that returns an HTML page with the text <code>Hello World</code>. The Descriptor does not query a Mulgara database, but the principles outlined in this tutorial also apply to more advanced Descriptor development.</p>
+
+<p>In this example you will to do the following:</p>
+<ul><li>Use the Create Descriptor Using Wizard task.</li><li>Add logic to output <code>Hello World</code> when the Descriptor is invoked.</li><li>Deploy the Descriptor into Mulgara.</li><li>Invoke the Descriptor.</li></ul>
+<p>Complete the following steps:</p>
+<ol><li>Start the Descriptor Wizard.
+<p class="listcontinue">The <a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a> is available from the <code>/descriptor</code> directory when Mulgara is running.</p>
+
+<p class="listcontinue">Use the Create Descriptor Using Wizard task to begin the Descriptor creation process. The Descriptor Wizard page displays.</p>
+
+<p class="listnote"><strong>Note -</strong> The wizard only creates a template. You need to edit the template, adding logic to issue iTQL<sup>TM</sup> commands or to call other Descriptors.</p>
+</li><li>Enter a Descriptor title.
+<p class="listcontinue">Enter a title that fully describes what the Descriptor does. Include information about the types of data it works on such as dates, people or VCards. Some example titles include:</p>
+<ul><li>Extracts Titles of Documents as XML using a specified URL</li><li>Returns an HTML table with 2 columns specifying the first and last names of all people mentioned in a Document matching a specified URL.</li><li>Returns an XML document showing all Companies mentioned in documents that also contain a specified Date range.
+<p class="listcontinue">For this example enter a title of Example Descriptor Returns 'Hello World' as HTML.</p>
+</li></ul></li><li>Enter Descriptor parameters.
+<p class="listcontinue">Parameters are variables required by the Descriptor or affect how the Descriptor operates. For example, if you want a list of all documents in a model, you can specify the model as a parameter, so that your Descriptor works on different models and machines.</p>
+
+<p class="listcontinue">This Descriptor does not need parameters, but most do.</p>
+
+<p class="listnote"><strong>Note -</strong> There is always one implicit parameter, <code>_self</code>. This parameter must always be the URL of the Descriptor.</p>
+</li><li>Enter the mime type.
+<p class="listcontinue">The mime type allows the Descriptor servlet, if used, to set the appropriate HTTP headers when returning data. Most importantly, it allows other Descriptors or applications to programmatically search for Descriptors that perform certain tasks. For example, an application could ask a Descriptor to find out everything about a certain person. The person Descriptor may return a VCard that the application does not know how to handle or render, so it searches for a Descriptor that works with VCards and returns HTML.</p>
+
+<p class="listcontinue">The mime type is optional but recommended. It should only be set to unknown if the Descriptor itself cannot know what kind of data it will return.</p>
+
+<p class="listcontinue">For this example choose text/html.</p>
+
+<p class="listcontinue">The Descriptor Wizard page should now look similar to the following:</p>
+
+<p class="listcontinue"><img src="/img/descriptorhw791.gif" alt="" height="722.95" width="696.35" vspace="0" hspace="0" align="bottom" border="1" /></p>
+</li><li>Generate the Descriptor Template.
+<p class="listcontinue">Click on the Generate Descriptor Template button.</p>
+
+<p class="listcontinue">If any required fields are blank, the Descriptor Wizard page redisplays.</p>
+</li><li>Save the Descriptor XSL file.
+<p class="listcontinue">Your browser now shows an XSL file, or it may ask you if you want to download it. In either case, save the file where you can edit it. Save it as helloworld.xsl.</p>
+</li><li>Edit the Descriptor XSL file.
+<p class="listcontinue">Using your preferred text editor, edit the Descriptor XSL file. Find the following commented section:</p>
+
+<p class="listcontinuecommandtext"><!-- INSERT DESCRIPTOR LOGIC HERE SUCH AS QUERIES, TRANSFORMATIONS AND CALLING OTHER DESCRIPTORS --></p>
+
+<p class="listcontinue">Replace this with the following HTML:</p>
+
+<p class="listcontinuecommandtext"><html><br />
+ <head><br />
+ <title>My First Descriptor</title><br />
+ </head><br />
+ <body><br />
+ Hello World!<br />
+ </body><br />
+</html></p>
+
+<p class="listcontinue">Save the file. You may want to check that the file is valid XML using a tool such as xmllint.</p>
+</li><li>Deploy the Descriptor in Mulgara.
+<p class="listcontinue">To use a Descriptor it must be deployed in a Mulgara database. The RDF embedded in the Descriptor XSL file is loaded into a model in a Mulgara database.</p>
+
+<p class="listcontinue">Start an iTQL client.</p>
+
+<p class="listcontinue">Check if the Descriptor model already exists by querying for a list of models. For example:</p>
+
+<p class="listcontinuecommandtext">select $model from <rmi://mysite.com/server1#><br />
+ where $model <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mulgara.org/mulgara#Model>;</p>
+
+<p class="listnote"><strong>Note -</strong> Replace <code>mysite.com</code> with the fully qualified hostname (FQHN) of your machine/server.</p>
+
+<p class="listcontinue">If the <code>#descriptors</code> model does not exist then you need to deploy the local Descriptors. This will create the Descriptors model and load some useful Descriptors. It is one of the tasks available from the Descriptor Management page.</p>
+
+<p class="listcontinue">Create the Descriptor model. For example:</p>
+
+<p class="listcontinuecommandtext">create <rmi://mysite.com/server1#descriptors>;</p>
+
+<p class="listcontinue">Deploy the Descriptor by loading the Descriptor XSL file into the <code>#descriptor</code> model. For example:</p>
+
+<p class="listcontinuecommandtext">load <file:/helloworld.xsl> into <rmi://mysite.com/server1#descriptors>;</p>
+
+<p class="listnote"><strong>Note -</strong> The location of the Descriptor must be accessible by Mulgara. In Windows, the file specification would look something like <code><file:/C:/work/helloworld.xsl></code>.</p>
+
+<p class="listcontinue">If there were no errors in the XSL, then the Descriptor is deployed and available for use. If there were errors check your XML for bad syntax such as unclosed tags. The Descriptor Wizard generates correct XML and XSL.</p>
+</li><li>Invoke the Descriptor.
+<p class="listcontinue">There are several tools available to list, create and invoke Descriptors from the Descriptor Management page. Most of the tools, such as the Descriptor Wizard, are other Descriptors that are run by a Descriptor servlet.</p>
+
+<p class="listcontinue">From the Descriptor Management page choose the Lists all Descriptors on this Host task. The Mulgara Descriptor List displays.</p>
+
+<p class="listcontinue"><img src="/img/descriptorhw792.gif" alt="" height="92.15" width="679.25" vspace="0" hspace="0" align="bottom" border="1" /></p>
+
+<p class="listcontinue">Click on the Usage button for your Descriptor to see details about the Descriptor, similar to the window below.</p>
+
+<p class="listcontinue"><img src="/img/descriptorhw793.gif" alt="" height="728.65" width="682.1" vspace="0" hspace="0" align="bottom" border="1" /></p>
+
+<p class="listcontinue">Since there are no parameters (other than the implicit _self parameter and the usage parameter that returns the RDF of the XSL file), click on the Invoke button to invoke the Descriptor.</p>
+
+<p class="listcontinue">The result displays in a window similar to the following.</p>
+
+<p class="listcontinue"><img src="/img/descriptorhw794.gif" alt="" height="35.15" width="694.45" vspace="0" hspace="0" align="bottom" border="1" /></p>
+
+<p class="listcontinue">You have now successfully developed, deployed and invoked a Mulgara Descriptor.</p>
+</li></ol>
+
+<p class="relatedheading">In This Section</p>
+<p class="relateditem"><a href="/descriptors/descriptorhw.html#o796">Where To From Here?</a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/descriptors/descriptorex.html">Descriptor Examples</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorlist.html">List Models Descriptor</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorvcard.html">VCard Descriptors</a></p>
+
+<div class="anchor"><a name="o796"> </a></div>
+<h4>Where To From Here?</h4>
+
+<p>The real power of Descriptors is when you query Mulgara databases or call other Descriptor from within your Descriptor. Descriptors are fast, distributable and cross platform. They are capable of creating simple web applications, such as the Descriptor Wizard.</p>
+
+<p>Look at some of the bundled Descriptors for examples of sophisticated usage (you can click on the link to the source from the Descriptor List task from the Descriptor Management page).</p>
+
+<p>See the <a id="h930" class="documentlinktemplate" title="List Models Descriptor" href="/descriptors/descriptorlist.html">List Models</a> example for information on how to issue iTQL commands from within a Descriptor.</p>
+
+<p>See the <a id="h931" class="documentlinktemplate" title="VCard Descriptors" href="/descriptors/descriptorvcard.html">VCard</a> example for information on how to invoke one Descriptor from another.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/descriptors/descriptorlist.html
===================================================================
--- trunk/docs/site/descriptors/descriptorlist.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/descriptors/descriptorlist.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,247 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - List Models Descriptor</title>
+ <meta name="keywords" content="List Models Descriptor, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/descriptors/descriptorlist.html#o803">Where To From Here?</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/descriptors/descriptorhw.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/descriptors/descriptorvcard.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/descriptors/descriptorex.html">Descriptor Examples</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorhw.html">Hello World Descriptor</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorvcard.html">VCard Descriptors</a></p>
+ -->
+
+
+
+<h3>List Models Descriptor</h3>
+
+<p>The purpose of this tutorial is to create and deploy a Descriptor that returns an HTML page with a list of models available on a Mulgara database.</p>
+
+<p>In this tutorial you will to do the following:</p>
+<ul><li>Execute an iTQL<sup>TM</sup> command inside a Descriptor</li><li>Pass parameters to the iTQL command</li><li>Transform the query results into HTML</li></ul>
+<p class="note"><strong>Note -</strong> It is assumed have already completed the Hello World tutorial. If any steps in this tutorial are unclear refer back to the Hello World tutorial for a complete explanation.</p>
+
+<p>Complete the following steps:</p>
+<ol><li>Start the Descriptor Wizard.
+<p class="listcontinue">Use the Create Descriptor Using Wizard task from the <a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a>. The Descriptor Wizard page displays.</p>
+</li><li>Enter a Descriptor title.
+<p class="listcontinue">Enter a title of Lists models in a Mulgara Database as HTML.</p>
+</li><li>Enter Descriptor parameters.
+<p class="listcontinue">To make the Descriptor reusable across different Mulgara databases, enter a parameter of server. It is a string parameter.</p>
+</li><li>Enter the mime type of text/html.
+<p class="listcontinue">The Descriptor Wizard page should now look similar to the following:</p>
+
+<p class="listcontinue"><img src="/img/descriptorlist799.gif" alt="" height="686.85" width="703.95" vspace="0" hspace="0" align="bottom" border="1" /></p>
+</li><li>Generate the Descriptor template.
+<p class="listcontinue">Click on the Generate Descriptor Template button.</p>
+</li><li>Save the Descriptor XSL file.
+<p class="listcontinue">Your browser now shows an XSL file, or it may ask you if you want to download it. In either case, save the file where you can edit it. Save it as modellist.xsl.</p>
+</li><li>Edit the Descriptor XSL file.
+<p class="listcontinue">Using your preferred text editor, edit the Descriptor XSL file and change the main template rule at the top to look like this:</p>
+
+<p class="listcontinuecommandtext"><code> </code><!-- ============================================== --><br />
+ <!-- Match the Solution --><br />
+ <!-- ============================================== --><br />
+ <xsl:template match="/"><br />
+ <xsl:choose><br />
+ <xsl:when test="$_usage"><br />
+ <xsl:call-template name="usage"/><br />
+ </xsl:when><br />
+ <xsl:otherwise><br />
+<br />
+ <!-- store query answer in a variable called answer --><br />
+ <xsl:variable name="answer"><br />
+ <!-- Query for list of models on server --><br />
+ <mulgaraDescriptor:query server="{$server}"><br />
+ <![CDATA[<br />
+ select $model from <@@server@@#> where<br />
+ $model <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mulgara.org/mulgara#Model>;<br />
+ ]]><br />
+ </mulgaraDescriptor:query><br />
+ </xsl:variable><br />
+<br />
+ <!-- Now apply the templates to the answer --><br />
+ <xsl:copy-of select="xalan:nodeset($answer)/*"/><br />
+ <br />
+ </xsl:otherwise><br />
+ </xsl:choose><br />
+ </xsl:template></p>
+
+<p class="listcontinue">Several new concepts are introduced in this Descriptor as opposed to the Hello World Descriptor.</p>
+
+<p class="listcontinue"><strong>The <mulgaraDescriptor:query> Tag</strong></p>
+
+<p class="listcontinuecommandtext"><!-- Query for list of models on server --><br />
+ <mulgaraDescriptor:query server="{$server}"><br />
+ <![CDATA[<br />
+ select $model from <@@server@@> where<br />
+ $model <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mulgara.org/mulgara#Model>;<br />
+ ]]><br />
+ </mulgaraDescriptor:query></p>
+
+<p class="listcontinue">This tag is an extension to XSL allowing queries to be made to a Mulgara database. See <a id="h823" class="documentlinktemplate" title="The <query> Tag" href="/descriptors/querytag.html">The <query> Tag section</a> for more information.</p>
+
+<p class="listcontinue">In a text child of this tag (that is, between the open and closing tags) an iTQL command is placed. The query text is stored in a CDATA section so as to stop the XML parser having problems with the angle brackets surrounding resources. The use of the <code>@@server@@</code> is a simple token replacement mechanism. Any time a piece to text is found surrounded by '@@' the Descriptor looks for the text as an attribute of the query tag and replaces it with that value.</p>
+
+<p class="listcontinue">In this case the text <code>@@server@@</code> is replaced with the value of the server attribute <code>{$server}</code> which is the server parameter passed to the Descriptor on invocation. The client using this Descriptor must supply a server parameter. This contract (the interface in software engineering terms) is specified in the RDF of the Descriptor.</p>
+
+<p class="listcontinue">Looking further down the <code>modellist.xsl</code> file is the parameter section like this:</p>
+
+<p class="listcontinuecommandtext"><!-- Other RDF snipped --><br />
+<!-- Parameter 1 --><br />
+<desc:hasParam xmlns:desc="http://mulgara.org/descriptor#" xmlns="http://www.w3.org/1999/xhtml"> <br />
+<br />
+<desc:Param><br />
+<br />
+<desc:name>server</desc:name><br />
+<desc:type>String</desc:type><br />
+<desc:required>Yes</desc:required><br />
+<desc:description>The server to get a model list from</desc:description><br />
+<br />
+</desc:Param><br />
+</desc:hasParam></p>
+
+<p class="listcontinue">This RDF reflects the information the developer entered into the Descriptor wizard. The Descriptor code checks for parameters and reports any violations such as parameters not present or of the wrong type.</p>
+
+<p class="listcontinue">Once the interface is decided, you can change the logic of the XSL file (that is, the rules) without needing to redeploy the Descriptor. This means that Descriptors can be developed interactively. For example, a developer can be editing a Descriptor XSL file, make a change, save it, and invoke the Descriptor for immediate results. However, if any of the parameters change, then the Descriptor must be redeployed.</p>
+
+<p class="listnote"><strong>Note -</strong> Descriptors are cached by Mulgara. If you change a Descriptor, then the cache must be cleared. This is available as a task from the <a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a>.</p>
+
+<p class="listcontinue">The <code><mulgaraDescriptor:query></code> tag is surrounded by a <code><xsl:variable></code> tag that stores the results of the query in the variable <code>answer</code><strong class="specialbold">.</strong> This is because the raw XML returned from an iTQL command is not very useful on its own. If you want to work with the raw XML directly, then you should work with the Java API interface to Mulgara.</p>
+
+<p class="listcontinue">The tag <code><xsl:copy-of select="xalan:nodeset($answer)/*"/></code> is very useful for debugging. It copies the response from the Mulgara (that is, the raw XML) to the output. This is useful when working with new Descriptors where you do not know exactly what their output looks like.</p>
+
+<p class="listnote"><strong>Note -</strong> Future versions of Descriptors will also declare an XML Schema of the results they produce.</p>
+
+<p class="listcontinue">At this stage, it is advisable to temporarily jump to the next step and invoke the Descriptor as is. You should see a raw XML response something like the following:</p>
+
+<p class="listcontinuecommandtext"><?xml version="1.0" encoding="UTF-8"?><br />
+<answer xmlns="http://mulgara.org/tql#"><br />
+<query><br />
+<variables><br />
+<model/><br />
+</variables><br />
+<solution><model resource="rmi://mysite.com/server1#"/></solution><br />
+<solution><model resource="rmi://mysite.com/server1#_"/></solution><br />
+<solution><model resource="rmi://mysite.com/server1#descriptors"/></solution><br />
+<solution><model resource="rmi://mysite.com/server1#customer"/></solution><br />
+<solution><model resource="rmi://mysite.com/server1#sun"/></solution><br />
+<solution><model resource="rmi://mysite.com/server1#nytimes"/></solution><br />
+</query><br />
+</answer></p>
+
+<p class="listcontinue">If you do this, and then make further changes to your Descriptor (as you now will) you must clear the Descriptor cache. This is available as a task from the<em> </em><a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a>.</p>
+
+<p class="listcontinue">You now need to transform the above XML into an HTML list of the models. Writing a rule to match the <code><answer></code> tag is a good way to write the HTML header and body tags. The <code><solution></code> tag holds each solution to the query, like a row in a result set of an SQL query. First you must change the top most rule where you have the tag <code><xsl:copy-of select="xalan:nodeset($answer)/*"/></code> to <code><xsl:apply-templates select="xalan:nodeset($answer)/*"/></code>.</p>
+
+<p class="listcontinue">This applies the XSL template rules to the XML we received from Mulgara. That is, its as if the raw XML was the input document to the XSL transformer. Now you need to write the two rules, one to match the answer and one to match the solution.</p>
+
+<p class="listcontinue"><strong>Answer Rule:</strong></p>
+
+<p class="listcontinuecommandtext"><code> </code><!-- #################################################### --><br />
+ <!-- converts answer into an HTML Page --><br />
+ <!-- #################################################### --><br />
+ <xsl:template match="mulgaraAnswer:answer"><br />
+ <html><br />
+ <head><br />
+ <title>Mulgara models</title><br />
+ </head><br />
+ <body><br />
+<br />
+ List of models on server <xsl:value-of select="$server"/><br />
+ <ol><br />
+ <xsl:apply-templates/><br />
+ </ol><br />
+<br />
+ </body><br />
+ </html><br />
+ </xsl:template></p>
+
+<p class="listcontinue">This matches with an answer, writes out an HTML header and body and starts an ordered list, then applies the rest of the rules before closing the ordered list and closing all the HTML tags.</p>
+
+<p class="listcontinue"><strong>Solution Rule:</strong></p>
+
+<p class="listcontinuecommandtext"><code> </code><!-- ########################################################## --><br />
+ <!-- converts solution into an HTML List Element --><br />
+ <!-- ########################################################## --><br />
+ <xsl:template match="mulgaraAnswer:solution"><br />
+ <li><xsl:value-of select="mulgaraAnswer:model/@resource"/></li><br />
+ </xsl:template></p>
+
+<p class="listcontinue">This takes a solution and inserts the resource attribute of the <code><mulgaraAnswer:model></code> tag (refer to the raw XML response if this is unclear) into a list element tag <code><li></code>. This effectively adds the Model URI to the HTML list.</p>
+
+<p class="listcontinue">Once you have entered both rules save the file again. You might want to check that the file is valid XML using a tool such as xmllint.</p>
+</li><li>Deploy the Descriptor in Mulgara.
+<p class="listcontinue">Start an iTQL client.</p>
+
+<p class="listcontinue">Check if the Descriptor model already exists by querying for a list of models.</p>
+
+<p class="listcontinue">If the <code>#descriptors</code> model does not exist then you need to deploy the local Descriptors. This creates the Descriptors model and loads some useful Descriptors. It is one of the tasks available from the <a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a>.</p>
+
+<p class="listcontinue">Deploy the Descriptor by loading the Descriptor XSL file into the <code>#descriptor</code> model, as follows:</p>
+
+<p class="listcontinuecommandtext">load <file:/home/joe/work/modellist.xsl> into <rmi://mysite.com/server1#descriptors>;</p>
+
+<p class="listnote"><strong>Note -</strong> The location of the Descriptor must be accessible by Mulgara. For systems running a Windows<sup>®</sup> operating system, the file specification would look something like <code><file:/C:/work/modellist.xsl></code>.</p>
+
+<p class="listcontinue">If there were no errors in the XSL, then the Descriptor is deployed and available for use. If there were errors, check your XML for bad syntax such as unclosed tags. The Descriptor Wizard generates correct XML and XSL.</p>
+</li><li>Invoke the Descriptor.
+<p class="listcontinue">From the <a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a> choose the Lists all Descriptors on this Host task. The Mulgara Descriptor List displays. Click on the Usage button for your Descriptor to see details about the Descriptor, similar to the following screen.</p>
+
+<p class="listcontinue"><img src="/img/descriptorlist800.gif" alt="" height="686.85" width="703" vspace="0" hspace="0" align="bottom" border="1" /></p>
+
+<p class="listcontinue">Enter a server parameter such as <code>rmi://mysite.com/server1</code> and invoke the Descriptor by clicking on the Invoke button.</p>
+
+<p class="listcontinue">The result displays in a window similar to the following:</p>
+
+<p class="listcontinue"><img src="/img/descriptorlist801.gif" alt="" height="99.75" width="487.35" vspace="0" hspace="0" align="bottom" border="1" /></p>
+
+<p class="listcontinue">The Descriptor can be used to get a list of models on <em>any </em>Mulgara server, providing security allows it. Correspondingly, if this Descriptor is put onto a web server it can be deployed onto a remote Mulgara server as follows:</p>
+
+<p class="listcontinuecommandtext">load <http://www.mysite.com/descriptors/utils/modellist.xsl><br />
+ into <rmi://othersite.com/server1#descriptors>;</p>
+
+<p class="listcontinue">Many Descriptors can be developed to perform many different tasks. When developing or modifying an application to work with a Mulgara database, it may be as simple as browsing the available Descriptors and choosing the ones appropriate for the applications needs.</p>
+</li></ol>
+
+
+<div class="anchor"><a name="o803"> </a></div>
+<h4>Where To From Here?</h4>
+
+<p>Another powerful feature of Descriptors is the ability to invoke one Descriptor from another. This allows complex Descriptors to be developed and for Descriptors to be changed without affecting clients (as long as the interfaces don't change). An example of this is a portal where one Descriptor calls on other Descriptors to assemble a custom HTML page or WML page.</p>
+
+<p>See the <a id="h931" class="documentlinktemplate" title="VCard Descriptors" href="/descriptors/descriptorvcard.html">VCard</a> example for information on how to invoke one Descriptor from another.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/descriptors/descriptorsfaq.html
===================================================================
--- trunk/docs/site/descriptors/descriptorsfaq.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/descriptors/descriptorsfaq.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,359 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Descriptors FAQ</title>
+ <meta name="keywords" content="Descriptors FAQ, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/descriptors/reserved.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+
+<p><a href="/descriptors/mistakes.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/descriptors/index.html">Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/descwhat.html">What are Descriptors?</a></p>
+<p class="relateditem"><a href="/descriptors/descadvantages.html">Advantages and Disadvantages of Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/nsdesc.html">Namespaces and Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/querytag.html">The <query> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/descriptortag.html">The <descriptor> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/reserved.html">Reserved Parameters</a></p>
+<p class="relateditem"><a href="/descriptors/mistakes.html">Common Mistakes</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorex.html">Descriptor Examples</a></p>
+
+ -->
+
+
+<h2>Descriptors FAQ</h2>
+
+<p>Debugging Descriptors can be difficult unless you are knowledgeable in the underlying technologies, including XSL, Servlets and SOAP. Some of the most common problems and their solutions are summarized below.</p>
+<div class="anchor"><a name="o617"> </a></div>
+
+<ol><li><a id="h598" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o577">How do I create a Descriptor?</a></li><li><a id="h599" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o578">How do I execute an iTQL query?</a></li><li><a id="h600" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o579">How do I deploy the built-in Descriptors?</a></li><li><a id="h601" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o580">How do I deploy my Descriptor?</a></li><li><a id="h602" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o581">I can't invoke my Descriptor.</a></li><li><a id="h603" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o582">How do I check if the Descriptor model exists on a Mulgara server?</a></li><li><a id="h604" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o583">How do I check if my Descriptor is deployed?</a></li><li><a id="h605" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o584">What is the life cycle of a Descriptor?</a></li><li><a id="h606" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o585">How do I empty the Descriptor cache?</a></li><li><a id="h607" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o586">I've changed my Descriptor XSL code but when invoked it does not notice my changes.</a></li><li><a id="h608" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o587">My Descriptor doesn't work. Where are errors logged?</a></li><li><a id="h609" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o589">'Can't have more than one ROOT in a DOM !' or 'org.w3c.dom.DOMException: DOM006 Hierarchy request' errors.</a></li><li><a id="h610" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o590">Can I see how other Descriptors work? Can I get their source?</a></li><li><a id="h611" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o591">How do I store the result of a Mulgara command in a variable?</a></li><li><a id="h612" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o592">How do I store the returned data from a Descriptor invoked from another Descriptor?</a></li><li><a id="h613" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o593">What is the 'Can not convert TREEFRAG into NodeSet' error?</a></li><li><a id="h614" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o594">How do I apply the current stylesheets rules to XML returned from a query or another Descriptor?</a></li><li><a id="h615" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o595">How can I see the raw XML result from a Mulgara command?</a></li><li><a id="h616" class="documentlinktemplate" title="" href="/descriptors/descriptorsfaq.html#o596">Why are some XSL parameters or variables written like $model and some like {$model}?</a></li></ol>
+<p class="backtotop"><a id="h1361" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o577"> </a></div>
+
+
+<p><strong class="specialbold">How do I create a Descriptor?</strong></p>
+
+<p>Use the Create Descriptor Using Wizard task on the <a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a>.</p>
+
+<p class="backtotop"><a id="h1361_2" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o578"> </a></div>
+
+
+<p><strong class="specialbold">How do I execute an iTQL command?</strong></p>
+
+<p>There are two ways to execute an iTQL<sup>TM</sup> command:</p>
+<ol><li>The iTQL command line</li><li>The built-in <a class="" title="" href="http://localhost:8080/webui/">Mulgara Viewer</a><sup>TM</sup></li></ol>
+<p>See the iTQL Reference Guide for more information.</p>
+
+<p class="backtotop"><a id="h1361_3" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o579"> </a></div>
+
+
+<p><strong class="specialbold">How do I deploy the built-in Descriptors?</strong></p>
+
+<p>Use either the Deploy Descriptors or Redeploy Descriptors task on the <a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a>.</p>
+
+<p>The Redeploy Descriptors task completely removes all Descriptors before redeploying the built-in ones, while the Deploy Descriptors task deploys the built-in Descriptors and preserves the existing Descriptors.</p>
+
+<p class="backtotop"><a id="h1361_4" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o580"> </a></div>
+
+
+<p><strong class="specialbold">How do I deploy my Descriptor?</strong></p>
+
+<p>The RDF embedded in the Descriptor XSL file needs to be loaded into a model in a Mulgara database, using the following steps:</p>
+<ol><li>Start an iTQL client.</li><li>Check that the Descriptor model already exists on the Mulgara server.</li><li>Load the Descriptor XSL file into the Descriptor model using the iTQL <code><a id="h1308" class="documentlinktemplate" title="load" href="/itqlcommands/load.html">load</a></code> command. For example:
+<p class="listcontinuecommandtext">load <file:/home/joe/work/helloworld.xsl><br />
+ into <rmi://mysite.com/server1#descriptors>;</p>
+</li></ol>
+<p class="note"><strong>Note -</strong> The location of the Descriptor <em>must</em> be readable by the Mulgara server. For systems running a Windows® operating system, the file specification looks something like <code><file:/C:/work/helloworld.xsl></code>.</p>
+<div class="anchor"><a name="o3136"> </a></div>
+
+
+<p>If there are no errors in the XSL, then the Descriptor is deployed and available for use. Otherwise, check your XML for bad syntax, such as unclosed tags. The Create Descriptor Using Wizard task generates correct XML and XSL.</p>
+
+<p class="note"><strong>Note -</strong> When invoking the Descriptor from a client (SOAP, Java or another Descriptor), you must use the <em>exact</em> URL used to load the Descriptor. That is, you cannot load a Descriptor using a <code>file:</code> URL and then try and use if from a <code>HTTP:</code> URL, even if its on a web server.</p>
+<div class="anchor"><a name="o3137"> </a></div>
+
+
+<p>If a Descriptor is to be used from a web server, then it should be loaded with a HTTP URL after it has been put on the web server. For example, if the file in the example above was on a web server in the work directory <code>/home/joe/work/</code>, and this is equivalent to <code>http://foo/joe/work</code>, then the Descriptor should be deployed as follows:</p>
+
+<p class="commandtext">load <http://foo/joe/work/helloworld.xsl> <br />
+ into <rmi://mysite.com/server1#descriptors>;</p>
+<div class="anchor"><a name="o3138"> </a></div>
+
+
+<p>When Descriptors are deployed as HTTP URLs, they are accessible by any client with HTTP access, including any on the Internet, provided they have access through a firewall.</p>
+
+<p class="backtotop"><a id="h1361_5" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o581"> </a></div>
+
+
+<p><strong class="specialbold">I can't invoke my Descriptor.</strong></p>
+
+<p>First, check that the Descriptor model exists on the Mulgara server.</p>
+
+<p>If it does, then check that the Descriptor is deployed in the Descriptor model. If you changed anything from the time when you deployed it using the Create Descriptor Using Wizard task, then you have to redeploy the built-in Descriptors and redeploy your Descriptor.</p>
+
+<p class="backtotop"><a id="h1361_6" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o582"> </a></div>
+
+
+<p><strong class="specialbold">How do I check that the Descriptor model exists on a Mulgara server?</strong></p>
+
+<p>There are two ways to check if the Descriptor model exists:</p>
+<ol><li>Use the List of Descriptors Available on this Host task from the <a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a>. If it fails, no Descriptor model exists and the built-in Descriptors need to be deployed.</li><li>Use an iTQL command. For example:
+<p class="listcontinuecommandtext">select $model from <rmi://mysite.com/server1#> <br />
+ where $model <http://www.w3.org/1999/02/22-rdf-syntax-ns#type><br />
+ <http://mulgara.org/mulgara#Model>;</p>
+</li></ol>
+<p class="note"><strong>Note -</strong> In the above command, replace <code>mysite.com</code> with the fully qualified hostname of the Mulgara server. For example, <code>foo.bar.com</code> rather than just <code>foo</code>.</p>
+
+<p>This query returns all models on the server. If there is no <code>#descriptor</code> model, then you need to deploy the built-in Descriptors and any Descriptors you have developed.</p>
+
+<p class="backtotop"><a id="h1361_7" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o583"> </a></div>
+
+
+<p><strong class="specialbold">How do I check if my Descriptor is deployed?</strong></p>
+
+<p>Descriptors must be deployed before use. The Mulgara code that invokes a Descriptor looks up the parameters that a Descriptor uses, as well as other information, before it invokes the Descriptor. If the Descriptor has not been deployed, then the code does not know how to invoke it and fails.</p>
+
+<p>First, make sure that the built-in Descriptors are deployed. Then select the<em> </em>List of Descriptors Available on this Host task from the <a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a>.</p>
+
+<p class="backtotop"><a id="h1361_8" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o584"> </a></div>
+
+
+<p><strong class="specialbold">What is the life cycle of a Descriptor?</strong></p>
+
+<p>When a Descriptor is first invoked, the Descriptor code retrieves the Descriptor from its URL and creates a java object representing that Descriptor.</p>
+
+<p>For the first invocation only, the XSL transformer processes the XSL stylesheet into an internal form and places it in a free pool for use. When used, it is placed in a busy pool until it has performed its duty, then returned to the free pool. If a client requests a Descriptor and an instance is already in the busy pool, a new instance is created and made available.</p>
+
+<p>Eventually, both Descriptors are returned to the free pool. The pool grows to the size needed and stays that size. It is not expected that these pools will get very large, especially in comparison to resources on a Mulgara server.</p>
+
+<p class="backtotop"><a id="h1361_9" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o585"> </a></div>
+
+
+<p><strong class="specialbold">How do I empty the Descriptor cache?</strong></p>
+
+<p>Use the Purge all Cached Descriptors Available on this Host task from the <a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a>.</p>
+
+<p class="backtotop"><a id="h1361_10" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o586"> </a></div>
+
+
+<p><strong class="specialbold">I've changed my Descriptor XSL code but when invoked it does not notice my changes.</strong></p>
+
+<p>Descriptors are downloaded and processed into Java<sup>TM</sup> Objects that are cached and reused.</p>
+
+<p>If you have changed the logic in a Descriptor but <em>not</em> the parameters or mime type (that is, everything specified with the Create Descriptor Using Wizard task) then you need to clear the Descriptor cache using the Purge All Cached Descriptors Available on this Host task from the <a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a>.</p>
+
+<p>If you have added or removed a parameter or mime type then you will need to redeploy your Descriptor.</p>
+
+<p>If the Descriptor is on a web server, check that you have published it to the web server.</p>
+
+<p class="backtotop"><a id="h1361_11" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o587"> </a></div>
+
+
+<p><strong class="specialbold">My Descriptor doesn't work. Where are errors logged?</strong></p>
+
+<p>The file <code>descriptor-errors.log</code><em>,</em> created in the directory where Mulgara is run from, contains the reasons for Descriptors failing. The file might also contain stack traces for more detailed error explanations, such as when the XML or XSL parser fails.</p>
+
+<p class="backtotop"><a id="h1361_12" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o589"> </a></div>
+
+
+<p><strong class="specialbold">'Can't have more than one ROOT in a DOM !' or 'org.w3c.dom.DOMException: DOM006 Hierarchy request' Errors.</strong></p>
+
+<p>This happens when calling one Descriptor from another. The called Descriptor returns XML with more than one root, and if you try and store this in a variable, or pass it to something expecting a single root, this error returns.</p>
+<div class="anchor"><a name="o3139"> </a></div>
+
+
+<p>For example, Descriptor A returns:</p>
+
+<p class="commandtext"><price>17.55</price><br />
+<album>Is This It</album><br />
+<artist>The Strokes</artist></p>
+
+<p>Descriptor B calls Descriptor A and tries to store the result in a variable, but cannot because the XML is not in a tree. Descriptor A needs to return something similar to:</p>
+
+<p class="commandtext"><cd><br />
+ <price>17.55</price><br />
+ <album>Is This It</album><br />
+ <artist>The Strokes</artist> <br />
+</cd></p>
+
+<p>The XML now has one root.</p>
+<div class="anchor"><a name="o3140"> </a></div>
+
+
+<p>This can also happen when there is some text after a node. For example:</p>
+
+<p class="commandtext"><price>17.55</price><br />
+The Strokes</p>
+
+<p>In this case, there is an invisible text node that needs outer <code><cd></code> tags.</p>
+
+<p>If Descriptor B calls Descriptor A and Descriptor C (similar to Descriptor A) and simply copies their results to the output stream, then there are now two root nodes. As stated previously, you need to put a tag around where the two Descriptors are called.</p>
+
+<p class="backtotop"><a id="h1361_13" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o590"> </a></div>
+
+
+<p><strong class="specialbold">Can I see how other Descriptors work? Can I get their source?</strong></p>
+
+<p>Yes. Download them with a web browser or some other mechanism. The List of Descriptors Available on this Host task from the <a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a> allows you to list Descriptors available on your host or other hosts. The list of Descriptors also includes links to download the Descriptors.</p>
+
+<p class="note"><strong>Note -</strong> Some web browsers have trouble displaying the Descriptor. If this is the case, right-click on it and choose the option to download the link directly.</p>
+
+<p>Some links to local Descriptors with file URLs, such as <code>file:/home/joe/work/helloworld.xsl</code>, do not work from some web browsers. This is a security feature designed to stop web pages accessing local files. You need to retrieve the file using a local file manager, such as Windows<sup>®</sup> Explorer.</p>
+
+<p class="backtotop"><a id="h1361_14" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o591"> </a></div>
+
+
+<p><strong class="specialbold">How do I store the result of a Mulgara command in a variable?</strong></p>
+
+<p>Use the following example as a guide.</p>
+
+<p class="commandtext"><xsl:variable name="answer"><br />
+<br />
+ <mulgaraDescriptor:query model="{$model}" node="{$node}"><br />
+ <![CDATA[<br />
+ select $predicate from <@@model@@> <br />
+ where <@@node@@> $predicate $object;<br />
+ ]]><br />
+ </mulgaraDescriptor:query><br />
+<br />
+</xsl:variable></p>
+
+<p class="backtotop"><a id="h1361_15" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o592"> </a></div>
+
+
+<p><strong class="specialbold">How do I store the returned data from a Descriptor invoked from another Descriptor?</strong></p>
+
+<p>Use the following example as a guide.</p>
+
+<p class="commandtext"><xsl:variable name="answer"><br />
+<br />
+ <mulgaraDescriptor:descriptor<br />
+ _target="otherDescriptor.xsl<br />
+ _source="{$_self}"<br />
+ model="{$model}"<br />
+ myParameter="aParameter"/><br />
+</xsl:variable></p>
+
+<p class="backtotop"><a id="h1361_16" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o593"> </a></div>
+
+
+<p><strong class="specialbold">What is the 'Can not convert TREEFRAG into NodeSet' error?</strong></p>
+
+<p>The Tree fragment must be converted into a NodeSet using a XALAN extension. See the next question for more information.</p>
+
+<p class="backtotop"><a id="h1361_17" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o594"> </a></div>
+
+
+<p><strong class="specialbold">How do I apply the current stylesheets rules to XML returned from a query or another Descriptor?</strong></p>
+
+<p>XSL does not directly allow for this and a XALAN extension must be used. The XML must be converted from a Tree fragment to a proper DOM NodeSet. To apply XML to the stylesheet, use the following example as a guide.</p>
+
+<p class="commandtext"><xsl:variable name="answer"><br />
+<br />
+ <mulgaraDescriptor:query model="{$model}" node="{$node}"><br />
+ <![CDATA[<br />
+ select $predicate from <@@model@@> <br />
+ where <@@node@@> $predicate $object;<br />
+ ]]><br />
+ </mulgaraDescriptor:query><br />
+<br />
+</xsl:variable><br />
+<br />
+<!-- Now apply the templates to the answer --><br />
+<xsl:apply-templates select="xalan:nodeset($answer)/*"/></p>
+
+<p class="backtotop"><a id="h1361_18" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o595"> </a></div>
+
+
+<p><strong class="specialbold">How can I see the raw XML result from a Mulgara command?</strong></p>
+
+<p>Copy the result to the output stream as follows:</p>
+
+<p class="commandtext"><xsl:variable name="answer"><br />
+<br />
+ <mulgaraDescriptor:query model="{$model}" node="{$node}"><br />
+ <![CDATA[<br />
+ select $predicate from <@@model@@> <br />
+ where <@@node@@> $predicate $object;<br />
+ ]]><br />
+ </mulgaraDescriptor:query><br />
+<br />
+</xsl:variable><br />
+<br />
+<!-- Now apply the templates to the answer --><br />
+<xsl:copy-of select="xalan:nodeset($answer)/*"/></p>
+
+<p>If you are viewing the response in a web browser, the XML tags may not be visible, so wrap them in <code><xmp></code> tags to see them. For example:</p>
+
+<p class="commandtext"><!-- Now apply the templates to the answer --><br />
+<xmp><br />
+<xsl:copy-of select="xalan:nodeset($answer)/*"/><br />
+</xmp></p>
+
+<p class="backtotop"><a id="h1361_19" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+<div class="anchor"><a name="o596"> </a></div>
+
+
+<p><strong class="specialbold">Why are some XSL parameters or variables written like $model and some like {$model}?</strong></p>
+
+<p>When referring to a parameter from an element in the XSL namespace, it is sufficient to refer to it using a dollar sign ($) prefix. For example:</p>
+
+<p class="commandtext"><h1><xsl:value-of select="$title"/><h1></p>
+
+<p>However when referring to parameters from any other namespace they must be surrounded with braces ({}). For example:</p>
+
+<p class="commandtext"><xhtml:a href="{$homepage}">Home Page</xhtml:a></p>
+
+<p>Even when using no namespace, braces ({}) must be used. For example:</p>
+
+<p class="commandtext"><a href="{$homepage}">Home Page</a></p>
+
+<p class="backtotop"><a id="h1361_20" class="" title="Descriptors FAQ" href="/descriptors/descriptorsfaq.html">Back to Top</a></p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/descriptors/descriptortag.html
===================================================================
--- trunk/docs/site/descriptors/descriptortag.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/descriptors/descriptortag.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,87 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - The <descriptor> Tag </title>
+ <meta name="keywords" content="The <descriptor> Tag, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/descriptors/querytag.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/descriptors/reserved.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/descriptors/index.html">Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/descwhat.html">What are Descriptors?</a></p>
+<p class="relateditem"><a href="/descriptors/descadvantages.html">Advantages and Disadvantages of Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/nsdesc.html">Namespaces and Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/querytag.html">The <query> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/reserved.html">Reserved Parameters</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorsfaq.html">Descriptors FAQ</a></p>
+<p class="relateditem"><a href="/descriptors/mistakes.html">Common Mistakes</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorex.html">Descriptor Examples</a></p>
+
+
+ -->
+
+
+
+
+<h2>The <descriptor> Tag</h2>
+
+<p>The <code><descriptor></code> tag is an XSL extension that enables a Descriptor to call another Descriptor and operate on the output of the called Descriptor. Effectively, this allows sub-tasking, or delegation of tasks to other Descriptors whose implementations may evolve over time. For example:</p>
+
+<p class="commandtext"><descriptor _target="http://foo/descriptors/extractPeopleAsHtml.xsl" /></p>
+
+<p>The above tag executes the Descriptor located at <code>http://foo/descriptors/extractPeopleAsHtml.xsl</code> and returns the output into the output stream of the XSL transformer. That is, as if the result of the called (target) Descriptor was part of the source Descriptor.</p>
+
+<p class="note"><strong>Note -</strong> Any attributes beginning with an underscore (_) are reserved and are internal to the Descriptor.</p>
+
+<p>The <code>_target</code> attribute specifies the Descriptor to invoke and the <code>_source</code> attribute specifies the full URL of the source Descriptor. If the target Descriptor's full URL is not known, it uses the path of the source Descriptor. For example:</p>
+
+<p class="commandtext"><descriptor _target="extractPeopleAsHtml.xsl"<br />
+ _source="http://foo/descriptors/extractPeopleAndCompaniesAsHTML.xsl" /></p>
+
+<p>This allows Descriptor code to build a complete URL for the target Descriptor. However, since Descriptors do not know their URL until invoked (that is, they are told of their URL) the tag in the above example is more often used as follows:</p>
+
+<p class="commandtext"><descriptor _target="extractPeopleAsHtml.xsl" _source="{$_self}" /></p>
+
+<p>The <code>_self</code> parameter is a special parameter that is passed to all Descriptors on invocation and is set to the URL of the Descriptor. When Descriptors are deployed, they take on the URL they were loaded in as. Therefore, the target Descriptor in the above example is located as long as it is in the same directory as the source Descriptor.</p>
+
+<p>Descriptor parameters are specified as attributes in the <code><descriptor></code> tag. In the previous example if a model needed to be specified, the tag could look as follows:</p>
+
+<p class="commandtext"><descriptor _target="extractPeopleAsHtml.xsl" _source="{$_self}" model="{$model}"/></p>
+
+<p>If some attributes are long, it is preferable to format the tag as follows:</p>
+
+<p class="commandtext"><descriptor <br />
+ _target="extractPeopleAsHtml.xsl" <br />
+ _source="{$_self}" <br />
+ model="{$model}"/></p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/descriptors/descriptorvcard.html
===================================================================
--- trunk/docs/site/descriptors/descriptorvcard.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/descriptors/descriptorvcard.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,103 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - VCard Descriptors </title>
+ <meta name="keywords" content="VCard Descriptors, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/descriptors/descriptorvcard.html#o921">Try the VCards Example</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/descriptors/descriptorlist.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/inferencing/index.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/descriptors/descriptorex.html">Descriptor Examples</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorhw.html">Hello World Descriptor</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorlist.html">List Models Descriptor</a></p>
+ -->
+
+
+
+<h3>VCard Descriptors</h3>
+
+<p>This example uses several Descriptors to generate an HTML page listing the VCards in a specified Mulgara model. The VCard data can be exported from Mulgara, in VCard format, for use by applications such as Netscape Address book and Microsoft<sup>®</sup> Outlook. New VCards can be entered from an HTML interface.</p>
+
+<p>Here is a sample screen capture.</p>
+
+<p><img src="/img/descriptorvcard918.gif" alt="" height="722" width="624" vspace="0" hspace="0" align="bottom" border="1" /></p>
+
+<p>Clicking on the Export VCard button sends a file, similar to the one shown below, to your browser. Depending on your configuration, your browser may ask you to save the file or it may pass the file directly to an external application, such as Microsoft<sup>®</sup> Outlook<sup>®</sup>.</p>
+
+<p class="commandtext">BEGIN:VCARD <br />
+VERSION:2.1<br />
+FN:Corky Crystal<br />
+TITLE:Computer Officer Class 3<br />
+ROLE:Programmer<br />
+ADR;WORK:; 111 Lake Drive ; WonderCity ; 5555 ; Australia <br />
+LABEL;WORK;ENCODING=QUOTED-PRINTABLE: 111 Lake Drive =0D=0A WonderCity =0D=0A 5555 Australia <br />
+EMAIL;PREF;INTERNET:corky at qqq.com<br />
+NOTE:Only works on Mondays and Fridays<br />
+TEL;WORK;VOICE:+61 7 555 5555<br />
+END:VCARD</p>
+
+<p>This example uses seven Descriptors to perform a variety of tasks. Using a browser and clicking on the links below displays the source in a new window.</p>
+<ol><li><a class="" title="" href="../../descriptors/vcard/vcardlisthtml.xsl">Given a Model show all VCards in that model as HTML</a></li><li><a class="" title="" href="../../descriptors/vcard/vcardlist.xsl">Given a Model return a list of VCards URIs in that model as XML</a></li><li><a class="" title="" href="../../descriptors/vcard/vcardhtml.xsl">Given a VCard URI return an HTML version of the VCard</a></li><li><a class="" title="" href="../../descriptors/vcard/vcardxml.xsl">Given a VCard URI return a XML version of the VCard</a></li><li><a class="" title="" href="../../descriptors/vcard/vcard.xsl">Given a VCard URI return a VCard Format version of the VCard</a></li><li><a class="" title="" href="../../descriptors/vcard/vcardinsert.xsl">Given VCard parameters insert a VCard into a Mulgara </a>database</li><li><a class="" title="" href="../../descriptors/vcard/vcardinserthtml.xsl">Given a model return an HTML page which will take VCard parameters and insert them into a Mulgara </a>database
+<p class="listcontinue">The above links are available in the online version of the documentation.</p>
+</li></ol>
+<p>All of these Descriptors are part of the default installation of Mulgara and are available from the List Descriptors task on the <a class="" title="" href="../../descriptors/vcard/vcardinsert.xsl">Descriptor Management page</a>.</p>
+
+<p>The diagram below outlines the relationships between these Descriptors to demonstrate their reusability.</p>
+
+<p><img src="/img/descriptorvcard919.png" alt="" height="893.6" width="736.8" vspace="0" hspace="0" align="bottom" border="1" /></p>
+
+<p class="note"><strong>Note -</strong> Descriptor 4 (Given a VCard URI return the VCard as XML) is used by both browser tasks. This is to demonstrate the reusability of well designed Descriptors.</p>
+
+
+<div class="anchor"><a name="o921"> </a></div>
+<h4>Try the VCards Example</h4>
+
+<p>To try out the VCards example, you need to load VCard RDF into a model.</p>
+<ol><li>Using the TKS Viewer<sup>TM</sup> or the iTQL<sup>TM</sup> command line, create a model for storing the VCards. For example:
+<p class="listcontinuecommandtext">create <rmi://mysite.com/server1#vcard>;</p>
+
+<p class="listnote"><strong>Note -</strong> Replace <code>mysite.com</code> with the fully qualified hostname of your TKS server.</p>
+</li><li>Load some VCard RDF data into your model.
+<p class="listcontinue">A sample file, <code>vcards.rdf</code>, is included as part of the TKS installation. If you want to use this file, copy the link address for it and load the data into the vcard model. For example:</p>
+
+<p class="listcontinuecommandtext">load <http://mysite.com:8080/webservices/descriptor/examples/vcard/vcards.rdf><br />
+ into <rmi://mysite.com/server1#vcard>;</p>
+
+<p class="listcontinue">If you want to add more vcards to the file, download it, edit it and load it in using a <code>file:</code> URL. Make sure the default Descriptors are loaded (use the Deploy Bundled Descriptors task on the <a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a>).</p>
+</li><li>Use the See List of Descriptors Available on this Host task from the <a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">Descriptor Management page</a> to locate the Given a Model Show All VCards in that Model as HTML Descriptor.
+<p class="listcontinue">Enter <code>rmi://mysite.com/server1#vcard</code> as the model parameter and click on the Invoke button.</p>
+</li></ol>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/descriptors/descwhat.html
===================================================================
--- trunk/docs/site/descriptors/descwhat.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/descriptors/descwhat.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,59 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - What are Descriptors?</title>
+ <meta name="keywords" content="Descriptors, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/descriptors/index.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/descriptors/descadvantages.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/descriptors/index.html">Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/descadvantages.html">Advantages and Disadvantages of Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/nsdesc.html">Namespaces and Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/querytag.html">The <query> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/descriptortag.html">The <descriptor> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/reserved.html">Reserved Parameters</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorsfaq.html">Descriptors FAQ</a></p>
+<p class="relateditem"><a href="/descriptors/mistakes.html">Common Mistakes</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorex.html">Descriptor Examples</a></p>
+
+
+
+
+ -->
+
+
+<h2>What are Descriptors?</h2>
+
+<p>Descriptors are XSL stylesheets that perform specific, well-defined tasks in Mulgara. They are composed of the following components:</p>
+<ul><li>Extensions to XSL:<ul><li><code><query></code> tags enabling you to issue iTQL<sup>TM</sup> commands to Mulgara databases from within XSL stylesheets</li><li><code><descriptor></code> tags enabling one Descriptor to call another</li></ul></li><li>Java<sup>TM</sup> Objects that invoke Descriptors and return their results</li><li>Java Servlets that invoke Descriptors using HTTP</li><li>SOAP endpoints that enable all Descriptors to be accessible as SOAP services</li></ul>
+<p>The Descriptor Management page is available at <code><a class="" title="" href="http://localhost:8080/webservices/descriptor/index.jsp">http://localhost:8080/webservices/descriptor/index.jsp</a></code> when Mulgara is running.</p>
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/descriptors/includeTOC.inc
===================================================================
--- trunk/docs/site/descriptors/includeTOC.inc 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/descriptors/includeTOC.inc 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,16 @@
+ <ul>
+ <li><a href="/descriptors/descwhat.html">What are Descriptors?</a></li>
+ <li><a href="/descriptors/descadvantages.html">Advantages and Disadvantages of Descriptors</a></li>
+ <li><a href="/descriptors/nsdesc.html">Namespaces and Descriptors</a></li>
+ <li><a href="/descriptors/querytag.html">The <query> Tag</a></li>
+ <li><a href="/descriptors/descriptortag.html">The <descriptor> Tag</a></li>
+ <li><a href="/descriptors/reserved.html">Reserved Parameters</a></li>
+ <li><a href="/descriptors/descriptorsfaq.html">Descriptors FAQ</a></li>
+ <li><a href="/descriptors/mistakes.html">Common Mistakes</a></li>
+ <li><a href="/descriptors/descriptorex.html">Descriptor Examples</a></li>
+ <ul>
+ <li><a href="/descriptors/descriptorhw.html">Hello World Descriptor</a></li>
+ <li><a href="/descriptors/descriptorlist.html">List Models Descriptor</a></li>
+ <li><a href="/descriptors/descriptorvcard.html">VCard Descriptors</a></li>
+ </ul>
+ </ul>
Added: trunk/docs/site/descriptors/index.html
===================================================================
--- trunk/docs/site/descriptors/index.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/descriptors/index.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,57 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Descriptors</title>
+ <meta name="keywords" content="Descriptors, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/overview/links.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/descriptors/descwhat.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+-->
+
+
+<h1>Descriptors</h1>
+
+<p>Descriptors are an alternative to using Mulgara APIs. Some examples of useful tasks that Descriptors can be used for include:</p>
+<ul><li>Hiding complex Mulgara queries behind a simple interface.</li><li>Aggregating complex data by Descriptors calling other Descriptors.</li><li>Developing HTML front ends to Mulgara queries.</li></ul>
+<p>The following sections describe Descriptors in detail, and provide examples on how to use them.</p>
+
+
+<p class="relatedheading">In This Section</p>
+<p class="relateditem"><a href="/descriptors/descwhat.html">What are Descriptors?</a></p>
+<p class="relateditem"><a href="/descriptors/descadvantages.html">Advantages and Disadvantages of Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/nsdesc.html">Namespaces and Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/querytag.html">The <query> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/descriptortag.html">The <descriptor> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/reserved.html">Reserved Parameters</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorsfaq.html">Descriptors FAQ</a></p>
+<p class="relateditem"><a href="/descriptors/mistakes.html">Common Mistakes</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorex.html">Descriptor Examples</a></p>
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/descriptors/mistakes.html
===================================================================
--- trunk/docs/site/descriptors/mistakes.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/descriptors/mistakes.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,67 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Common Mistakes</title>
+ <meta name="keywords" content="Common Mistakes, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/descriptors/descriptorsfaq.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/descriptors/descriptorex.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/descriptors/index.html">Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/descwhat.html">What are Descriptors?</a></p>
+<p class="relateditem"><a href="/descriptors/descadvantages.html">Advantages and Disadvantages of Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/nsdesc.html">Namespaces and Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/querytag.html">The <query> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/descriptortag.html">The <descriptor> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/reserved.html">Reserved Parameters</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorsfaq.html">Descriptors FAQ</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorex.html">Descriptor Examples</a></p>
+
+
+ -->
+
+
+
+
+<h2>Common Mistakes</h2>
+
+<p>The following is a list of common mistakes when using Descriptors:</p>
+<ul>
+ <li>Forgetting to specify the required Descriptor parameters.</li>
+ <li>Not specifying a source URL when calling a relative URL from a Descriptor element.</li>
+ <li>Changing parameter requirements and not redeploying the Descriptor.</li>
+ <li>XML syntax problems. Use a tool like xmllint.</li>
+ <li>XSL syntax problems. Use a command line XSL processor.</li>
+ <li>Redeploying built in Descriptors and forgetting to redeploy other Descriptors.</li>
+ <li>If a Descriptor returns something other than XML, you can not use the Descriptor <code>execute</code> Web Service/API which returns a <code>org.w3c.dom</code> element. This attempts to turn the Descriptor result into XML and fails if it is not XML. Use the <code>executeQueryToString</code> Web Service/API instead.</li>
+</ul>
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/descriptors/nsdesc.html
===================================================================
--- trunk/docs/site/descriptors/nsdesc.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/descriptors/nsdesc.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,71 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Namespaces and Descriptors</title>
+ <meta name="keywords" content="Namespaces and Descriptors, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/descriptors/descadvantages.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/descriptors/querytag.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/descriptors/index.html">Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/descwhat.html">What are Descriptors?</a></p>
+<p class="relateditem"><a href="/descriptors/descadvantages.html">Advantages and Disadvantages of Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/querytag.html">The <query> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/descriptortag.html">The <descriptor> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/reserved.html">Reserved Parameters</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorsfaq.html">Descriptors FAQ</a></p>
+<p class="relateditem"><a href="/descriptors/mistakes.html">Common Mistakes</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorex.html">Descriptor Examples</a></p>
+
+ -->
+
+
+
+
+<h2>Namespaces and Descriptors</h2>
+
+<p>All tags must be in a certain namespace in order to be recognized as XSL extensions.</p>
+
+<p>When using Descriptors created by the Descriptor Wizard, a prefix of <code>mulgaraDescriptor</code> should be used. For example:</p>
+
+<p class="commandtext"><mulgaraDescriptor:query><br />
+ perform Mulgara Query<br />
+</mulgaraDescriptor:query><br />
+<br />
+<mulgaraDescriptor:descriptor<br />
+ call Mulgara Descriptor<br />
+/></p>
+
+<p class="note"><strong>Note -</strong> The remainder of this section leaves out these namespaces for the sake of clarity.</p>
+
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/descriptors/querytag.html
===================================================================
--- trunk/docs/site/descriptors/querytag.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/descriptors/querytag.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,110 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - The <query> Tag</title>
+ <meta name="keywords" content="The <query> Tag, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/descriptors/nsdesc.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/descriptors/descriptortag.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/descriptors/index.html">Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/descwhat.html">What are Descriptors?</a></p>
+<p class="relateditem"><a href="/descriptors/descadvantages.html">Advantages and Disadvantages of Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/nsdesc.html">Namespaces and Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/descriptortag.html">The <descriptor> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/reserved.html">Reserved Parameters</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorsfaq.html">Descriptors FAQ</a></p>
+<p class="relateditem"><a href="/descriptors/mistakes.html">Common Mistakes</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorex.html">Descriptor Examples</a></p>
+
+ -->
+
+
+
+
+<h2>The <query> Tag</h2>
+
+<p>The <code><query></code> tag is an XSL extension that enables you to issue iTQL<sup>TM</sup> commands from within an XSL stylesheet. For example:</p>
+
+<p class="commandtext"><query><br />
+<!CDATA[[<br />
+ select $person from <rmi://mysite.com/server1#people> <br />
+ where $person <http://foo#hasName> 'James Gosling';<br />
+]]><br />
+</query></p>
+
+
+<div class="anchor"><a name="o3132"> </a></div>
+
+
+<p>The results, in XML format, are normally transformed into something more suitable for the client or into a presentation format like HTML or PDF. Other Descriptors make calls on a Descriptor to perform a task without needing to know how that task is performed. For example, to return the title of a document in between two <code><title></code> tags.</p>
+<div class="anchor"><a name="o3133"> </a></div>
+
+
+<p>Most commands require parameters, such as the model, to make them reusable across Mulgara instances and models.</p>
+
+<p>The model parameter is inserted in several ways, as outlined in the <a class="internetlinktemplate" title="" href="http://www.w3.org/style/xsl/">XSL specification</a>. However, because the command is contained within a <code>CDATA</code> segment, breaking out of it makes the command difficult for people to read. For example:</p>
+
+<p class="commandtext"><query><br />
+<!CDATA[[<br />
+select $person from <]]><xsl:variable select="$model"/><br />
+ <!CDATA[[> where $person <http://foo#hasName> 'James Gosling';<br />
+]]><br />
+</query></p>
+<div class="anchor"><a name="o3134"> </a></div>
+
+
+<p>The <code><query></code> tag has a workaround to avoid this. If any string in the <code>CDATA</code> section is surrounded by <code>@@</code> symbols, then the string is replaced with the value of an attribute of the same from within the <code><query></code> tag. This is shown in the example below.</p>
+
+<p class="commandtext"><query model="rmi://mysite.com/server1#people"><br />
+<!CDATA[[<br />
+select $person from <@@model@@> where $person <http://foo#hasName> 'James Gosling';<br />
+]]><br />
+</query></p>
+<div class="anchor"><a name="o3135"> </a></div>
+
+
+<p>When the Descriptor executes, it substitutes <code>rmi://mysite.com/server1#people</code> for <code>@@model@@</code> before passing the command to Mulgara.</p>
+
+<p>By specifying the parameter as a Descriptor parameter, the value can be passed in by the client. For example:</p>
+
+<p class="commandtext"><query model="{$model}"><br />
+<!CDATA[[<br />
+select $person from <@@model@@> where $person <http://foo#hasName> 'James Gosling';<br />
+]]><br />
+</query></p>
+
+<p>If the Descriptor is created with a model parameter defined as a string, the query is now portable across models.</p>
+
+<p>These types of substitutions are not limited to models. Any string can be substituted.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/descriptors/reserved.html
===================================================================
--- trunk/docs/site/descriptors/reserved.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/descriptors/reserved.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,136 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Reserved Parameters</title>
+ <meta name="keywords" content="Reserved Parameters, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/descriptors/descriptortag.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/descriptors/descriptorsfaq.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/descriptors/index.html">Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/descwhat.html">What are Descriptors?</a></p>
+<p class="relateditem"><a href="/descriptors/descadvantages.html">Advantages and Disadvantages of Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/nsdesc.html">Namespaces and Descriptors</a></p>
+<p class="relateditem"><a href="/descriptors/querytag.html">The <query> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/descriptortag.html">The <descriptor> Tag</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorsfaq.html">Descriptors FAQ</a></p>
+<p class="relateditem"><a href="/descriptors/mistakes.html">Common Mistakes</a></p>
+<p class="relateditem"><a href="/descriptors/descriptorex.html">Descriptor Examples</a></p>
+
+
+
+ -->
+
+
+
+
+<h2>Reserved Parameters</h2>
+
+<p>Parameters have special meanings that may be different depending on their context, as outlined in the following table.</p>
+<table width="558" cellpadding="2" cellspacing="0" border="0" style="border-collapse:collapse">
+<tr align="left" valign="top">
+<th width="90">
+<p class="tableheading">Parameter</p>
+</th>
+<th width="132">
+<p class="tableheading">Descriptor Element</p>
+</th>
+<th width="114">
+<p class="tableheading">XSL</p>
+</th>
+<th width="222">
+<p class="tableheading">HTTP/SOAP</p>
+</th>
+</tr>
+<tr align="left" valign="top">
+<td width="90">
+<p><code>_self</code></p>
+</td>
+<td width="132">
+<p>N/A</p>
+</td>
+<td width="114">
+<p>Set to the URL of the Descriptor being invoked</p>
+</td>
+<td width="222">
+<p>Set to the URL of the Descriptor to invoke</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="90">
+<p><code>_target</code></p>
+</td>
+<td width="132">
+<p>Set to the URL of the Descriptor to invoke</p>
+</td>
+<td width="114">
+<p>N/A</p>
+</td>
+<td width="222">
+<p>N/A</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="90">
+<p><code>_source</code></p>
+</td>
+<td width="132">
+<p>Set to the URL of the current Descriptor being invoked</p>
+</td>
+<td width="114">
+<p>N/A</p>
+</td>
+<td width="222">
+<p>N/A</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="90">
+<p><code>_cacheClear</code></p>
+</td>
+<td width="132">
+<p>see HTTP/SOAP</p>
+</td>
+<td width="114">
+<p>see HTTP/SOAP</p>
+</td>
+<td width="222">
+<p><strong class="specialbold">For Development Only</strong></p>
+
+<p>If set to any value, all cached Descriptors are cleared. This is useful for developers when testing a Descriptor. Ordinarily, Descriptors are cached for performance reasons and do not know if they have changed unless the cache is cleared</p>
+</td>
+</tr>
+
+</table>
+
+<p class="note"><strong>Note -</strong> Depending on the context, some variables <em>are</em> set, such as <code>_self</code>, while others need to <em>be</em> set, such as <code>_target</code>.</p>
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/img/descriptorhw791.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/descriptorhw791.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/descriptorhw792.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/descriptorhw792.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/descriptorhw793.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/descriptorhw793.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/descriptorhw794.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/descriptorhw794.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/descriptorlist799.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/descriptorlist799.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/descriptorlist800.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/descriptorlist800.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/descriptorlist801.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/descriptorlist801.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/descriptorvcard918.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/descriptorvcard918.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/descriptorvcard919.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/descriptorvcard919.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/jrdfgraphs2490.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/jrdfgraphs2490.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/loadexistingrdf.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/loadexistingrdf.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/select1536.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/select1536.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/viewerscreen.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/viewerscreen.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/viewerstep1.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/viewerstep1.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/viewerstep1result.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/viewerstep1result.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/viewerstep2.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/viewerstep2.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/viewerstep3.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/viewerstep3.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img/viewerstep4.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img/viewerstep4.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/atlassian-160.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/atlassian-160.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/backLeft.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/backLeft.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/backTop.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/backTop.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/black-20.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/black-20.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/black-30.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/black-30.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/black-40.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/black-40.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/black-50.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/black-50.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/black-55.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/black-55.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/black-60.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/black-60.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/black-70.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/black-70.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/black-80.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/black-80.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/black-90.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/black-90.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/bosatsu-160.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/bosatsu-160.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/bosatsu-160.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/bosatsu-160.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/dash.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/dash.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/herzum-160.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/herzum-160.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/herzum.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/herzum.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/herzum.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/herzum.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/ieBack-2.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/ieBack-2.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/ieBack-3.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/ieBack-3.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/ieBack.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/ieBack.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/logo856s.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/logo856s.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/mbackLeft.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/mbackLeft.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/mbackTop.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/mbackTop.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/mulgara-logo.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/mulgara-logo.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/netymon-160-l.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/netymon-160-l.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/netymon-160-l.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/netymon-160-l.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/opensource-55x48.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/opensource-55x48.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/siteicon.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/siteicon.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/sm-160.jpg
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/sm-160.jpg
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/w3css30.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/w3css30.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/w3css30.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/w3css30.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/w3xhtml10.gif
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/w3xhtml10.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/w3xhtml10.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/w3xhtml10.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/white-30.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/white-30.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/white-40.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/white-40.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/white-50.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/white-50.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/white-60.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/white-60.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/white-70.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/white-70.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/white-80.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/white-80.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/white-85.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/white-85.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/white-90.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/white-90.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/img-layout/white-95.png
===================================================================
(Binary files differ)
Property changes on: trunk/docs/site/img-layout/white-95.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/docs/site/includeBottom.inc
===================================================================
--- trunk/docs/site/includeBottom.inc 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/includeBottom.inc 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,29 @@
+
+ <!-- end of main content -->
+
+
+
+ <div id="copyright">
+ <a href="http://www.opensource.org/docs/definition.php" title="Open Source Initiative"><img style="border:0;width:55px;height:48px;" src="/img-layout/opensource-55x48.png" alt="Open Source logo" /></a>
+ <p>© 2001-2004 Tucana Technologies, Inc. Some rights reserved.</p>
+ <p>© 2006 The Mulgara Project. Some rights reserved.<br />
+ Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "<a href="/legal/fdl.txt">GNU Free Documentation License</a>".
+ </p>
+ <p>Modification Authors: Paul Gearon, David Wood. Principle Authors: Tom Adams, Grant Noble. The publisher of this version is <a href="http://mulgara.org">The Mulgara Project</a>. <a href="/overview/history.html">Document history</a>.</p>
+ </div>
+
+
+
+ <div id="lastmodified">
+ <!--#config timefmt="%D" -->This file was last modified on <!--#echo var="LAST_MODIFIED" -->.
+ </div>
+
+
+
+ </div>
+ <!-- end of right column -->
+
+ <div id="sfx" title="Switch specialFX ON unless you have slow hardware. It provides a fixed header while you scroll, leaving the navigation always in reach."></div>
+
+</body>
+</html>
\ No newline at end of file
Added: trunk/docs/site/includeMiddle.inc
===================================================================
--- trunk/docs/site/includeMiddle.inc 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/includeMiddle.inc 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,42 @@
+
+ <meta name="description" content="Mulgara semantic store is a scalable RDF database written entirely in Java. It is an Open Source fork of Kowari metastore." />
+ <meta name="copyright" content="Copyright © 2006, Mulgara Project" />
+
+ <meta name="DC.Title" content="mulgara semantic store" />
+ <meta name="DC.Subject" content="mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+ <meta name="DC.Description" content="Mulgara semantic store is a scalable RDF database written entirely in Java. It is an Open Source fork of Kowari metastore." />
+ <meta name="DC.Creator" content="Tom Adams" />
+ <meta name="DC.Contributor" content="Paul Gearon" />
+ <meta name="DC.Contributor" content="David Wood" />
+ <meta name="DC.Date.Created" scheme="iso8601" content="2003-09-22" />
+ <meta name="DC.Modified" scheme="iso8601" content="2006-10-01" />
+ <meta name="DC.Language" scheme="rfc1766" content="en" />
+ <meta name="DC.Type" scheme="http://memory.loc.gov/ammem/award99/icuhtml/dcguide.html" content="Text.Homepage.Organizational" />
+ <meta name="DC.Identifier" scheme="URI" content="http://mulgara.org/" />
+ <meta name="DC.Rights" scheme="URI" content="http://opensource.org/licenses/osl-3.0.php" />
+
+ <script type="text/javascript" src="/script/bodyswitcher.js"></script>
+ <style type="text/css">@import url(/style/oldStyle.css);</style>
+ <style type="text/css">@import url(/style/style.css);</style>
+ <!--[if IE]>
+ <style type="text/css">@import url(/style/styleIE6.css);</style>
+ <![endif]-->
+
+</head>
+
+<body>
+ <div id="logo"><a href="/index.html"><img src="/img-layout/logo856s.png" width="800" height="56" alt="mulgara semantic store" /></a></div>
+ <div id="backTop1"></div>
+ <div id="backTop2"></div>
+
+ <div id="siteNaviTopBack"></div>
+ <div id="siteNaviTop"><a href="/index.html">Home</a></div>
+ <div id="leftCol">
+ <div id="siteNavi">
+<!-- SITE NAVIGATION STARTS HERE -->
+ <!--#include virtual='/includeTOC.inc' -->
+<!-- SITE NAVIGATION ENDS HERE -->
+ </div>
+ </div>
+
+
Added: trunk/docs/site/includeTOC.inc
===================================================================
--- trunk/docs/site/includeTOC.inc 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/includeTOC.inc 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,108 @@
+
+ <!-- class=section marks the sections reflecting the directory structure
+ class=toc means these parts only show up in the big toc page but are hidden in the left hand navigation
+ class=toc is applied to so called anchors, which aid navigation within long pages -->
+
+
+ <!-- index -->
+ <ul class="section toc">
+ <li class="secindex"><a href="/index.html">Home</a></li>
+ <ul class="toc">
+ <li><a href="/index.html#o1011">Downloads</a></li>
+ <li><a href="/index.html#o1015">Support</a></li>
+ <li><a href="/index.html#o1013">License</a></li>
+ </ul>
+ </ul>
+
+ <!-- overview -->
+ <ul class="section">
+ <li class="secindex"><a href="/overview/index.html"><span class="toc">Mulgara </span>Overview</a></li>
+<!--#if expr="${DOCUMENT_NAME} = /toc/" -->
+ <!--#include virtual='/overview/includeTOC.inc' -->
+ <!--#elif expr="${DOCUMENT_URI} = /overview/" -->
+ <!--#include virtual='/overview/includeTOC.inc' -->
+ <!--#endif -->
+ </ul>
+
+
+ <!-- system -->
+ <ul class="section">
+ <li class="secindex"><a href="/system/index.html">System Architecture</a></li>
+<!--#if expr="${DOCUMENT_NAME} = /toc/" -->
+ <!--#include virtual='/system/includeTOC.inc' -->
+ <!--#elif expr="${DOCUMENT_URI} = /system/" -->
+ <!--#include virtual='/system/includeTOC.inc' -->
+ <!--#endif -->
+ </ul>
+
+
+ <!-- resolvers -->
+ <ul class="section">
+ <li class="secindex"><a href="/resolvers/index.html">Resolvers</a></li>
+<!--#if expr="${DOCUMENT_NAME} = /toc/" -->
+ <!--#include virtual='/resolvers/includeTOC.inc' -->
+ <!--#elif expr="${DOCUMENT_URI} = /resolvers/" -->
+ <!--#include virtual='/resolvers/includeTOC.inc' -->
+ <!--#endif -->
+ </ul>
+
+
+ <!-- descriptors -->
+ <ul class="section">
+ <li class="secindex"><a href="/descriptors/index.html">Descriptors</a></li>
+<!--#if expr="${DOCUMENT_NAME} = /toc/" -->
+ <!--#include virtual='/descriptors/includeTOC.inc' -->
+ <!--#elif expr="${DOCUMENT_URI} = /descriptors/" -->
+ <!--#include virtual='/descriptors/includeTOC.inc' -->
+ <!--#endif -->
+ </ul>
+
+
+ <!-- integration -->
+ <ul class="section">
+ <li class="secindex"><a href="/integration/index.html">Integration Tutorials</a></li>
+<!--#if expr="${DOCUMENT_NAME} = /toc/" -->
+ <!--#include virtual='/integration/includeTOC.inc' -->
+ <!--#elif expr="${DOCUMENT_URI} = /integration/" -->
+ <!--#include virtual='/integration/includeTOC.inc' -->
+ <!--#endif -->
+ </ul>
+
+
+ <!-- itqlcommands -->
+ <ul class="section">
+ <li class="secindex"><a href="/itqlcommands/index.html">iTQL Commands</a></li>
+<!--#if expr="${DOCUMENT_NAME} = /toc/" -->
+ <!--#include virtual='/itqlcommands/includeTOC.inc' -->
+ <!--#elif expr="${DOCUMENT_URI} = /itqlcommands/" -->
+ <!--#include virtual='/itqlcommands/includeTOC.inc' -->
+ <!--#endif -->
+ </ul>
+
+
+ <!-- itqloperations -->
+ <ul class="section">
+ <li class="secindex"><a href="/itqloperations/index.html">Advanced iTQL<span class="toc"> Operations</span></a></li>
+<!--#if expr="${DOCUMENT_NAME} = /toc/" -->
+ <!--#include virtual='/itqloperations/includeTOC.inc' -->
+ <!--#elif expr="${DOCUMENT_URI} = /itqloperations/" -->
+ <!--#include virtual='/itqloperations/includeTOC.inc' -->
+ <!--#endif -->
+ </ul>
+
+
+ <!-- inferencing -->
+ <ul class="section">
+ <li class="secindex"><a href="/inferencing/index.html">Inferencing</a></li>
+<!--#if expr="${DOCUMENT_NAME} = /toc/" -->
+ <!--#include virtual='/inferencing/includeTOC.inc' -->
+ <!--#elif expr="${DOCUMENT_URI} = /inferencing/" -->
+ <!--#include virtual='/inferencing/includeTOC.inc' -->
+ <!--#endif -->
+ </ul>
+
+ <!-- therest -->
+ <ul class="section">
+ <li class="secindex"><a href="/toc.html">Table of Contents</a></li>
+ <li class="secindex"><a href="/backofbook.html">Index</a></li>
+ </ul>
Added: trunk/docs/site/includeTop.inc
===================================================================
--- trunk/docs/site/includeTop.inc 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/includeTop.inc 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+ <meta http-equiv="language" content="en" />
+ <link rel="icon" type="text/png" href="/img-layout/siteicon.png" />
+ <link rel="shortcut icon" type="text/png" href="/img-layout/siteicon.png">
+
\ No newline at end of file
Added: trunk/docs/site/index.html
===================================================================
--- trunk/docs/site/index.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/index.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,67 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Welcome!</title>
+ <meta name="keywords" content="Mulgara Semantic Store, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/index.html#o1011">Downloads</a> |
+ <a href="/index.html#o1015">Support</a> |
+ <a href="/index.html#o1013">Licence</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/overview/index.html#overview"><img src="next.gif" alt="Next Topic" align="bottom" border="0" height="25" hspace="2" vspace="2" width="23"></a></p>
+-->
+
+<h1>Mulgara | Semantic Store</h1>
+
+<p>The Mulgara Semantic Store
+is an Open Source, massively scalable, transaction-safe, purpose-built
+database for the storage and retrieval of metadata. More information on
+Mulgara, including its main features, can be found in the <a id="h1008" class="" title="Mulgara Overview" href="/overview/index.html#overview">Mulgara Overview</a> section.</p>
+
+
+
+
+
+
+
+<div class="anchor"><a name="o1011"> </a></div>
+<h2>Downloads</h2>
+
+<p>Source downloads of Mulgara are available from the <a class="documentlinktemplate" title="Mulgara Downloads" href="http://mulgara.org/download.html">downloads page</a>. The latest stable release of Mulgara is version 1.0.0.</p>
+
+
+<div class="anchor"><a name="o1015"> </a></div>
+<h2>Support</h2>
+
+<p>Mulgara is supported through the Mulgara community, specifically on the <a class="internetlinktemplate" title="" href="http://mulgara.org/mailman/listinfo/mulgara-general">mulgara-general</a> mailing list. <em>All support requests for this open source project should first go through this list.</em></p>
+
+<p>Bug reports and feature requests for Mulgara can be made on the <a class="internetlinktemplate" title="" href="http://mulgara.org/jira">bug and issue tracker</a>.</p>
+
+
+<div class="anchor"><a name="o1013"> </a></div>
+<h2>License</h2>
+
+<p>Mulgara is licensed under the <a class="internetlinktemplate" title="" href="http://www.opensource.org/licenses/osl.php">Open Software License, Version 1.1</a>. The full text of this license <a id="h1158" class="documentlinktemplate" title="Legal Information" href="/overview/legalinfo.html">is available locally</a>.</p>
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
\ No newline at end of file
Added: trunk/docs/site/inferencing/consistency.html
===================================================================
--- trunk/docs/site/inferencing/consistency.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/inferencing/consistency.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,443 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Consistency Checking</title>
+ <meta name="keywords" content="Consistency, Checking, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/inferencing/consistency.html#o2817">Data Types</a> |
+ <a href="/inferencing/consistency.html#o2820">Cardinality</a> |
+ <a href="/inferencing/consistency.html#o2824">owl:Nothing</a> |
+ <a href="/inferencing/consistency.html#o2825">owl:Restriction</a> |
+ <a href="/inferencing/consistency.html#o2826">owl:Thing</a> |
+ <a href="/inferencing/ontomanage.html">Ontology</a>
+
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/inferencing/entailment.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/inferencing/ontomanage.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/inferencing/owl.html">OWL-Lite Operations Using iTQL</a></p>
+<p class="relateditem"><a href="/inferencing/entailment.html">Entailment</a></p>
+
+ -->
+
+
+
+
+<h3>Consistency Checking</h3>
+
+<p>Consistency checking operations check that instances of data are consistent with a given schema.</p>
+
+<div class="anchor"><a name="o2817"> </a></div>
+<h4>Restricting Data Types</h4>
+
+<p>The <code>owl:allValuesFrom</code> and <code>owl:someVauesFrom</code> operations allow you to restrict the data types that a property refers to, for a given class.</p>
+<div class="anchor"><a name="o2818"> </a></div>
+<h5>owl:allValuesFrom</h5>
+
+<p>The <code>owl:AllValuesFrom</code> declaration restricts the use of a predicate (also called a property) on a particular class so that it can only refer to a given type of value. This is similar to the way that <code>rdfs:range</code> restricts a property to only refer to a given type. The difference is that <code>rdfs:range</code> applies whenever the property is used, while the <code>owl:allValuesFrom</code> restriction on a class only applies to properties of that particular class.</p>
+
+<p>The camera ontology declares the following:</p>
+
+<p class="commandtext"><owl:Class rdf:ID="Simple-Large-Format"><br />
+ <rdfs:subClassOf rdf:resource="#Camera"/><br />
+ <rdfs:subClassOf><br />
+ <owl:Restriction><br />
+ <owl:onProperty rdf:resource="#body"/><br />
+ <owl:allValuesFrom rdf:resource="#BodyWithNonAdjustableShutterSpeed"/><br />
+ </owl:Restriction><br />
+ </rdfs:subClassOf><br />
+</owl:Class></p>
+
+<p>This means that <code>Simple-Large-Format</code> is a type of camera with an <code>owl:allValuesFrom</code> restriction placed upon it. Whenever this type of camera declares its body, then that body must be of type <code>BodyWithNonAdjustableShutterSpeed</code>.</p>
+
+<p>An invalid camera might be defined as:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="&camera;badBody"><br />
+ <rdf:type rdf:resource="#Simple-Large-Format"/><br />
+ <body><br />
+ <Body><br />
+ <shutter-speed rdf:parseType="Resource"><br />
+ <min>0.01</min><br />
+ <max>1.0</max><br />
+ </shutter-speed><br />
+ </Body><br />
+ </body><br />
+</rdf:Description></p>
+
+<p>The camera declared is named <code>badBody</code> (including the full <code>&camera;</code> namespace, its complete name is <code>http://www.xfront.com/owl/ontologies/camera/#badBody</code>), and it is a <code>Simple-Large-Format</code> camera. The problem is that it declares a body of type <code>Body</code>, but the ontology says that cameras of this type can only declare a body of type <code>BodyWithNonAdjustableShutterSpeed</code>.</p>
+
+<p>To check for inconsistencies on this constraint, you can perform the following query:</p>
+
+<p class="commandtext">select $s $p $x count (<br />
+ select $object<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $s $p $object<br />
+ and $object <rdf:type> $type<br />
+ and exclude($object $p2 $x )<br />
+)<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $r <rdf:type> <owl:Restriction><br />
+ and $r <owl:onProperty> $p<br />
+ and $r <owl:allValuesFrom> $x<br />
+ and $c <rdfs:subClassOf> $r and $s <rdf:type> $c and $s $p $o2<br />
+ having $k0 <mulgara:occursMoreThan> '0.0'^^<xsd:double><br />
+ order by $s;</p>
+
+<p>This finds restrictions <code>$r</code>, which apply to a predicate <code>$p</code>, and restrict a subject to only have objects of type <code>$x</code> when this predicate is used. In the OWL example above, <code>$r</code> matches the restriction, while <code>$p</code> matches the <code>body</code> predicate, and <code>$x</code> is <code>BodyWithNonAdjustableShutterSpeed</code>.</p>
+
+<p>Next, the query finds classes <code>$c</code>, which subclass this restriction. A more complete example can use <code>walk($c <owl:subClassOf> $r)</code> to be more thorough in finding all classes which ultimately inherit this restriction. Since restrictions are rarely removed any further than by a single sub-class relationship, a simple constraint like this finds the <code>Simple-Large-Format</code> class and places it in <code>$c</code>.</p>
+
+<p>The last two constraints in the outer query find all instances of <code>$c</code>, and finds statements where these <code>$s</code> instances use the <code>$p</code> predicate defined in the restriction. The instance <code>$s</code>, the predicate <code>$p</code>, and the type <code>$x</code> that the restriction refers to, are all passed into the subquery.</p>
+
+<p>The subquery looks for all statements where the instance of the required class uses the predicate to refer to an object, which it binds to <code>$object</code>. It then finds all statements which define the type for these objects, and excludes those objects whose type is the correct type for the restriction (<code>$x</code>). Unfortunately, <code>excludes</code> here is giving all statements in the camera model that do not match <code>$object</code> as a subject, and the type as the object. This is almost what is needed here, but there are some statements which should be excluded, that this constraint might allow through. This is a deficiency in iTQL that will be fixed in future versions of TKS. For now, it does finds all inconsistent statements, with only specialized cases being erroneously reported as inconsistent.</p>
+
+<p>Any remaining statements have objects of the incorrect type, and violate the constraint. These remaining statements are counted, and the <code>having</code> clause checks to see if the number of violating rows is greater than 0. If so, this data gets returned from the query.</p>
+
+<p>Any data returned from the query indicates an inconsistency in the data, according to the <code>owl:allValuesFrom</code> constraint.</p>
+
+<p>For the invalid camera above, the result of the query is:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#badBody, http://www.xfront.com/owl/ontologies/camera/#body,<br />
+ http://www.xfront.com/owl/ontologies/camera/#BodyWithNonAdjustableShutterSpeed, 1.0 ]</p>
+
+<p>This result indicates that the <code>&camera;badBody</code> object used the <code>&camera;body</code> predicate on a body that was not a <code>&camera;BodyWithNonAdjustableShutterSpeed</code> a total of 1 time. This showed up because the restriction required that <code>&camera;body</code> never be used to refer to the wrong type of body.</p>
+<div class="anchor"><a name="o2819"> </a></div>
+<h5>owl:someValuesFrom</h5>
+
+<p>The <code>owl:someValuesFrom</code> declaration restricts the use of a predicate (also called a property) on a particular class so that it must make at least one reference to a given type of value. This is similar to <code><a id="h2928" class="documentlinktemplate" title="owl:allValuesFrom" href="/inferencing/consistency.html#o2818">owl:allValuesFrom</a></code>, but with the weaker requirement that only a single object be of the required type.</p>
+
+<p>The camera ontology declares the following:</p>
+
+<p class="commandtext"><owl:Class rdf:ID="Camera"><br />
+ <rdfs:subClassOf rdf:resource="#PurchaseableItem"/><br />
+ <rdfs:subClassOf><br />
+ <owl:Restriction><br />
+ <owl:onProperty rdf:resource="#part"/><br />
+ <owl:someValuesFrom rdf:resource="#PurchaseableItem"/><br />
+ </owl:Restriction><br />
+ </rdfs:subClassOf><br />
+</owl:Class><br />
+<owl:Class rdf:ID="CarryStrap"><br />
+ <rdfs:subClassOf rdf:resource="#NonPurchaseableItem"/><br />
+</owl:Class></p>
+
+<p>This means that if a camera has any parts, then at least one of those parts must be a <code>PurchaseableItem</code>. Note that this does not mean that a came<em>ra i</em>s forced to have any parts. The rule only applies when the <code>part</code> predicate is used on a camera.</p>
+
+<p>The second class is a <code>CarryStrap</code> and is a type of <code>NonPurchaseableItem</code>. While a camera can have a carry strap as a part, this is not adequate on its own to meet the restriction on the <code>Camera</code> class.</p>
+
+<p>An invalid camera would declare one or more parts, with none of them being <code>PurchaseableItems</code>. For example:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="&camera;badParts"><br />
+ <rdf:type rdf:resource="#Camera"/><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <part><br />
+ <CarryStrap/><br />
+ </part><br />
+</rdf:Description></p>
+
+<p>This declares <code>badParts</code> as a digital camera. This camera has a single part, which is a carry strap. Since a part is declared, then at least one part must be a <code>PurchaseableItem</code>. Therefore, this camera violates the restriction.</p>
+
+<p>Note that <code>badParts</code> is explicitly declared to be of type <code>Camera</code>. In a fully inferenced system, this declaration would be redundant, as it can be inferred from the fact that <code>Digital</code> is a sub-class of <code>Camera</code>. Since <code>badParts</code> is a type of <code>Digital</code> then it follows that it is also a type of <code>Camera</code>. Given that this documentation is describing a system that does not yet do automatic inferencing, it is necessary to include inferable statements like this.</p>
+<div class="anchor"><a name="o3145"> </a></div>
+
+
+<p>To check for inconsistencies on this constraint, you can perform the following query:</p>
+
+<p class="commandtext">select $s $p $x count(<br />
+ select $o<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $s $p $o<br />
+ and $o <rdf:type> $x<br />
+)<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $r <rdf:type> <owl:Restriction><br />
+ and $r <owl:onProperty> $p<br />
+ and $r <owl:someValuesFrom> $x<br />
+ and $c <rdfs:subClassOf> $r<br />
+ and $s <rdf:type> $c<br />
+ and $s $p $obj<br />
+ having $k0 <mulgara:occursLessThan> '1.0'^^<xsd:double>;</p>
+
+<p>This finds restrictions <code>$r</code>, which apply to a predicate <code>$p</code>, and restricts a subject to only have objects of type <code>$x</code> when this predicate is used. In the OWL example above, <code>$r</code> matches the restriction, while <code>$p</code> matches the <code>part</code> predicate, and <code>$x</code> is <code>PurchaseableItem</code>.</p>
+
+<p>Next, the query finds classes <code>$c</code>, which subclass this restriction. A more complete example can use <code>walk($c <owl:subClassOf> $r)</code> to be more thorough in finding all classes which ultimately inherit this restriction, but this simpler form is adequate for most cases, including this example.</p>
+
+<p>The last two constraints in the outer query find all instances of <code>$c</code>, and find statements where these <code>$s</code> instances use the <code>$p</code> predicate defined in the restriction. The instance <code>$s</code>, the predicate <code>$p</code>, and the type <code>$x</code> that the restriction refers to, are all passed into the subquery.</p>
+
+<p>The subquery looks for all statements where the instance of the required class uses the predicate to refer to an object, which it binds to <code>$o</code>. It then finds all statements that define these objects to be of type <code>$x</code>, which is the required type in the restriction. The objects of the correct type are counted, and the <code>having</code> clause confirms that there is at least 1 of each. For any subjects of the restricted type (the type is <code>Camera</code> in this example), the restricted predicate is confirmed to be used correctly at least once. If not, then the count is 0, and the query returns the subject, predicate and missing type of the violated restriction.</p>
+
+<p>Using this on data containing the <code>badParts</code> object, the result of the query is:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#badParts, http://www.xfront.com/owl/ontologies/camera/#part,<br />
+ http://www.xfront.com/owl/ontologies/camera/#PurchaseableItem, 0.0 ]</p>
+
+<p>This shows that the <code>&camera;badParts</code> object had the <code>&camera;part</code> predicate used to refer to a <code>&camera;PurchaseableItem</code> 0 times. It showed up because the restriction required it to be used on <code>&camera;PurchaseableItems</code> at least once.</p>
+<div class="anchor"><a name="o2820"> </a></div>
+<h4>Cardinality Operations</h4>
+
+<p>The <code>owl:cardinality</code>, <code>owl:minimumCardinality</code> and <code>owl:maximumCardinality</code> declarations allow you to ensure that a given property occurs on an instance of a class. OWL-Lite provides the ability to express these three types of cardinality, but only with the values 0 and 1.</p>
+<div class="anchor"><a name="o2821"> </a></div>
+<h5>owl:cardinality</h5>
+
+<p>The camera ontology declares the following:</p>
+
+<p class="commandtext"><owl:Class rdf:ID="BodyWithNonAdjustableShutterSpeed"><br />
+ <rdfs:subClassOf rdf:resource="#Body"/><br />
+ <rdfs:subClassOf><br />
+ <owl:Restriction><br />
+ <owl:onProperty rdf:resource="#shutter-speed"/><br />
+ <owl:cardinality>0</owl:cardinality><br />
+ </owl:Restriction><br />
+ </rdfs:subClassOf><br />
+</owl:Class></p>
+
+<p>That is, if a camera's body has a non-adjustable shutter speed, it must not have a shutter speed.</p>
+
+<p>So an invalid camera would be:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="&camera;brokenShutterCamera"><br />
+ <rdf:type rdf:resource="#Large-Format"/><br />
+ <body><br />
+ <BodyWithNonAdjustableShutterSpeed><br />
+ <shutter-speed rdf:parseType="Resource"><br />
+ <min>0.001</min><br />
+ <max>1.0</max><br />
+ </shutter-speed><br />
+ </BodyWithNonAdjustableShutterSpeed><br />
+ </body><br />
+</rdf:Description></p>
+
+<p>This camera, <code>&camera;brokenShutterCamera</code>, has two values, <code>min</code> and <code>max</code>, for the shutter speed. The number of values is irrelevant. It is the fact that <code>shutter-speed</code> exists that is incorrect. The ontology specifies that the predicate, <code>shutter-speed</code>, is not allowed.</p>
+
+<p>To check that this constraint is enforced, you can perform the following query:</p>
+
+<p class="commandtext">select $s3 $s2 $p2 $v count (<br />
+ select $o2<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $s2 $p2 $o2 )<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $s <rdf:type> <owl:Class><br />
+ and $s <rdfs:subClassOf> $r<br />
+ and $r <rdf:type> <owl:Restriction><br />
+ and $r <owl:cardinality> $v<br />
+ and $r <owl:onProperty> $p2<br />
+ and $s2 $p3 $o2<br />
+ and $s2 <rdf:type> $s<br />
+ and $s3 $p4 $s2<br />
+ having $k0 <mulgara:notOccurs> $v<br />
+ order by $s3 ;</p>
+
+<p>This finds all cardinality restrictions with a given cardinality value, <code>$v</code>, on a given property, <code>$p2</code>. This is then projected into the count where the number of predicates of a given subject are counted, and if this count is not equal to <code>$v,</code> then it displays the name of that camera, <code>$s3</code>.</p>
+
+<p>The result of the query is:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/brokenShutter, _node281,<br />
+ http://www.xfront.com/owl/ontologies/camera/#shutter-speed, 0, 1.0 ]</p>
+
+<p>The first element in the result points to the name of the instance, the next two values, <code>$s2</code> and <code>$p2</code>, are required in the subquery. The <code>$v</code> variable is required to put the variable value into the <code>having</code> constraint. The last value is how many times that predicate exists.</p>
+
+<p>This can be used to display an error message such as:</p>
+
+<p class="commandtext">"Error in cardinality constraint: http://www.xfront.com/owl/ontologies/camera/brokenShutter instance required 0<br />
+shutter-speed but was 1.0"</p>
+
+<p>If a second camera instance exists, for example:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="&camera;shutterStutter"><br />
+ <rdf:type rdf:resource="#Large-Format"/><br />
+ <body><br />
+ <BodyWithNonAdjustableShutterSpeed><br />
+ <shutter-speed rdf:parseType="Resource"><br />
+ <min>0.01</min><br />
+ </shutter-speed><br />
+ <shutter-speed rdf:parseType="Resource"><br />
+ <min>0.01</min><br />
+ </shutter-speed><br />
+ </BodyWithNonAdjustableShutterSpeed><br />
+ </body><br />
+</rdf:Description></p>
+
+<p>The result of the query is:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/brokenShutter, _node158,<br />
+ http://www.xfront.com/owl/ontologies/camera/#shutter-speed, 0, 1.0 ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/shutterStutter, _node190,<br />
+ http://www.xfront.com/owl/ontologies/camera/#shutter-speed, 0, 2.0 ]</p>
+<div class="anchor"><a name="o2822"> </a></div>
+<h5>owl:minimumCardinality</h5>
+
+<p>The following restriction, <code>SLR</code>, defines a camera that has a maximum cardinality on the property <code>body</code> of 1 and a minimum cardinality on the property <code>lens</code>:</p>
+
+<p class="commandtext"><owl:Class rdf:ID="SLR"><br />
+ <owl:subClassOf rdf:about="#Camera"/><br />
+ ...<br />
+ <rdfs:subClassOf><br />
+ <owl:Restriction><br />
+ <owl:onProperty rdf:resource="#body"/><br />
+ <owl:maximumCardinality rdf:datatype="&xsd;double">1</owl:maximumCardinality><br />
+ </owl:Restriction><br />
+ </rdfs:subClassOf><br />
+ <rdfs:subClassOf><br />
+ <owl:Restriction><br />
+ <owl:onProperty rdf:resource="#lens"/><br />
+ <owl:minimumCardinality rdf:datatype="&xsd;double">1</owl:minimumCardinality><br />
+ </owl:Restriction><br />
+ </rdfs:subClassOf><br />
+</owl:Class></p>
+
+<p>Considering each constraint separately, the minimum cardinality constraint indicates that there must be at least one lens for a camera. This allows multiple lenses but there must be at least one. An example of an instance of a camera that breaks this constraint is one that does not have a lens, for example:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="&camera;noLensSLR"><br />
+ <rdf:type rdf:resource="#SLR"/><br />
+ <body><br />
+ <Body><br />
+ <shutter-speed rdf:parseType="Resource"><br />
+ <min>0.01</min><br />
+ <max>1.0</max><br />
+ </shutter-speed><br />
+ </Body><br />
+ </body><br />
+</rdf:Description></p>
+
+<p>To find the illegally constructed camera, you can perform the following query:</p>
+
+<p class="commandtext">select $s2 $p2 $v count (<br />
+ select $o2<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $s2 $p2 $o2)<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $s <rdf:type> <owl:Class><br />
+ and $s <rdfs:rdfs:subClassOf> $r<br />
+ and $r <rdf:type> <owl:Restriction><br />
+ and $r <owl:minimumCardinality> $v<br />
+ and $r <owl:onProperty> $p2<br />
+ and $s2 $p3 $o2<br />
+ and $s2 <rdf:type> $s<br />
+ having $k0 <mulgara:occursLessThan> $v<br />
+ order by $s2 ;</p>
+
+<p>This finds all minimum cardinality restrictions with a given cardinality value, <code>$v</code>, on a given property, <code>$p2</code>. The joining of <code>$s2 $p3 $o2</code> and <code>$s2 <rdf:type> $s</code> restricts what is projected into the <code>count</code>, to only the statements that are of the correct type, <code>$s</code>, and appear in the graph in order. When this is projected into the subquery, the number of predicates of a given subject are counted, and if this count is less than <code>$v</code>, then it is displayed with the value in <code>$s2</code>.</p>
+
+<p>The result of the query is:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/noLensSLR, http://www.xfront.com/owl/ontologies/camera/#lens,<br />
+ 1.0, 0.0 ]</p>
+
+<p>This shows the instance, <code>http://www.xfront.com/owl/ontologies/camera/noLensSLR</code>, has 0.0 counts for the predicate <code>http://www.xfront.com/owl/ontologies/camera/#lens,</code> which requires a value of at least 1.0.</p>
+
+
+<div class="anchor"><a name="o2823"> </a></div>
+<h5>owl:maximumCardinality</h5>
+
+<p>Using the same SLR example restriction definition given for <code>owl:minimumCardinality</code>, we are now only interested in the maximum cardinality restriction:</p>
+
+<p class="commandtext"><owl:Class rdf:ID="SLR"><br />
+ <owl:subClassOf rdf:about="#Camera"/><br />
+ ...<br />
+ <owl:Restriction><br />
+ <owl:onProperty rdf:resource="#body"/><br />
+ <owl:maximumCardinality rdf:datatype="&xsd;double">1</owl:maximumCardinality><br />
+ </owl:Restriction><br />
+ </rdfs:subClassOf><br />
+ ...<br />
+</owl:Class></p>
+
+<p>This means that an SLR camera must have only one body. An example of an instance of a camera that breaks this restriction is as follows:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="urn:camera:binocularSLR"><br />
+ <rdf:type rdf:resource="#SLR"/><br />
+ <body><br />
+ <Body><br />
+ <shutter-speed rdf:parseType="Resource"><br />
+ <min>0.01</min><br />
+ <max>1.0</max><br />
+ <units>seconds</units><br />
+ </shutter-speed><br />
+ </Body><br />
+ </body><br />
+ <body><br />
+ <Body><br />
+ <shutter-speed rdf:parseType="Resource"><br />
+ <min>0.01</min><br />
+ <max>1.0</max><br />
+ <units>seconds</units><br />
+ </shutter-speed><br />
+ </Body><br />
+ </body><br />
+ ...<br />
+</rdf:Description></p>
+
+<p>To find this illegally constructed camera, you can perform the following query:</p>
+
+<p class="commandtext">select $s2 $p2 $v count (<br />
+ select $o2<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $s2 $p2 $o2 )<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $s <rdf:type> <owl:Class><br />
+ and $s <rdfs:subClassOf> $r<br />
+ and $r <rdf:type> <owl:Restriction><br />
+ and $r <owl:maximumCardinality> $v<br />
+ and $r <owl:onProperty> $p2<br />
+ and $s2 $p3 $o2<br />
+ and $s2 <rdf:type> $s<br />
+ having $k0 <mulgara:occursMoreThan> $v<br />
+ order by $s2 ;</p>
+
+<p>This finds all maximum cardinality restrictions with a given cardinality value, <code>$v</code>, on a given property, <code>$p2</code>. Each of these results, such as 1 and <code>#body</code> respectively, are used to constrain the count. The predicate value, <code>$p2</code>, is used to query the graph and pass into the count <code>$s2</code>, <code>$p2</code>, <code>$o2</code> triples. The count produces a value and this is constrained by the variable <code>$v</code>, 1 in this case by the <code>having</code> clause. If the predicate, <code>#body</code> appears more than once for any subject then it is displayed.</p>
+
+<p>The result of the query is:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/binocularSLR, http://www.xfront.com/owl/ontologies/camera/#body,<br />
+ 1.0, 2.0 ]</p>
+
+<p>This indicates that instance, <code>http://www.xfront.com/owl/ontologies/camera/binocularSLR</code>, is illegal as it has two predicates called <code>body</code> instead of one.</p>
+
+
+<div class="anchor"><a name="o2824"> </a></div>
+<h4>owl:Nothing</h4>
+
+<p>Available in next release.</p>
+
+
+<div class="anchor"><a name="o2825"> </a></div>
+<h4>owl:Restriction</h4>
+
+<p>Available in next release.</p>
+
+
+<div class="anchor"><a name="o2826"> </a></div>
+<h4>owl:Thing</h4>
+
+<p>Available in next release.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/inferencing/entailment.html
===================================================================
--- trunk/docs/site/inferencing/entailment.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/inferencing/entailment.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,1114 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Entailment</title>
+ <meta name="keywords" content="Entailment, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/inferencing/entailment.html#o2802">AllDifferent</a></p>
+ <a href="/inferencing/entailment.html#o2803">distinctMembers</a> |\
+ <a href="/inferencing/entailment.html#o2804">Class</a> |
+ <a href="/inferencing/entailment.html#o2805">FunctionalProperty</a> |\
+ <a href="/inferencing/entailment.html#o2930">sameAs</a> |
+ <a href="/inferencing/entailment.html#o2807">InverseFunctionalProperty</a> |
+ <a href="/inferencing/entailment.html#o2808">differentFrom</a> |
+ <a href="/inferencing/entailment.html#o2809">inverseOf</a> |
+ <a href="/inferencing/entailment.html#o2811">SymmetricProperty</a> |
+ <a href="/inferencing/entailment.html#o2812">TransitiveProperty</a> |
+ <a href="/inferencing/entailment.html#o2813">equivalentClass</a> |
+ <a href="/inferencing/entailment.html#o2814">equivalentProperty</a> |
+ <a href="/inferencing/entailment.html#o2815">intersectionOf</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/inferencing/owl.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/inferencing/consistency.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also |\r\â <a href="/inferencing/owl.html">OWL-Lite Operations Using iTQL</a> |\r\â <a href="/inferencing/consistency.html">Consistency Checking</a></p>
+
+ -->
+
+
+
+<h3>Entailment</h3>
+
+<p>Entailment operations determine the truth of the data you have.</p>
+
+<div class="anchor"><a name="o2802"> </a></div>
+<h4>owl:AllDifferent</h4>
+
+<p>Available in next release.</p>
+<div class="anchor"><a name="o2803"> </a></div>
+<h4>owl:distinctMembers</h4>
+
+<p>Available in next release.</p>
+<div class="anchor"><a name="o2804"> </a></div>
+<h4>owl:Class</h4>
+
+<p>All Owl types share this type.</p>
+<div class="anchor"><a name="o2805"> </a></div>
+<h4>owl:FunctionalProperty</h4>
+
+<p>The <code>owl:FunctionalProperty</code> declaration specifies that a predicate is functional. That is, there is only one possible object when a predicate is used on a given subject. If the predicate is used to refer to the subject again, then the object in the new statement must be the same object as was in the previous statement.</p>
+
+<p>An example of a functional predicate is <code>has-Father</code>. For any given individual, there can only be one father.</p>
+
+<p>The camera ontology declares the following:</p>
+
+<p class="commandtext"><owl:ObjectProperty rdf:ID="viewFinder"><br />
+ <rdf:type rdf:resource="&owl;FunctionalProperty"/><br />
+ <rdfs:domain rdf:resource="#Camera"/><br />
+ <rdfs:range rdf:resource="#Viewer"/><br />
+</owl:ObjectProperty></p>
+
+<p>This means that the predicate <code>viewFinder</code> is a functional property. This statement declares that cameras have view finders of type <code>Viewer</code>, and that each camera can only have a single viewer.</p>
+
+<p>An example of the use of this functional property is shown here:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="#duplicateWindow"><br />
+ <rdf:type rdf:resource="#Camera"/><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <body><br />
+ <Body/><br />
+ </body><br />
+ <lens><br />
+ <Lens/><br />
+ </lens><br />
+ <viewFinder rdf:resource="#ThroughTheLens"/><br />
+ <viewFinder><br />
+ <rdf:Description/><br />
+ </viewFinder><br />
+</rdf:Description></p>
+
+<p>This declares a camera with two view finders. The first view finder is the object <code>ThroughTheLens</code>, while the second one is a blank node. That is, an unidentified node. Because <code>viewFinder</code> is functional, the second view finder must be the same object as the first.</p>
+
+<p>Inferring that these nodes are equivalent can be done using the following iTQL:</p>
+
+<p class="commandtext">select $object1 <owl:sameAs> $object2<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $predicate <rdf:type> <owl:FunctionalProperty><br />
+ and $subject $predicate $object1<br />
+ and $subject $predicate $object2;</p>
+
+<p>The query finds all predicates of type <code>owl:FunctionalProperty</code>. It then finds all statements that use one subject and this predicate, and puts the objects into the variables <code>$object1</code> and <code>$object2</code>. Unfortunately, iTQL has no way of preventing <code>$object1</code> and <code>$object2</code> from equaling each other, but it is not strictly invalid to find these statements. The result of the query is a triple the states that <code>$object1</code> and <code>$object2</code> are the same individuals.</p>
+
+<p>The query returns the following:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#ThroughTheLens, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#ThroughTheLens ]<br />
+[ _node534, http://www.w3.org/2002/07/owl#sameAs, http://www.xfront.com/owl/ontologies/camera/#ThroughTheLens ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#ThroughTheLens, http://www.w3.org/2002/07/owl#sameAs, _node534 ]<br />
+[ _node534, http://www.w3.org/2002/07/owl#sameAs, _node534 ]</p>
+
+<p>This shows that <code>ThroughTheLens</code> and the blank node are the same object. It also reports that the blank node is the same as itself and that <code>ThroughTheLens</code> is the same as itself. While these statements are redundant, they are still correct.</p>
+
+<p>If the redundant statements are acceptable, this query can be used in an <code><a id="h1325" class="documentlinktemplate" title="insert" href="/itqlcommands/insert.html">insert</a></code> command to feed the inferred statements back into a model. Otherwise, the non-redundant data and be programmatically extracted and inserted.</p>
+<div class="anchor"><a name="o2930"> </a></div>
+<h4>owl:sameAs</h4>
+
+<p>The <code>owl:sameAs</code> declaration specifies that an instance of a type is the same instance as another object. For example, in a system where <code>President of the United States (1992-2000)</code> and <code>Bill Clinton</code> are declared separately, <code>owl:sameAs</code> declares that one is the same as the other.</p>
+
+<p>The camera ontology declares the following:</p>
+
+<p class="commandtext"><owl:Class rdf:ID="Modern"><br />
+ <owl:sameAs rdf:resource="#Digital"/><br />
+</owl:Class><br />
+<br />
+<owl:Class rdf:ID="badClass"><br />
+ <owl:sameAs rdf:resource="#part"/><br />
+</owl:Class><br />
+<br />
+<owl:ObjectProperty rdf:ID="piece"><br />
+ <owl:sameAs rdf:resource="#part"/><br />
+</owl:ObjectProperty><br />
+<br />
+<owl:ObjectProperty rdf:ID="badProperty"><br />
+ <owl:sameAs rdf:resource="#CarryStrap"/><br />
+</owl:ObjectProperty></p>
+
+<p>This describes a <code>Modern </code>class and a <code>piece </code>property that are the same as the <code>Digital </code>class and <code>part </code>property, respectively. It also describes <code>badClass</code> and <code>badProperty</code>, which are erroneously the same as a class and a property respectively. These errors are highlighted in the Inconsistency section, later in the document.</p>
+
+<p>In the camera data there are the following three cameras:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="#SinarM"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <rdf:type rdf:resource="#Simple-Large-Format"/><br />
+ <body><br />
+ <BodyWithNonAdjustableShutterSpeed about="#SinarMbody"><br />
+ <matchingPart><br />
+ <Lens rdf:about="#SinaronDigital4.5/45DB"/><br />
+ </matchingPart><br />
+ </BodyWithNonAdjustableShutterSpeed><br />
+ </body><br />
+ <lens><br />
+ <Lens rdf:about="#SinaronDigital4.5/45DB"><br />
+ <aperture>4.5</aperture><br />
+ <focal-length>45mm</focal-length> </Lens><br />
+ </lens><br />
+</rdf:Description><br />
+<br />
+<rdf:Description rdf:about="#SinarMedium"><br />
+ <owl:sameAs rdf:resource="#SinarM"/><br />
+ <lens><br />
+ <Lens rdf:about="#Sinaron-SD"><br />
+ <owl:sameAs rdf:resource="#SinaronDigital4.5/45DB"/><br />
+ </Lens><br />
+ </lens><br />
+</rdf:Description><br />
+<br />
+<rdf:Description rdf:about="#MediumSinar"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <owl:sameAs rdf:resource="#SinarMedium"/><br />
+</rdf:Description><br />
+<br />
+<rdf:Description rdf:about="#SameCamera"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <owl:sameAs rdf:resource="#DifferentCamera"/><br />
+</rdf:Description><br />
+<br />
+<rdf:Description rdf:about="#DifferentCamera"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <owl:differentFrom rdf:resource="#SameCamera"/><br />
+</rdf:Description><br />
+<br />
+<rdf:Description rdf:about="#badClassCamera"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <owl:sameAs rdf:resource="#Body"/><br />
+</rdf:Description><br />
+ <br />
+<rdf:Description rdf:about="#badPropertyCamera"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <owl:sameAs rdf:resource="#lens"/><br />
+</rdf:Description></p>
+
+<p>This declares a camera <code>SinarM</code> with a body and a lens. It also declares a camera <code>SinarMedium</code> with a lens <code>Sinaron-SD</code>. <code>SinarMedium</code> is the same as <code>SinarM</code>, and the <code>Sinaron-SD</code> lens is the same as the lens for <code>SinarM</code>. Finally, there is a camera <code>MediumSinar,</code> which is the same as <code>SinarMedium</code>.</p>
+
+<p>The next two cameras are <code>SameCamera</code> and <code>BadCamera</code>. These erroneously refer to each other as being the same and different. This is checked for, along with the ontology, later on in the <a id="h2938" class="documentlinktemplate" title="Inconsistencies" href="/inferencing/entailment.html#o2936">Inconsistencies section</a>.</p>
+
+<p>The last two cameras declared are <code>badClassCamera</code> and <code>badPropertyCamera</code>. These declare themselves to be the same as a class (<code>Body</code>) and a property (<code>lens</code>), which is an error. This is also checked for in the <a id="h2938_2" class="documentlinktemplate" title="Inconsistencies" href="/inferencing/entailment.html#o2936">Inconsistencies section</a>.</p>
+
+<p>The <code>owl:sameAs</code> statements are found directly with the following iTQL command:</p>
+
+<p class="commandtext">select $x <owl:sameAs> $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $x <owl:sameAs> $y;</p>
+
+<p>This returns:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#Modern, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#Digital ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#badProperty, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#CarryStrap ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#badClass, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#part ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#piece, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#part ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#badClassCamera, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#Body ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#badPropertyCamera, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#lens ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#SameCamera, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#DifferentCamera ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#MediumSinar, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#SinarMedium ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#Sinaron-SD, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#SinaronDigital4.5/45DB ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#SinarMedium, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#SinarM ]</p>
+<div class="anchor"><a name="o2931"> </a></div>
+<h5>Transitivity</h5>
+
+<p><code>owl:sameAs</code> is a transitive predicate. For example, because <code>MediumSinar</code> is the same as <code>SinarMedium</code>, and <code>SinarMedium</code> is the same as <code>SinarM</code>, it is valid to say that <code>MediumSinar</code> is the same as <code>SinarM</code>.</p>
+
+<p>Inferred statements based on the transitivity of <code>owl:sameAs</code> are created with the following iTQL command:</p>
+
+<p class="commandtext">select $x <owl:sameAs> $z<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where trans($x <owl:sameAs> $z);</p>
+
+<p>The query returns the following:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#MediumSinar, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#SinarM ]</p>
+<div class="anchor"><a name="o2932"> </a></div>
+<h5>Reflexivity</h5>
+
+<p><code>owl:sameAs</code> is also a reflexive predicate. That is, any instance is the same as itself. For example, it is valid to say <code>X <owl:sameAs> X</code> for any value of X that is an instance.</p>
+
+<p>Statements of this form are generated with the following iTQL:</p>
+
+<p class="commandtext">select $x <owl:sameAs> $x<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $x <rdf:type> $c<br />
+ and $c <rdf:type> <owl:Class>;</p>
+
+<p>The query returns a statement for every instance in the system. The results are too large to show here, but an example row is as follows:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#SinarF2, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#SinarF2 ]</p>
+<div class="anchor"><a name="o2933"> </a></div>
+<h5>Symmetry</h5>
+
+<p><code>owl:sameAs</code> is also a symmetric predicate. That is, if one item is declared the same as a second item, then the second item must also be the same as the first item.</p>
+
+<p>New statements to this effect are generated with the following iTQL:</p>
+
+<p class="commandtext">select $x <owl:sameAs> $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $y <owl:sameAs> $x;</p>
+
+<p>The query returns the following:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#Digital, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#Modern ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#CarryStrap, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#badProperty ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#part, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#badClass ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#part, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#piece ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#Body, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#badClassCamera ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#lens, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#badPropertyCamera ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#DifferentCamera, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#SameCamera ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#SinarMedium, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#MediumSinar ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#SinaronDigital4.5/45DB, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#Sinaron-SD ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#SinarM, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#SinarMedium ]</p>
+
+<p>Another effect of this symmetry is that all properties applying to an instance also apply to everything that is the same as that instance. These statements are inferred with the following iTQL:</p>
+
+<p class="commandtext">select $y $p $z<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $x $p $z<br />
+ and ($x <owl:sameAs> $y<br />
+ or $y <owl:sameAs> $x);</p>
+
+<p>The <code>or</code> statement at the end of the <code>where</code> clause finds <code>owl:sameAs</code> statements that point both ways. If the inferred statements from the previous symmetry query have already been inserted, then it is not necessary to have both options here.</p>
+
+<p>The query generates 45 new statements, 5 of which are as follows:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#Digital, http://www.w3.org/1999/02/22-rdf-syntax-ns#type,<br />
+ http://www.w3.org/2002/07/owl#Class ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#Modern, http://www.w3.org/2000/01/rdf-schema#subClassOf,<br />
+ http://www.xfront.com/owl/ontologies/camera/#Camera ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#badClass, http://www.w3.org/2000/01/rdf-schema#range,<br />
+ http://www.xfront.com/owl/ontologies/camera/#PurchaseableItem ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#badPropertyCamera, http://www.w3.org/2000/01/rdf-schema#range,<br />
+ http://www.xfront.com/owl/ontologies/camera/#Lens ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#badPropertyCamera, http://www.w3.org/2000/01/rdf-schema#domain,<br />
+ http://www.xfront.com/owl/ontologies/camera/#Camera ]</p>
+
+<p>Similarly, if X is the same as Y, then any statements that refer to X as a property need to be duplicated to refer to Y as well, using the following iTQL:</p>
+
+<p class="commandtext">select $z $p $x<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $z $p $y <br />
+ and ($x <owl:sameAs> $y<br />
+ or $y <owl:sameAs> $x);</p>
+
+<p>Again, the <code>or</code> part of the query can be skipped if the symmetry statements have already been inserted.</p>
+<div class="anchor"><a name="o2934"> </a></div>
+<h5>Class Equivalence</h5>
+
+<p><code>owl:sameAs</code> can also be used to indicate that two classes are equivalent. Since <code>owl:equivalentClass</code> does this as well, then these predicates can be inferred from <code>owl:sameAs</code> statements, with the following iTQL:</p>
+
+<p class="commandtext">select $x <owl:equivalentClass> $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where ($x <owl:sameAs> $y<br />
+ or $y <owl:sameAs> $x)<br />
+ and ($x <rdf:type> <owl:Class><br />
+ or $y <rdf:type> <owl:Class>);</p>
+
+<p>The query returns the following:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#Modern, http://www.w3.org/2002/07/owl#equivalentClass,<br />
+ http://www.xfront.com/owl/ontologies/camera/#Digital ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#Digital, http://www.w3.org/2002/07/owl#equivalentClass,<br />
+ http://www.xfront.com/owl/ontologies/camera/#Modern ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#badProperty, http://www.w3.org/2002/07/owl#equivalentClass,<br />
+ http://www.xfront.com/owl/ontologies/camera/#CarryStrap ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#part, http://www.w3.org/2002/07/owl#equivalentClass,<br />
+ http://www.xfront.com/owl/ontologies/camera/#badClass ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#badClass, http://www.w3.org/2002/07/owl#equivalentClass,<br />
+ http://www.xfront.com/owl/ontologies/camera/#part ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#badClassCamera, http://www.w3.org/2002/07/owl#equivalentClass,<br />
+ http://www.xfront.com/owl/ontologies/camera/#Body ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#Body, http://www.w3.org/2002/07/owl#equivalentClass,<br />
+ http://www.xfront.com/owl/ontologies/camera/#badClassCamera ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#CarryStrap, http://www.w3.org/2002/07/owl#equivalentClass,<br />
+ http://www.xfront.com/owl/ontologies/camera/#badProperty ]</p>
+
+<p class="note"><strong>Note -</strong> The inclusion of <code>badProperty</code> in the result is detected in the inconsistency checks later.</p>
+<div class="anchor"><a name="o2935"> </a></div>
+<h5>Property Equivalence</h5>
+
+<p>Like class equivalence, property equivalence is described by both <code>owl:sameAs</code> and by <code>owl:equivalentProperty</code>. Because there are seven possible declaration types that refer to properties, the iTQL for the inferred statements is longer than usual:</p>
+
+<p class="commandtext">select $x <owl:equivalentProperty> $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where ($x <owl:sameAs> $y<br />
+ or $y <owl:sameAs> $x)<br />
+ and ($x <rdf:type> <rdf:Property><br />
+ or $y <rdf:type> <rdf:Property><br />
+ or $x <rdf:type> <owl:ObjectProperty><br />
+ or $y <rdf:type> <owl:ObjectProperty><br />
+ or $x <rdf:type> <owl:DatatypeProperty><br />
+ or $y <rdf:type> <owl:DatatypeProperty><br />
+ or $x <rdf:type> <owl:FunctionalProperty><br />
+ or $y <rdf:type> <owl:FunctionalProperty><br />
+ or $x <rdf:type> <owl:InverseFunctionalProperty><br />
+ or $y <rdf:type> <owl:InverseFunctionalProperty><br />
+ or $x <rdf:type> <owl:TransitiveProperty><br />
+ or $y <rdf:type> <owl:TransitiveProperty><br />
+ or $x <rdf:type> <owl:SymmetricProperty><br />
+ or $y <rdf:type> <owl:SymmetricProperty>);</p>
+
+<p>The query returns the following:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#CarryStrap, http://www.w3.org/2002/07/owl#equivalentProperty,<br />
+ http://www.xfront.com/owl/ontologies/camera/#badProperty ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#badClass, http://www.w3.org/2002/07/owl#equivalentProperty,<br />
+ http://www.xfront.com/owl/ontologies/camera/#part ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#badPropertyCamera, http://www.w3.org/2002/07/owl#equivalentProperty,<br />
+ http://www.xfront.com/owl/ontologies/camera/#lens ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#part, http://www.w3.org/2002/07/owl#equivalentProperty,<br />
+ http://www.xfront.com/owl/ontologies/camera/#badClass ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#part, http://www.w3.org/2002/07/owl#equivalentProperty,<br />
+ http://www.xfront.com/owl/ontologies/camera/#piece ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#piece, http://www.w3.org/2002/07/owl#equivalentProperty,<br />
+ http://www.xfront.com/owl/ontologies/camera/#part ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#lens, http://www.w3.org/2002/07/owl#equivalentProperty,<br />
+ http://www.xfront.com/owl/ontologies/camera/#badPropertyCamera ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#badProperty, http://www.w3.org/2002/07/owl#equivalentProperty,<br />
+ http://www.xfront.com/owl/ontologies/camera/#CarryStrap ]</p>
+<div class="anchor"><a name="o2936"> </a></div>
+<h5>Inconsistencies</h5>
+
+<p>There are four types of inconsistencies associated with <code>owl:sameAs</code>:</p>
+<ol><li>Objects declaring themselves to be the same and different at the same time.</li><li>An instance and a class declared to be the same.</li><li>An instance and a property declared to be the same.</li><li>A class and a property declared to be the same.</li></ol>
+<p>These are all illegal in OWL-Lite.</p>
+
+<p>The first inconsistency (objects declaring themselves to be both the same and different at the same time) is checked for with the following iTQL:</p>
+
+<p class="commandtext">select $x $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where ($x <owl:sameAs> $y<br />
+ or $y <owl:sameAs> $x)<br />
+ and ($x <owl:differentFrom> $y<br />
+ or $y <owl:differentFrom> $x);</p>
+
+<p>The query returns the following:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#SameCamera, http://www.xfront.com/owl/ontologies/camera/#DifferentCamera ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#DifferentCamera, http://www.xfront.com/owl/ontologies/camera/#SameCamera ]</p>
+
+<p>The data declares that <code>SameCamera</code> is the same as <code>DifferentCamera</code>, while at the same time declaring <code>DifferentCamera</code> is different from <code>SameCamera</code>.</p>
+
+<p>The second inconsistency (an instance and a class declared to be the same) is checked for with the following:</p>
+
+<p class="commandtext">select $x $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $x <rdf:type> $c<br />
+ and $c <rdf:type> <owl:Class><br />
+ and $y <rdf:type> <owl:Class><br />
+ and ($x <owl:sameAs> $y<br />
+ or $y <owl:sameAs> $x);</p>
+
+<p>The query returns the following:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#badClassCamera, http://www.xfront.com/owl/ontologies/camera/#Body ]</p>
+
+<p>This data is inconsistent because <code>badClassCamera</code> is an instance of the <code>Digital</code> class, <code>Body</code> is a class, and there is a statement declaring them to be the same as each other.</p>
+
+<p>The third inconsistency (an instance and a property declared to be the same) needs a longer test, in order to find all the property types. The query is as follows:</p>
+
+<p class="commandtext">select $x $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $x <rdf:type> $c<br />
+ and $c <rdf:type> <owl:Class><br />
+ and ($x <owl:sameAs> $y<br />
+ or $y <owl:sameAs> $x)<br />
+ and ($y <rdf:type> <rdf:Property><br />
+ or $y <rdf:type> <owl:ObjectProperty><br />
+ or $y <rdf:type> <owl:DatatypeProperty><br />
+ or $y <rdf:type> <owl:FunctionalProperty><br />
+ or $y <rdf:type> <owl:InverseFunctionalProperty><br />
+ or $y <rdf:type> <owl:TransitiveProperty><br />
+ or $y <rdf:type> <owl:SymmetricProperty>);</p>
+
+<p>The query returns the following:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#badPropertyCamera, http://www.xfront.com/owl/ontologies/camera/#lens ]</p>
+
+<p>This data is inconsistent because <code>badPropertyCamera</code> is an instance of the <code>Digital</code> class, <code>lens</code> is a property, and there is a statement declaring them to be the same as each other.</p>
+
+<p>The last inconsistency (a class and a property declared to be the same) is checked for with the following:</p>
+
+<p class="commandtext">select $x $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $x <rdf:type> <owl:Class><br />
+ and ($x <owl:sameAs> $y<br />
+ or $y <owl:sameAs> $x)<br />
+ and ($y <rdf:type> <rdf:Property><br />
+ or $y <rdf:type> <owl:ObjectProperty><br />
+ or $y <rdf:type> <owl:DatatypeProperty><br />
+ or $y <rdf:type> <owl:FunctionalProperty><br />
+ or $y <rdf:type> <owl:InverseFunctionalProperty><br />
+ or $y <rdf:type> <owl:TransitiveProperty><br />
+ or $y <rdf:type> <owl:SymmetricProperty>);</p>
+
+<p>The query returns the following:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#CarryStrap, http://www.xfront.com/owl/ontologies/camera/#badProperty ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#badClass, http://www.xfront.com/owl/ontologies/camera/#part ]</p>
+
+<p>This shows that the:</p>
+<ul><li><code>badProperty</code> property is declared to be the same as the <code>CarryStrap</code> class</li><li><code>badClass</code> class is declared to be the same as the <code>part</code> property</li></ul>
+<div class="anchor"><a name="o2937"> </a></div>
+<h5>Note on Consistency Checking and Inferences</h5>
+
+<p>Like all inconsistency checks, the only way to test every possible condition is to infer all possible statements first. Otherwise, non-obvious inconsistencies are not shown.</p>
+<div class="anchor"><a name="o2807"> </a></div>
+<h4>owl:InverseFunctionalProperty</h4>
+
+<p>The <code>owl:InverseFunctionalProperty</code> declaration specifies that a predicate is inverse functional. That is, there is only one possible subject when a predicate is used to refer to a given object. If the predicate is used to refer to the object again, then the subject in the new statement must be the same subject as was in the previous statement.</p>
+
+<p>An example of a functional predicate is an e-mail address. While individuals can have several e-mail addresses, each individual e-mail address can only refer to a single person.</p>
+
+<p>The camera ontology declares the following:</p>
+
+<p class="commandtext"><owl:InverseFunctionalProperty rdf:ID="serial-id"> <br />
+ <rdfs:domain rdf:resource="#Body"/> <br />
+ <rdfs:range rdf:resource="#SerialID"/><br />
+</owl:InverseFunctionalProperty></p>
+
+<p>This means that the predicate <code>serial-id</code> is an inverse functional property. This statement declares that <code>SerialID</code> uniquely identify a Body.</p>
+
+<p>An example of the use of this inverse functional property is shown here:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="#doubleSerial"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <body><br />
+ <Body rdf:about="#sharedBody"><br />
+ <serial-id><br />
+ <SerialID rdf:about="#3302656895"><br />
+ <serialType>numeric</serialType><br />
+ <serialValue>3302656895</serialValue><br />
+ </SerialID><br />
+ </serial-id><br />
+ </Body><br />
+ </body><br />
+ <lens><br />
+ <Lens rdf:about="#Sinaron-S"><br />
+ <focal-length>135mm</focal-length><br />
+ </Lens><br />
+ </lens><br />
+</rdf:Description><br />
+<rdf:Description rdf:about="#doubleSerial2"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <body><br />
+ <Body><br />
+ <serial-id><br />
+ <SerialID rdf:about="#3302656895"><br />
+ <serialType>numeric</serialType><br />
+ <serialValue>3302656895</serialValue><br />
+ </SerialID><br />
+ </serial-id><br />
+ </Body><br />
+ </body><br />
+ <lens><br />
+ <Lens rdf:about="#Sinaron-SW"><br />
+ <focal-length>120mm</focal-length><br />
+ </Lens><br />
+ </lens><br />
+</rdf:Description></p>
+
+<p>This declares two cameras with bodies that have the same serial ID. The first body has the name <code>sharedBody</code>. Because <code>serial-id</code> is inverse functional, the second camera body must be the same as the first.</p>
+
+<p>Inferring that these bodies are the same can be done using the following iTQL:</p>
+
+<p class="commandtext">select $subject1 <owl:sameAs> $subject2<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $predicate <rdf:type> <owl:InverseFunctionalProperty><br />
+ and $subject1 $predicate $object<br />
+ and $subject2 $predicate $object;</p>
+
+<p>This query finds all predicates of type <code>owl:InverseFunctionalProperty</code>. It then finds all statements that use an object and this predicate, and puts the subjects into the variables <code>$subject1</code> and <code>$subject2</code>. Unfortunately, iTQL has no way of preventing <code>$subject1</code> and <code>$subject2</code> from equaling each other, but it is not strictly invalid to find these statements. The result of the query is a triple that states that <code>$subject1</code> and <code>$subject2</code> are the same individuals.</p>
+
+<p>The query returns the following:</p>
+
+<p class="commandtext">[ _node249, http://www.w3.org/2002/07/owl#sameAs, _node249 ]<br />
+[ _node249, http://www.w3.org/2002/07/owl#sameAs, http://www.xfront.com/owl/ontologies/camera/#sharedBody ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#sharedBody, http://www.w3.org/2002/07/owl#sameAs, _node249 ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#sharedBody, http://www.w3.org/2002/07/owl#sameAs,<br />
+ http://www.xfront.com/owl/ontologies/camera/#sharedBody ]</p>
+
+<p>This shows that <code>sharedBody</code> and the blank node are the same object. It also reports that the blank node is the same as itself and that <code>sharedBody</code> is the same as itself. While these statements are redundant, they are still correct.</p>
+
+<p>If the redundant statements are acceptable, then this query can be used in an <code><a id="h1325_2" class="documentlinktemplate" title="insert" href="/itqlcommands/insert.html">insert</a></code> command to feed the inferred statements back into a model. Otherwise, the non-redundant data and be programmatically extracted and inserted.</p>
+<div class="anchor"><a name="o2808"> </a></div>
+<h4>owl:differentFrom</h4>
+
+<p>The <code>owl:differentFrom</code> declaration specifies that a node is different from another node. It can be used on any kind of node, including classes, properties, and instance data. Nodes of dissimilar types are naturally different, so this predicate is guaranteed to be used consistently in these cases. Where <code>owl:differentFrom</code> is more useful, is for nodes of the same type, to make it absolutely clear that two nodes cannot be considered the same as each other.</p>
+
+<p>The camera ontology declares the following:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="#SinarP2"><br />
+ <rdf:type rdf:resource="#Simple-Large-Format"/><br />
+ <body><br />
+ <BodyWithNonAdjustableShutterSpeed/><br />
+ </body><br />
+ <lens><br />
+ <Lens rdf:about="#Sinaron-S"><br />
+ <focal-length>135mm</focal-length><br />
+ </Lens><br />
+ </lens><br />
+</rdf:Description><br />
+<br />
+<rdf:Description rdf:about="#SinarM"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <owl:differentFrom rdf:resource="#SinarP2"/><br />
+ <rdf:type rdf:resource="#Simple-Large-Format"/><br />
+ <body><br />
+ <BodyWithNonAdjustableShutterSpeed about="#SinarMbody"><br />
+ <matchingPart><br />
+ <Lens rdf:about="#SinaronDigital4.5/45DB"/><br />
+ </matchingPart><br />
+ </BodyWithNonAdjustableShutterSpeed><br />
+ </body><br />
+ <lens><br />
+ <Lens rdf:about="#SinaronDigital4.5/45DB"><br />
+ <aperture>4.5</aperture><br />
+ <focal-length>45mm</focal-length><br />
+ </Lens><br />
+ </lens><br />
+</rdf:Description><br />
+<br />
+<rdf:Description rdf:about="#SameCamera"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <owl:sameAs rdf:resource="#DifferentCamera"/><br />
+</rdf:Description><br />
+<br />
+<rdf:Description rdf:about="#DifferentCamera"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <owl:differentFrom rdf:resource="#SameCamera"/><br />
+</rdf:Description></p>
+
+<p>This describes two cameras, <code>SinarP2</code> and <code>SinarM</code>. There is an explicit declaration in the definition of <code>SinarM</code> that says it is a different object from <code>SinarP2</code>.</p>
+
+<p>There are also two cameras that are declared for consistency checking. <code>SameCamera</code> declares that it is the same as <code>DifferentCamera</code>, while <code>DifferentCamera</code> declares that it is different from <code>SameCamera</code>. These are inconsistent declarations.</p>
+<div class="anchor"><a name="o2945"> </a></div>
+<h5>Symmetry</h5>
+
+<p><code>owl:differentFrom</code> is a symmetric predicate. That is, for every statement declaring that one object is different from another, you can infer a reversed statement. These statements are generated with the following iTQL:</p>
+
+<p class="commandtext">select $x <owl:differentFrom> $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $y <owl:differentFrom> $x;</p>
+
+<p>The query returns the following:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#SameCamera, http://www.w3.org/2002/07/owl#differentFrom,<br />
+ http://www.xfront.com/owl/ontologies/camera/#DifferentCamera ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#SinarP2, http://www.w3.org/2002/07/owl#differentFrom,<br />
+ http://www.xfront.com/owl/ontologies/camera/#SinarM ]</p>
+<div class="anchor"><a name="o2946"> </a></div>
+<h5>Inconsistencies</h5>
+
+<p>An object that is different from another object may not also be declared to be the same as the other object. The following query returns all objects that violate this rule:</p>
+
+<p class="commandtext">select $x $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where ($x <owl:sameAs> $y<br />
+ or $y <owl:sameAs> $x)<br />
+ and ($x <owl:differentFrom> $y<br />
+ or $y <owl:differentFrom> $x);</p>
+
+<p>Because both <code><a id="h2944" class="" title="owl:sameAs" href="/inferencing/entailment.html#o2930">owl:sameAs</a></code> and <code>owl:differentFrom</code> are symmetric, it is necessary for this query to test for the use of the predicate in each direction. For this reason, conflicting objects show up twice, in reversed order from each other.</p>
+
+<p>This query returns the following:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#SameCamera, http://www.xfront.com/owl/ontologies/camera/#DifferentCamera ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#DifferentCamera, http://www.xfront.com/owl/ontologies/camera/#SameCamera ]</p>
+
+<p>Since this checks both <code>owl:sameAs</code> and <code>owl:differentFrom</code>, the test is also shown in the <a id="h2938_3" class="documentlinktemplate" title="Inconsistencies" href="/inferencing/entailment.html#o2936">Inconsistencies section</a> for <code>owl:sameAs</code>.</p>
+<div class="anchor"><a name="o2809"> </a></div>
+<h4>owl:inverseOf</h4>
+
+<p><code>owl:inverseOf</code> is a convenience used to declare reversed relationships. For example, a <code>hasParent</code> property has an inverse property of <code>hasChild</code>. In all cases, where a statement is made using one of these properties, a reversed statement can be made with the inverse property.</p>
+
+<p><code>owl:inverseOf</code> is a symmetric property. That is, since <code>hasParent</code> is the inverse of <code>hasChild</code>, then <code>hasChild</code> is the inverse of <code>hasParent</code>.</p>
+
+<p><code>owl:inverseOf</code> only applies to items of type <code>owl:ObjectProperty</code>.</p>
+
+<p>The ontology describes the following:</p>
+
+<p class="commandtext"><owl:InverseFunctionalProperty rdf:ID="serial-id"><br />
+ <rdfs:domain rdf:resource="#Body"/><br />
+ <rdfs:range rdf:resource="#SerialID"/><br />
+</owl:InverseFunctionalProperty><br />
+<br />
+<owl:FunctionalProperty rdf:ID="id-for"><br />
+ <rdfs:domain rdf:resource="#SerialID"/><br />
+ <rdfs:range rdf:resource="#Body"/><br />
+ <owl:inverseOf rdf:resource="#serial-id"/><br />
+</owl:FunctionalProperty></p>
+
+<p>This describes the <code>serial-id</code> property, which describes the relationship between a <code>Body</code> and a <code>SerialID</code> object. It also describes the <code>id-for</code> relationship, which is the inverse relationship between the two. Note that because <code>serial-id</code> is an <code>owl:InverseFunctionalProperty</code>, then <code>id-for</code> must necessarily be an <code>owl:FunctionalProperty</code>. That is, in both cases, a <code>SerialID</code> uniquely identifies a <code>Body</code>.</p>
+
+<p>In the camera data there are the following two cameras:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="#doubleSerial"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <body><br />
+ <Body rdf:about="#sharedBody"><br />
+ <serial-id><br />
+ <SerialID rdf:about="#3302656895"><br />
+ <serialType>numeric</serialType><br />
+ <serialValue>3302656895</serialValue><br />
+ </SerialID><br />
+ </serial-id><br />
+ </Body><br />
+ </body> <br />
+ <lens> <br />
+ <Lens rdf:about="#Sinaron-S"><br />
+ <focal-length>135mm</focal-length><br />
+ </Lens><br />
+ </lens><br />
+</rdf:Description><br />
+<br />
+<rdf:Description rdf:about="#doubleSerial2"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <body><br />
+ <Body><br />
+ <serial-id><br />
+ <SerialID rdf:about="#3302656895"><br />
+ <serialType>numeric</serialType><br />
+ <serialValue>3302656895</serialValue><br />
+ </SerialID><br />
+ </serial-id><br />
+ </Body><br />
+ </body><br />
+ <lens><br />
+ <Lens rdf:about="#Sinaron-SW"><br />
+ <focal-length>120mm</focal-length><br />
+ </Lens><br />
+ </lens><br />
+</rdf:Description></p>
+
+<p>This declares a camera called <code>doubleSerial</code> with an anonymous body, and a camera called <code>doubleSerial2</code> with a body called <code>3302656895</code>. These cameras are also described in the section for <code>owl:InverseFunctionalProperty</code>, where it is inferred that the two bodies must be the same object</p>
+
+<p>The statements subject to inversion are found with:</p>
+
+<p class="commandtext">select $x $p2 $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $p1 <owl:inverseOf> $p2<br />
+ and $x $p2 $y;</p>
+
+<p>This returns:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#sharedBody, http://www.xfront.com/owl/ontologies/camera/#serial-id,<br />
+ http://www.xfront.com/owl/ontologies/camera/#3302656895 ]<br />
+<br />
+[ _node157, http://www.xfront.com/owl/ontologies/camera/#serial-id,<br />
+ http://www.xfront.com/owl/ontologies/camera/#3302656895 ]</p>
+
+<p>This shows the <code>sharedBody</code> object and the anonymous body object both referring to their <code>serialID</code>.</p>
+
+<p>The following generates the inverted statements:</p>
+
+<p class="commandtext">select $y $p1 $x<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $p1 <owl:inverseOf> $p2<br />
+ and $x $p2 $y;</p>
+
+<p>This returns:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#3302656895, http://www.xfront.com/owl/ontologies/camera/#id-for,<br />
+ http://www.xfront.com/owl/ontologies/camera/#sharedBody ]<br />
+<br />
+[ http://www.xfront.com/owl/ontologies/camera/#3302656895, http://www.xfront.com/owl/ontologies/camera/#id-for,<br />
+ _node157 ]</p>
+<div class="anchor"><a name="o2811"> </a></div>
+<h4>owl:SymmetricProperty</h4>
+
+<p>The owl:SymmetricProperty declaration specifies that a property or predicate is symmetric. That is, if one instance uses this predicate to refer to another instance, then it is valid for the second instance to use that predicate to refer back to the first. For example, <code>has-friend</code> is a symmetric predicate. If the statement <code>Fred has-friend Barney</code> is true, then we can infer that <code>Barney has-friend Fred</code> is also true. Since we know the second statement is true, even if it does not exist in the model, then this is an inferred statement.</p>
+
+<p>The camera ontology declares the following:</p>
+
+<p class="commandtext"><owl:SymmetricProperty rdf:ID="matchingPart"><br />
+ <rdfs:domain rdf:resource="#PurchaseableItem"/><br />
+ <rdfs:range rdf:resource="#PurchaseableItem"/><br />
+</owl:SymmetricProperty></p>
+
+<p>This means that the predicate <code>matchingPart</code> is a symmetric property. It is used for <code>PurchaseableItems</code> to refer to other <code>PurchaseableItems</code>. Note that for a symmetric property, the domain and range must necessarily be the same.</p>
+
+<p>An example of the use of this symmetric property is as follows:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="&camera;SinarM"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <rdf:type rdf:resource="#Simple-Large-Format"/><br />
+ <body><br />
+ <BodyWithNonAdjustableShutterSpeed about="SinarMbody"><br />
+ <matchingPart><br />
+ <Lens rdf:about="SinaronDigital4.5/45DB"/><br />
+ </matchingPart><br />
+ </BodyWithNonAdjustableShutterSpeed><br />
+ </body><br />
+ <lens><br />
+ <Lens rdf:about="SinaronDigital4.5/45DB"><br />
+ <aperture>4.5</aperture><br />
+ <focal-length>45mm</focal-length><br />
+ </Lens><br />
+ </lens><br />
+</rdf:Description></p>
+
+<p>This declares a camera with a body called <code>SinarMbody</code> and a lens called <code>SinaronDigital4.5/45DB</code>. The <code>SinarMbody</code> instance declares that it is a <code>matchingPart</code> for <code>SinaronDigital4.5/45DB</code>. Since <code>matchingPart</code> is symmetric, then this means that <code>SinaronDigital4.5/45DB</code> is also a <code>matchingPart</code> for <code>SinarMbody</code>.</p>
+
+<p>Valid inferences like this can be found using the following iTQL:</p>
+
+<p class="commandtext">select $subject $predicate $object<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $predicate <rdf:type> <owl:SymmetricProperty><br />
+ and $object $predicate $subject;</p>
+
+<p>This finds all the predicates declared to be symmetric, then finds all statements that use these predicates. It then reverses the order of the subject and object for the <code>select</code> clause.</p>
+
+<p>The query returns the following:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/SinaronDigital4.5/45DB, <br />
+http://www.xfront.com/owl/ontologies/camera/#matchingPart, <br />
+http://www.xfront.com/owl/ontologies/camera/SinarMbody ]</p>
+
+<p>Inferences like this can be inserted back into the model as new statements. In this case, the result is in subject predicate object format, so it can be used as the basis of a <code>select insert</code> query.</p>
+<div class="anchor"><a name="o2812"> </a></div>
+<h4>owl:TransitiveProperty</h4>
+
+<p>The <code>owl:TransitiveProperty</code> declaration specifies that a predicate is transitive. That is, if instance A uses this predicate to refer to instance B, and B uses the same predicate to refer to instance C, then it is valid for instance A to use that predicate to refer to instance C. For example, <code>has-ancestor</code> is a transitive predicate. So if the statement <code>Enoch has-ancestor Cain</code> is true, and <code>Cain has-ancestor Adam</code> is also true, then we can infer that <code>Enoch has-ancestor Adam</code> is also true. Since we know the last statement is true even if it does not exist in the model, then this is an inferred statement.</p>
+
+<p>The camera ontology declares the following:</p>
+
+<p class="commandtext"><owl:TransitiveProperty rdf:ID="compatibleLens"><br />
+ <rdfs:domain rdf:resource="#Lens"/><br />
+ <rdfs:range rdf:resource="#Lens"/><br />
+</owl:TransitiveProperty></p>
+
+<p>This means that the predicate <code>compatibleLens</code> is a transitive property. It is used for Lenses to refer to other Lenses. Note that for a transitive property, the domain and range must have a non-empty intersection. That is, the domain and range must overlap or else it would not be possible to get the chain of statements necessary to define transitivity. Typically, the domain and range will be equal.</p>
+
+<p>An example of the use of the transitive property is shown here:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="&camera;SinarF2"><br />
+ <rdf:type rdf:resource="#Large-Format"/><br />
+ <body><br />
+ <BodyWithNonAdjustableShutterSpeed/><br />
+ </body><br />
+ <lens><br />
+ <Lens rdf:about="Sinaron-SE"><br />
+ <focal-length>360mm</focal-length><br />
+ <compatibleLens><br />
+ <Lens rdf:about="Sinaron-S"/><br />
+ </compatibleLens><br />
+ </Lens><br />
+ </lens><br />
+ <lens><br />
+ <Lens rdf:about="Sinaron-S"><br />
+ <compatibleLens><br />
+ <Lens rdf:about="Sinaron-W"/><br />
+ </compatibleLens><br />
+ </Lens><br />
+ <lens><br />
+ </lens><br />
+ <Lens rdf:about="Sinaron-W"><br />
+ <focal-length>200mm</focal-length><br />
+ </Lens><br />
+ </lens><br />
+</rdf:Description></p>
+
+<p>This declares a camera with three lenses, <code>Sinaron-SE</code>, <code>Sinaron-S</code> and <code>Sinaron-W</code>. The <code>Sinaron-SE</code> lens declares that it is a <code>compatibleLens</code> with <code>Sinaron-S</code>, and <code>Sinaron-S</code> declares that it is a <code>compatibleLens</code> with <code>Sinaron-W</code>. Since <code>compatibleLens</code> is a transitive predicate, <code>Sinaron-SE</code> is a <code>compatibleLens</code> with <code>Sinaron-W</code>.</p>
+
+<p>Valid inferences like this can be found using the following iTQL:</p>
+
+<p class="commandtext">select $predicate subquery(<br />
+ select $subject $object<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where trans($subject $predicate $object)<br />
+)<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $predicate <rdf:type> <owl:TransitiveProperty>;</p>
+
+<p>This starts by finding all predicates declared to be transitive. So that long chains of transitive statements can be found in a single query, the <code>trans</code> operation is used. At this time, <code>trans</code> requires that a predicate be fixed, so it is not possible to simply use the <code>$predicate</code> variable as the predicate. Instead, a subquery is executed for each predicate that is found. Inside the subquery, the <code>$predicate</code> variable only has a single value, so it is safe to use within <code>trans</code>.</p>
+
+<p>The query returns the following:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#compatibleLens, [$subject $object]<br />
+[http://www.xfront.com/owl/ontologies/camera/Sinaron-SE http://www.xfront.com/owl/ontologies/camera/Sinaron-W] ]</p>
+
+<p>This says that for the predicate <code>compatibleLens</code>, there is a single subject-object pair of <code>Sinaron-SE</code> and <code>Sinaron-W</code>, which is exactly what is expected.</p>
+
+<p>Inferences like this can be inserted back into the model as new statements. At this stage, some external code is required to put the result into a form that is acceptable for insertion. In the future, insertions like this will be possible using only iTQL.</p>
+<div class="anchor"><a name="o2813"> </a></div>
+<h4>owl:equivalentClass</h4>
+
+<p>The <code>owl:equivalentClass</code> declaration specifies that one class is equivalent to another class. That is, any instance of a class is treated as an instance of an equivalent class, and vice versa.</p>
+
+<p>The camera ontology declares the following:</p>
+
+<p class="commandtext"><owl:Class rdf:ID="Body"><br />
+ <rdfs:subClassOf rdf:resource="#PurchaseableItem"/><br />
+</owl:Class><br />
+ <br />
+<owl:Class rdf:ID="CameraBody"><br />
+ <owl:equivalentClass rdf:resource="#Body"/><br />
+</owl:Class></p>
+
+<p>This declares two classes, <code>CameraBody</code> and <code>Body</code>, which are equivalent to each other.</p>
+
+<p>An example using the <code>CameraBody</code> class is as follows:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="#Pentax-OptioS50"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <lens><br />
+ <Lens><br />
+ <focal-length>35.6-107mm</focal-length><br />
+ <aperture>2.6-4.8</aperture><br />
+ </Lens><br />
+ </lens><br />
+ <body><br />
+ <CameraBody><br />
+ <shutter-speed rdf:parseType="Resource"><br />
+ <min>0.0005</min><br />
+ <max>4.0</max><br />
+ <units>seconds</units><br />
+ </shutter-speed><br />
+ </CameraBody><br />
+ </body><br />
+ <cost rdf:parseType="Resource"><br />
+ <rdf:value>300</rdf:value><br />
+ <currency>USD</currency><br />
+ </cost><br />
+</rdf:Description></p>
+
+<p>This declares a digital camera <code>Pentax-OptioS50</code>, with a lens, a cost, and a body of type <code>CameraBody</code>. Since <code>CameraBody</code> is the equivalent of <code>Body</code>, then the body is also of type <code>Body</code>.</p>
+
+<p>For simple cases it is possible to copy some of the <code>Body</code> information over to the <code>CameraBody</code> instance. However, when complex operations such as restrictions are applied to the <code>Body</code> class, the complexity for the <code>CameraBody</code> instance to meet every possible situation for <code>Body</code> can become unbounded. In these cases you cannot write iTQL to capture every possibility.</p>
+
+<p>In order for instances of <code>CameraBody</code> to pick up all the information and constraints associated with being of type <code>Body</code>, it is necessary to declare that it is of type <code>Body</code>. Once this is done, all <code>Body</code> properties and restrictions are automatically applied to the object. The iTQL to create these declarative statements is as follows:</p>
+
+<p class="commandtext">select $instance <owl:type> $otherclass<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $instance <rdf:type> $class<br />
+ and $otherclass <owl:equivalentClass> $class;</p>
+
+<p>Since <code>owl:equivalentClass</code> is symmetric, the statement can also be declared in the opposite order. The iTQL to find both statements at once is as follows:</p>
+
+<p class="commandtext">select $instance <owl:type> $otherclass<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $instance <rdf:type> $class<br />
+ and ($class <owl:equivalentClass> $otherclass<br />
+ or $otherclass <owl:equivalentClass> $class);</p>
+
+<p>This query returns data similar to the following:</p>
+
+<p class="commandtext">[ _node250, http://www.w3.org/2002/07/owl#type, http://www.xfront.com/owl/ontologies/camera/#CameraBody ]<br />
+[ _node338, http://www.w3.org/2002/07/owl#type, http://www.xfront.com/owl/ontologies/camera/#CameraBody ]<br />
+[ _node378, http://www.w3.org/2002/07/owl#type, http://www.xfront.com/owl/ontologies/camera/#CameraBody ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#sharedBody, http://www.w3.org/2002/07/owl#type, <br />
+http://www.xfront.com/owl/ontologies/camera/#CameraBody ]<br />
+[ _node453, http://www.w3.org/2002/07/owl#type, http://www.xfront.com/owl/ontologies/camera/#CameraBody ]<br />
+[ _node457, http://www.w3.org/2002/07/owl#type, http://www.xfront.com/owl/ontologies/camera/#CameraBody ]<br />
+[ _node482, http://www.w3.org/2002/07/owl#type, http://www.xfront.com/owl/ontologies/camera/#CameraBody ]<br />
+[ _node496, http://www.w3.org/2002/07/owl#type, http://www.xfront.com/owl/ontologies/camera/#CameraBody ]<br />
+[ _node509, http://www.w3.org/2002/07/owl#type, http://www.xfront.com/owl/ontologies/camera/#CameraBody ]<br />
+[ _node519, http://www.w3.org/2002/07/owl#type, http://www.xfront.com/owl/ontologies/camera/#Body ]</p>
+
+<p>Since the declaration is <code><camera:CameraBody> <owl:equivalentClass> <camera:Body></code>, the first nine statements result from the constraint <code>($otherclass <owl:equivalentClass> $class)</code>, and the last statement results from the constraint <code>($class <owl:equivalentClass> $otherclass)</code>.</p>
+
+<p>While these queries establish the required relationships for the instance data, they do not make inferences on any ontology data. The first inference to make is based on the OWL definition that classes are considered to be subclasses of themselves. Using this information, you can infer that if two classes subclass each other, then they must be equivalent classes. This is shown in the following ontology data:</p>
+
+<p class="commandtext"><owl:Class rdf:ID="NonPurchaseableItem"><br />
+ <rdfs:subClassOf rdf:resource="&owl;Thing"/><br />
+ <rdfs:subClassOf rdf:resource="#IncludedItem"/><br />
+</owl:Class><br />
+<br />
+<owl:Class rdf:ID="IncludedItem"><br />
+ <rdfs:subClassOf rdf:resource="#NonPurchaseableItem"/><br />
+</owl:Class></p>
+
+<p>The query to find this information is as follows:</p>
+
+<p class="commandtext">select $x <owl:equivalentClass> $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $x <rdfs:subClassOf> $y and $y <rdfs:subClassOf> $x;</p>
+
+<p>This returns:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#NonPurchaseableItem, http://www.w3.org/2002/07/owl#equivalentClass, <br />
+http://www.xfront.com/owl/ontologies/camera/#IncludedItem ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#IncludedItem, http://www.w3.org/2002/07/owl#equivalentClass, <br />
+http://www.xfront.com/owl/ontologies/camera/#NonPurchaseableItem ]</p>
+
+<p>Another inference that can be made is that every class is equivalent to itself. While this is redundant information, it can be important when performing a query to find all classes that are equivalent to a given class. This is because it would be an error to exclude the given class from such a list.</p>
+
+<p>The iTQL for this is as follows:</p>
+
+<p class="commandtext">select $x <owl:equivalentClass> $x<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $x <rdf:type> <owl:Class>;</p>
+
+<p>The results of this query are not shown here. They just state that every class in the system is equivalent to itself.</p>
+<div class="anchor"><a name="o2814"> </a></div>
+<h4>owl:equivalentProperty</h4>
+
+<p>The <code>owl:equivalentProperty</code> declaration specifies that one property is equivalent to another property. That is, any usage of this property is treated as a usage of the equivalent property, and vice versa.</p>
+
+<p>The camera ontology declares the following:</p>
+
+<p class="commandtext"><owl:DatatypeProperty rdf:ID="aperture"><br />
+ <rdfs:domain rdf:resource="#Lens"/><br />
+ <rdfs:range rdf:resource="&xsd;string"/><br />
+</owl:DatatypeProperty><br />
+<br />
+<owl:DatatypeProperty rdf:ID="f-stop"><br />
+ <owl:equivalentProperty rdf:resource="#aperture"/><br />
+ <rdfs:domain rdf:resource="#Lens"/><br />
+ <rdfs:range rdf:resource="&xsd;string"/><br />
+</owl:DatatypeProperty></p>
+
+<p>This declares two properties, <code>aperture</code> and <code>f-stop</code>, which are equivalent to each other. These properties are of type <code>owl:DatatypeProperty</code>, but <code>owl:equivalentProperty</code> applies equally to <code>owl:ObjectProperty</code>.</p>
+
+<p>Both of these properties are used regularly throughout the data. An example is as follows:</p>
+
+<p class="commandtext"><rdf:Description rdf:about="#SinarM"><br />
+ <rdf:type rdf:resource="#Digital"/><br />
+ <rdf:type rdf:resource="#Simple-Large-Format"/><br />
+ <body><br />
+ <BodyWithNonAdjustableShutterSpeed about="#SinarMbody"><br />
+ <matchingPart><br />
+ <Lens rdf:about="#SinaronDigital4.5/45DB"/><br />
+ </matchingPart><br />
+ </BodyWithNonAdjustableShutterSpeed><br />
+ </body><br />
+ <lens><br />
+ <Lens rdf:about="#SinaronDigital4.5/45DB"><br />
+ <aperture>4.5</aperture><br />
+ <focal-length>45mm</focal-length><br />
+ </Lens><br />
+ </lens><br />
+</rdf:Description></p>
+
+<p>This declares a camera <code>SinarM</code>, with a <code>SinaronDigital4.5/45DB</code> lens. The lens has an aperture of 4.5.</p>
+
+<p>In order for all the attributes of the <code>f-stop</code> property to apply equally to the <code>aperture</code> property, the new property needs to be applied in parallel to the existing property. The iTQL to create these declarative statements is as follows:</p>
+
+<p class="commandtext">select $x $property2 $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $x $property1 $y<br />
+ and $property1 <owl:equivalentProperty> $property2;</p>
+
+<p>Since <code>owl:equivalentProperty</code> is symmetric, the statement can also be declared in the opposite order. The iTQL to find both statements at once is as follows:</p>
+
+<p class="commandtext">select $x $property2 $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $x $property1 $y<br />
+ and ($property1 <owl:equivalentProperty> $property2<br />
+ or $property2 <owl:equivalentProperty> $property1);</p>
+
+<p>The query returns data similar to the following:</p>
+
+<p class="commandtext">[ _node349, http://www.xfront.com/owl/ontologies/camera/#aperture, 4.5-5.6 ]<br />
+[ _node437, http://www.xfront.com/owl/ontologies/camera/#aperture, 4.5-5.6 ]<br />
+[ _node511, http://www.xfront.com/owl/ontologies/camera/#aperture, 4.5-5.6 ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#SinaronDigital4.5/45DB, <br />
+http://www.xfront.com/owl/ontologies/camera/#f-stop, 4.5 ]<br />
+[ _node463, http://www.xfront.com/owl/ontologies/camera/#f-stop, 2.8-3.5 ]<br />
+[ _node270, http://www.xfront.com/owl/ontologies/camera/#f-stop, 2.6-4.8 ]<br />
+[ _node316, http://www.xfront.com/owl/ontologies/camera/#f-stop, 2.6-4.8 ]</p>
+
+<p>Since the declaration is <code><camera:f-stop> <owl:equivalentProperty> <camera:aperture></code>, the first three statements result from the constraint <code>($property1 <owl:equivalentProperty> $property2)</code> and the next four statements result from the constraint <code>($property2 <owl:equivalentClass> $property1)</code>.</p>
+
+<p>While these queries establish the required relationships for the instance data, they do not make inferences on any ontology data. The first inference to make is based on the OWL definition that properties are considered to be subproperties of themselves. Using this information, you can infer that if two properties are subproperties of each other, then they must be equivalent properties. This is shown in the following ontology data:</p>
+
+<p class="commandtext"><owl:DatatypeProperty rdf:ID="size"><br />
+ <rdfs:subPropertyOf rdf:resource="#focal-length"/><br />
+ <rdfs:domain rdf:resource="#Lens"/><br />
+ <rdfs:range rdf:resource="&xsd;string"/><br />
+</owl:DatatypeProperty><br />
+<br />
+<owl:DatatypeProperty rdf:ID="focal-length"><br />
+ <rdfs:subPropertyOf rdf:resource="#size"/><br />
+ <rdfs:domain rdf:resource="#Lens"/><br />
+ <rdfs:range rdf:resource="&xsd;string"/><br />
+</owl:DatatypeProperty></p>
+
+<p>The query to find this information is as follows:</p>
+
+<p class="commandtext">select $x <owl:equivalentProperty> $y<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $x <rdfs:subPropertyOf> $y and $y <rdfs:subPropertyOf> $x;</p>
+
+<p>This returns:</p>
+
+<p class="commandtext">[ http://www.xfront.com/owl/ontologies/camera/#size, http://www.w3.org/2002/07/owl#equivalentProperty, <br />
+http://www.xfront.com/owl/ontologies/camera/#focal-length ]<br />
+[ http://www.xfront.com/owl/ontologies/camera/#focal-length, http://www.w3.org/2002/07/owl#equivalentProperty, <br />
+http://www.xfront.com/owl/ontologies/camera/#size ]</p>
+
+<p>Another inference that can be made is that every property is equivalent to itself. While this is redundant information it can be important when performing a query to find all properties that are equivalent to a given property. It would be an error to exclude the given property from such a list.</p>
+
+<p>The iTQL for this is as follows:</p>
+
+<p class="commandtext">select $x <owl:equivalentProperty> $x<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $x <rdf:type> <rdf:Property>;</p>
+
+<p>Without an inferencing rule to first declare that objects of all the owl property types also have type <code>rdf:Property</code>, then it is necessary to expand this query, as follows:</p>
+
+<p class="commandtext">select $x <owl:equivalentProperty> $x<br />
+ from <rmi://mysite.com/server1#camera><br />
+ where $x <rdf:type> <rdf:Property><br />
+ or $x <rdf:type> <owl:ObjectProperty><br />
+ or $x <rdf:type> <owl:DatatypeProperty><br />
+ or $x <rdf:type> <owl:FunctionalProperty><br />
+ or $x <rdf:type> <owl:InverseFunctionalProperty><br />
+ or $x <rdf:type> <owl:TransitiveProperty><br />
+ or $x <rdf:type> <owl:SymmetricProperty>;</p>
+
+<p>Some methods of declaring the various property types in RDF/XML result in more than one type of property type statement, but other methods result in a single statement, making all of these type constraints necessary. iTQL eliminates duplicates in results, so this is not a problem.</p>
+
+<p>The results of this query are not shown here. They just state that every property in the system is equivalent to itself.</p>
+<div class="anchor"><a name="o2815"> </a></div>
+<h4>owl:intersectionOf</h4>
+
+<p>Available in next release.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/inferencing/includeTOC.inc
===================================================================
--- trunk/docs/site/inferencing/includeTOC.inc 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/inferencing/includeTOC.inc 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,112 @@
+ <ul>
+ <li><a href="/inferencing/inferintro.html">Introduction to Inferencing</a></li>
+ <ul>
+ <li><a href="/inferencing/infersitu.html">Current Situation</a></li>
+ <ul class="toc">
+ <li><a href="/inferencing/infersitu.html#o3015">First Search</a></li>
+ <li><a href="/inferencing/infersitu.html#o3016">Second Search</a></li>
+ <li><a href="/inferencing/infersitu.html#o3017">Third Search</a></li>
+ </ul>
+ <li><a href="/inferencing/infersemweb.html">Semantic Web</a></li>
+ <ul class="toc">
+ <li><a href="/inferencing/infersemweb.html#o2644">Elements of the Semantic Web</a></li>
+ <ul>
+ <li><a href="/inferencing/infersemweb.html#o2645">Classes</a></li>
+ <li><a href="/inferencing/infersemweb.html#o2646">Properties</a></li>
+ <li><a href="/inferencing/infersemweb.html#o3019">Ranges</a></li>
+ <li><a href="/inferencing/infersemweb.html#o3018">Domains</a></li>
+ <li><a href="/inferencing/infersemweb.html#o2647">Additional Features for Describing Classes and Properties</a></li>
+ </ul>
+ <li><a href="/inferencing/infersemweb.html#o2648">Implementing Inferencing</a></li>
+ </ul>
+ <li><a href="/inferencing/infersummary.html">Summary</a></li>
+ </ul>
+ <li><a href="/inferencing/infermulgara.html">Inferencing and Mulgara</a></li>
+ <ul class="toc">
+ <li><a href="/inferencing/infermulgara.html#o2726">Models Required</a></li>
+ <ul>
+ <li><a href="/inferencing/infermulgara.html#o2727">Base Model</a></li>
+ <li><a href="/inferencing/infermulgara.html#o2728">Schema Model</a></li>
+ <li><a href="/inferencing/infermulgara.html#o2729">Inference Model</a></li>
+ </ul>
+ <li><a href="/inferencing/infermulgara.html#o2730">An Example</a></li>
+ </ul>
+ <li><a href="/inferencing/owl.html">OWL-Lite Operations Using iTQL</a></li>
+ <ul>
+ <li><a href="/inferencing/entailment.html">Entailment</a></li>
+ <ul class="toc">
+ <li><a href="/inferencing/entailment.html#o2802">owl:AllDifferent</a></li>
+ <li><a href="/inferencing/entailment.html#o2803">owl:distinctMembers</a></li>
+ <li><a href="/inferencing/entailment.html#o2804">owl:Class</a></li>
+ <li><a href="/inferencing/entailment.html#o2805">owl:FunctionalProperty</a></li>
+ <li><a href="/inferencing/entailment.html#o2930">owl:sameAs</a></li>
+ <ul>
+ <li><a href="/inferencing/entailment.html#o2931">Transitivity</a></li>
+ <li><a href="/inferencing/entailment.html#o2932">Reflexivity</a></li>
+ <li><a href="/inferencing/entailment.html#o2933">Symmetry</a></li>
+ <li><a href="/inferencing/entailment.html#o2934">Class Equivalence</a></li>
+ <li><a href="/inferencing/entailment.html#o2935">Property Equivalence</a></li>
+ <li><a href="/inferencing/entailment.html#o2936">Inconsistencies</a></li>
+ <li><a href="/inferencing/entailment.html#o2937">Note on Consistency Checking and Inferences</a></li>
+ </ul>
+ <li><a href="/inferencing/entailment.html#o2807">owl:InverseFunctionalProperty</a></li>
+ <li><a href="/inferencing/entailment.html#o2808">owl:differentFrom</a></li>
+ <ul>
+ <li><a href="/inferencing/entailment.html#o2945">Symmetry</a></li>
+ <li><a href="/inferencing/entailment.html#o2946">Inconsistencies</a></li>
+ </ul>
+ <li><a href="/inferencing/entailment.html#o2809">owl:inverseOf</a></li>
+ <li><a href="/inferencing/entailment.html#o2811">owl:SymmetricProperty</a></li>
+ <li><a href="/inferencing/entailment.html#o2812">owl:TransitiveProperty</a></li>
+ <li><a href="/inferencing/entailment.html#o2813">owl:equivalentClass</a></li>
+ <li><a href="/inferencing/entailment.html#o2814">owl:equivalentProperty</a></li>
+ <li><a href="/inferencing/entailment.html#o2815">owl:intersectionOf</a></li>
+ </ul>
+ <li><a href="/inferencing/consistency.html">Consistency Checking</a></li>
+ <ul class="toc">
+ <li><a href="/inferencing/consistency.html#o2817">Restricting Data Types</a></li>
+ <ul>
+ <li><a href="/inferencing/consistency.html#o2818">owl:allValuesFrom</a></li>
+ <li><a href="/inferencing/consistency.html#o2819">owl:someValuesFrom</a></li>
+ </ul>
+ <li><a href="/inferencing/consistency.html#o2820">Cardinality Operations</a></li>
+ <ul>
+ <li><a href="/inferencing/consistency.html#o2821">owl:cardinality</a></li>
+ <li><a href="/inferencing/consistency.html#o2822">owl:minimumCardinality</a></li>
+ <li><a href="/inferencing/consistency.html#o2823">owl:maximumCardinality</a></li>
+ </ul>
+ <li><a href="/inferencing/consistency.html#o2824">owl:Nothing</a></li>
+ <li><a href="/inferencing/consistency.html#o2825">owl:Restriction</a></li>
+ <li><a href="/inferencing/consistency.html#o2826">owl:Thing</a></li>
+ </ul>
+ </ul>
+ <li><a href="/inferencing/ontomanage.html">Ontology Management</a></li>
+ <ul class="toc">
+ <li><a href="/inferencing/ontomanage.html#o2828">owl:AnnotationProperty</a></li>
+ <li><a href="/inferencing/ontomanage.html#o2829">owl:backwardCompatibleWith</a></li>
+ <li><a href="/inferencing/ontomanage.html#o2830">owl:DeprecatedClass</a></li>
+ <li><a href="/inferencing/ontomanage.html#o2831">owl:DeprecatedProperty</a></li>
+ <li><a href="/inferencing/ontomanage.html#o2832">owl:imports</a></li>
+ <li><a href="/inferencing/ontomanage.html#o2833">owl:incompatibleWith</a></li>
+ <li><a href="/inferencing/ontomanage.html#o2834">owl:Ontology</a></li>
+ <li><a href="/inferencing/ontomanage.html#o2835">owl:OntologyProperty</a></li>
+ <li><a href="/inferencing/ontomanage.html#o2836">owl:priorVersion</a></li>
+ <li><a href="/inferencing/ontomanage.html#o2837">owl:versionInfo</a></li>
+ </ul>
+ <li><a href="/inferencing/sofa.html">SOFA</a></li>
+ <ul class="toc">
+ <li><a href="/inferencing/sofa.html#o2624">Prerequisites</a></li>
+ <li><a href="/inferencing/sofa.html#o2625">Getting Started</a></li>
+ <li><a href="/inferencing/sofa.html#o2626">Creating the Ontology</a></li>
+ <li><a href="/inferencing/sofa.html#o2627">Changing the Backing of an Ontology</a></li>
+ <li><a href="/inferencing/sofa.html#o2628">Populating the Ontology</a></li>
+ <li><a href="/inferencing/sofa.html#o2639">Compiling and Running the Example</a></li>
+ <li><a href="/inferencing/sofa.html#o2629">Integration</a></li>
+ </ul>
+ <li><a href="/inferencing/inferexample.html">Inferencing Examples Using SOFA and iTQL</a></li>
+ <ul class="toc">
+ <li><a href="/inferencing/inferexample.html#o2734">iTQL Inferencing</a></li>
+ <li><a href="/inferencing/inferexample.html#o2735">SOFA Inferencing</a></li>
+ <li><a href="/inferencing/inferexample.html#o2736">Should I use SOFA or iTQL?</a></li>
+ </ul>
+ </ul>
Added: trunk/docs/site/inferencing/index.html
===================================================================
--- trunk/docs/site/inferencing/index.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/inferencing/index.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,57 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Inferencing</title>
+ <meta name="keywords" content="Inferencing, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/descriptors/descriptorvcard.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/inferencing/inferintro.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+ -->
+
+
+
+
+<h1>Inferencing</h1>
+
+<p>Inferencing is the process of deducing (inferring) new information from information you already know. This is a very promising concept coming out of the Semantic Web that offers the ability to discover new relationships and new insights across large amounts of seemingly unrelated data.</p>
+
+<p>The purpose of this section is to introduce the concept of inferencing, then show you some of the ways that inferencing can be used in Mulgara.</p>
+
+<p class="relatedheading">In This Section</p>
+<p class="relateditem"><a href="/inferencing/inferintro.html">Introduction to Inferencing</a></p>
+<p class="relateditem"><a href="/inferencing/infermulgara.html">Inferencing and Mulgara</a></p>
+<p class="relateditem"><a href="/inferencing/owl.html">OWL-Lite Operations Using iTQL</a></p>
+<p class="relateditem"><a href="/inferencing/sofa.html">SOFA</a></p>
+<p class="relateditem"><a href="/inferencing/inferexample.html">Inferencing Examples Using SOFA and iTQL</a></p>
+
+
+
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
Added: trunk/docs/site/inferencing/inferexample.html
===================================================================
--- trunk/docs/site/inferencing/inferexample.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/inferencing/inferexample.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,161 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Inferencing Examples Using SOFA and iTQL</title>
+ <meta name="keywords" content="Inferencing, Examples, SOFA,iTQL, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/inferencing/inferexample.html#o2734">iTQL Inferencing</a> |
+ <a href="/inferencing/inferexample.html#o2735">SOFA Inferencing</a> |
+ <a href="/inferencing/inferexample.html#o2736">SOFA or iTQL?</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/inferencing/sofa.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/overview/legalinfo.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/inferencing/index.html">Inferencing</a></p>
+<p class="relateditem"><a href="/inferencing/inferintro.html">Introduction to Inferencing</a></p>
+<p class="relateditem"><a href="/inferencing/infermulgara.html">Inferencing and Mulgara</a></p>
+<p class="relateditem"><a href="/inferencing/owl.html">OWL-Lite Operations Using iTQL</a></p>
+<p class="relateditem"><a href="/inferencing/sofa.html">SOFA</a></p>
+
+ -->
+
+
+
+
+<h2>Inferencing Examples Using SOFA and iTQL</h2>
+
+<p>This tutorial explains two approaches to using inferencing capabilities of Mulgara: <a class="internetlinktemplate" title="" href="https://sofa.dev.java.net/">SOFA</a> and the iTQL<sup>TM</sup> <code><a id="h1610" class="documentlinktemplate" title="Traversing a Graph (walk Function)" href="/itqlcommands/select.html#o1532">walk</a></code> command.</p>
+
+<p>The same camera phone ontology, as used in the <a id="h2682" class="documentlinktemplate" title="SOFA" href="/inferencing/sofa.html">SOFA tutorial</a>, is used here. This camera phone ontology is an extension of the classic Camera Ontology, with two new classes: Phones and Camera Phones. This example shows how to retrieve the superclasses of the Camera Phone class.</p>
+
+<p>The SOFA API documentation, including the Mulgara classes that provide persistence storage for SOFA objects, is located in <code><a class="internetlinktemplate" title="" href="api/sofa/index.html"><Mulgara install>/docs/api/sofa</a></code>.</p>
+
+
+<div class="anchor"><a name="o2734"> </a></div>
+<h3>iTQL Inferencing</h3>
+
+<p>A running Mulgara server and the <code>CameraPhone.owl</code> ontology are need to complete this tutorial. The <code>CameraPhone.owl</code> file is available in the <code>Resources</code> directory of your Mulgara installation. You can issue the following iTQL commands using either the <a id="h551" class="documentlinktemplate" title="iTQL Shell" href="/system/itqlshell.html">iTQL shell</a>, the <a id="h788" class="documentlinktemplate" title="Mulgara Viewer" href="/overview/viewer.html">Mulgara Viewer</a><sup><a id="h788_2" class="documentlinktemplate" title="Mulgara Viewer" href="/overview/viewer.html">TM</a></sup> or the TMC<sup>TM</sup>.</p>
+
+<p class="note"><strong>Note -</strong> In the iTQL commands listed below, replace <code>example.com</code> with the fully qualified hostname for your Mulgara server.</p>
+<div class="anchor"><a name="o3207"> </a></div>
+
+
+<p>Complete the following steps:</p>
+<ol><li>Create the camera phone model and load in the ontology:
+<p class="listcontinuecommandtext">iTQL> create <rmi://example.com/server1#cameraphone>;<br />
+iTQL> load <file:/PATH/TO/TKS/Resources/CameraPhone.owl> into <rmi://example.com/server1#cameraphone>;</p>
+</li><li>Create aliases for RDF Schema and the camera ontology:
+<p class="listcontinuecommandtext">iTQL> alias <http://www.w3.org/2000/01/rdf-schema#> as rdfs;<br />
+iTQL> alias <http://www.xfront.com/owl/ontologies/camera/#> as camera;</p>
+</li><li>Perform the following query to retrieve the superclasses:
+<p class="listcontinuecommandtext">iTQL> select $s <rdfs:subClassOf> $o from <rmi://example.com/server1#cameraphone> where <br />
+ walk(<camera:CameraPhone> <rdfs:subClassOf> $o and $s <rdfs:subClassOf> $o);</p>
+</li></ol>
+<p>The query should return the following (namespaces have been compacted for clarity):</p>
+
+<p class="commandtext">[ camera:Phone, rdfs:subClassOf, camera:PurchaseableItem ]<br />
+[ camera:CameraPhone, rdfs:subClassOf, camera:Phone ]<br />
+[ camera:CameraPhone, rdfs:subClassOf, camera:Digital ]<br />
+[ camera:Camera, rdfs:subClassOf, camera:PurchaseableItem ]<br />
+[ camera:Digital, rdfs:subClassOf, camera:Camera ]</p>
+
+<p>These are the superclasses of a Camera Phone in descending order.</p>
+<div class="anchor"><a name="o2735"> </a></div>
+<h3>SOFA Inferencing</h3>
+
+<p>Sofa API documentation is available in the <code>docs/api/sofa</code> directory of your Mulgara installation.</p>
+
+<p>The following class is a simple class that lists the superclasses of a Camera Phone. It is available as <code>CameraPhoneInferenceExample.java</code> in the <code>Resources</code> directory of your Mulgara installation.</p>
+
+<p class="commandtext">package org.mulgara.sofa.example;<br />
+<br />
+/**<br />
+ * Camera Phone Inference Example<br />
+ */<br />
+import java.util.*;<br />
+import net.java.dev.sofa.*;<br />
+import net.java.dev.sofa.impl.*;<br />
+import org.mulgara.sofa.serialize.owl.*;<br />
+<br />
+public class CameraPhoneInferenceExample {<br />
+<br />
+ public static void main(String[] args) {<br />
+<br />
+ try {<br />
+ // Create in memory based Ontology, use TKS ontology model for persistence<br />
+ Ontology ontology = OntoConnector.getInstance().createOntology(<br />
+ "http://www.xfront.com/owl/ontologies/camera/");<br />
+ // Load Camera Phone Ontology<br />
+ OWLReader.getReader().read(ontology, "file:CameraPhone.owl ");<br />
+ // Get camera phone<br />
+ Concept cameraPhone = ontology.getConcept("CameraPhone");<br />
+ // Show super classes<br />
+ for (Iterator sc = cameraPhone.getSuperConcepts(true).iterator(); sc.hasNext();) {<br />
+ Concept superConcept = (Concept) sc.next();<br />
+ System.out.println(superConcept.getId());<br />
+ }<br />
+ } catch (Exception e) {<br />
+ e.printStackTrace();<br />
+ }<br />
+ }<br />
+}</p>
+<div class="anchor"><a name="o3208"> </a></div>
+
+
+<p>To run this example:</p>
+<ol><li>Retrieve it from the <code>Resources</code> directory of your Mulgara installation and place it in a directory hierarchy like the one shown below:
+<p class="listcontinuecommandtext">example/sofa/java/org/mulgara/sofa/example/CameraPhoneInferenceExample.java</p>
+</li><li>Compile it from the directory in which you created the above hierarchy:
+<p class="listcontinuecommandtext">javac -classpath <Mulgara directory>/Resources/driver-2.1.jar<br />
+ example/sofa/java/org/mulgara/sofa/example/CameraPhoneInferenceExample.java</p>
+</li><li>Run this example from the Mulgara installation directory,with the following command:
+<p class="listcontinuecommandtext">java -classpath <Mulgara directory>/Resources/driver-1.1.0.jar:example/sofa/java<br />
+ org.mulgara.sofa.example.CameraPhoneInferenceExample</p>
+</li></ol>
+<p>The following displays on the screen:</p>
+
+<p class="commandtext">Phone<br />
+Camera<br />
+Digital<br />
+PurchaseableItem</p>
+
+<p>These are the superclasses of a Camera Phone in ascending order</p>
+<div class="anchor"><a name="o2736"> </a></div>
+<h3>Should I use SOFA or iTQL?</h3>
+
+<p>Broadly speaking, iTQL is probably more familiar to developers who have built applications around SQL queries in the past. It is also a very hands on, iterative and interactive way of working with Mulgara.</p>
+
+<p>SOFA might appeal more to API programmers who have accessed databases through Object Oriented databases such as Hibernate and J2EE Entity Beans. SOFA is a pure java technology, although it closely models OWL idioms, which are language agnostic.</p>
+
+<p>iTQL can be accessed from a variety of programming languages and technologies, such as web services and might be a better fit in a heterogeneous computing environment. iTQL is currently a more scalable solution when working with very large data sets, although SOFA will be just as scalable in future versions of Mulgara.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/inferencing/inferintro.html
===================================================================
--- trunk/docs/site/inferencing/inferintro.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/inferencing/inferintro.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,63 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Introduction to Inferencing</title>
+ <meta name="keywords" content="Inferencing, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/inferencing/index.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/inferencing/infersitu.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+
+<p class="relatedheading">In This Section</p>
+<p class="relateditem"><a href="/inferencing/infersitu.html">Current Situation</a></p>
+<p class="relateditem"><a href="/inferencing/infersemweb.html">Semantic Web</a></p>
+<p class="relateditem"><a href="/inferencing/infersummery.html">Summary</a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/inferencing/index.html">Inferencing</a></p>
+<p class="relateditem"><a href="/inferencing/infermulgara.html">Inferencing and Mulgara</a></p>
+<p class="relateditem"><a href="/inferencing/owl.html">OWL-Lite Operations Using iTQL</a></p>
+<p class="relateditem"><a href="/inferencing/sofa.html">SOFA</a></p>
+<p class="relateditem"><a href="/inferencing/inferexample.html">Inferencing Examples Using SOFA and iTQL</a></p>
+
+ -->
+
+
+
+
+<h2>Introduction to Inferencing</h2>
+
+<p>Inferencing is about computer applications making decisions about, and deducing (inferring) new information from, information and resources already residing on the Web.</p>
+
+<p>With RDF data stored in Mulgara, and a set of rules about that data, Mulgara provides tools that allow you to perform inferencing operations. The purpose of this document is to provide a basic introduction to the concepts and constructs of inferencing.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/inferencing/infermulgara.html
===================================================================
--- trunk/docs/site/inferencing/infermulgara.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/inferencing/infermulgara.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,145 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Inferencing and Mulgara</title>
+ <meta name="keywords" content="Inferencing, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/inferencing/infermulgara.html#o2726">Models Required</a> |
+ <a href="/inferencing/infermulgara.html#o2730">An Example</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/inferencing/infersummery.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/inferencing/owl.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/inferencing/index.html">Inferencing</a></p>
+<p class="relateditem"><a href="/inferencing/inferintro.html">Introduction to Inferencing</a></p>
+<p class="relateditem"><a href="/inferencing/owl.html">OWL-Lite Operations Using iTQL</a></p>
+<p class="relateditem"><a href="/inferencing/sofa.html">SOFA</a></p>
+<p class="relateditem"><a href="/inferencing/inferexample.html">Inferencing Examples Using SOFA and iTQL</a></p>
+
+ -->
+
+
+
+
+<h2>Inferencing and Mulgara</h2>
+
+<p>Inferencing is a process of producing new RDF statements from a set of existing ones. This is implemented in Mulgara using a base model of RDF statements, applying a set of rules, then storing the newly generated statements in a new model.</p>
+
+<p>We can demonstrate this by defining a small data model and a set of rules. The data model consists of the following statements:</p>
+
+<p class="commandtext">[ (leftHand, partOf, body)<br />
+ (rightHand, partOf, body)<br />
+ (leftIndexFinger, partOf, leftHand)<br />
+ (leftHand, is, left)<br />
+ (rightHand, is, right)<br />
+ (leftHand, hasName, "left hand")<br />
+ (rightHand, hasName, "right hand")<br />
+ (leftIndexFinger, hasName, "left index finger") ]</p>
+
+<p>The rules are defined as follows:</p>
+<ol><li>Create a hierarchy of <code>partOf</code> statements where properties are inherited. That is:<ul><li><code>if (x, partOf, y) and ( y, partOf, z) then (x, partOf z)</code></li><li><code>if (a, is, b) then (z, is, b)</code></li><li>When Rule 1 is executed call Rule 2</li></ul></li><li>Create a new statement such that, <code>if (x, is, y) then ( x, hasProperty, y)</code></li></ol>
+<p>The statements in the new model generated by these rules are as follows:</p>
+
+<p class="commandtext">[ (leftIndexFinger, partOf, body)<br />
+ (leftIndexFinger, is, left)<br />
+ (leftIndexFinger, hasProperty, left)<br />
+ (leftHand, hasProperty, left)<br />
+ (rightHand, hasProperty, right) ]</p>
+
+<div class="anchor"><a name="o2726"> </a></div>
+<h3>Models Required</h3>
+
+<p>Inferencing requires ways of grouping statements into differing types of models, allowing the system to differentiate and apply appropriate operations on them. Also, models have configuration and other statements made about them in the system model. This allows the system to further control how models are treated during inferencing and other operations.</p>
+
+<p>Initially, there are three model types:</p>
+<ol><li>Base models</li><li>Schema models (RDFS and OWL)</li><li>Inference models</li></ol>
+<div class="anchor"><a name="o2727"> </a></div>
+<h4>Base Model</h4>
+
+<p>Base models are the current type of Mulgara model used for storing RDF statements.</p>
+<div class="anchor"><a name="o2728"> </a></div>
+<h4>Schema Model</h4>
+
+<p>A schema model is either an OWL or RDFS typed schema model. OWL and RDFS are predefined sets of rules, and when and how to apply them when certain statements are encountered. There are three versions of OWL:</p>
+<ol><li>OWL Lite</li><li>OWL DL</li><li>OWL Full</li></ol>
+<p>The difference between the three versions is the number of and complexity of the rules.</p>
+
+<p>The type of configuration to apply to schema models defines how the rules are applied. This includes which combination of rules and base statements generate an inference model, as well as which rules are processed ahead of time (forward chaining) or at query time (backward chaining).</p>
+
+<p>Schema models usually have a very a small number of statements in comparison to the base models. A schema model, or collection of models, is tied to one or more base models. The system allows one or more schemas models to be applied to one or more collections of base models to generate one or more sets of new inferred models.</p>
+
+<p>It is also important to allow classes to be used as instances. A class is a definition of the properties of an object. An instance is a particular concrete version of a type of class. An analogy in Java is a class is an <em>interface</em> and an object created at run-time with a <em>new</em> statement is an instance. In OWL this view of whether something is an instance or a class can change depending on how they are used. If a user is creating an ontology, from their point of view the schema model contains a set of instances to be manipulated. To the inferencing system, the schema model is a set of classes to be used by rules to generate new statements.</p>
+<div class="anchor"><a name="o2729"> </a></div>
+<h4>Inference Model</h4>
+
+<p>An inference model contains the result of executing the rules defined in the schema model against the data stored in the base models. Usually, inference models are not directly queried by the user but are queried in conjunction with the base model or models.</p>
+<div class="anchor"><a name="o3141"> </a></div>
+
+
+<p>Having an inference model separate from the other models allows the inferred model to be modified at any time. If the base models or schema models change only the inference model needs to change. To provide improved granularity and maximum control over inferred statements, these inferred statements can be composed of several models aggregated together. This provides a way to retain a map of inferred statements against the original data, schemas and rules that were applied. When the parts of the schema or original data changes only the minimal set of statements related to that change is removed and then re-inferred.</p>
+
+<p>These mappings, of inferred statements, rules and base facts, take the form of annotations and describe the set of statements and set of rules that generated them. A rule is further constrained by expressing a subset of the original statements using an iTQL<sup>TM</sup> query.</p>
+<div class="anchor"><a name="o2730"> </a></div>
+<h3>An Example</h3>
+
+<p>Take the example where you have two models:</p>
+<ol><li>A base model of facts</li><li>An RDFS schema model</li></ol>
+<p>The administrator or inference optimizer determines that the RDFS rule <code>subClassOf</code> should be fully inferred and the results placed in an inferred model of its own. The remaining RDFS rules are fully inferred and and their results placed in a second inferred model.</p>
+
+<p>This is expressed using the following set of statements:</p>
+
+<p class="commandtext">[ ( <baseModel1>, <modelType>, <model> )<br />
+ ( <rdfsSchemaModel1>, <modelType>, <rdfs> )<br />
+ ( <inferenceModel1>, <modelType>, <inference> )<br />
+ ( <inferenceModel2>, <modelType>, <inference> )<br />
+ ( <rdfs:subClassOf>, <inferenceType>, <forward> )<br />
+ ( <rdfs:domain>, <inferenceType>, <forward> )<br />
+ ( <inferenceModel1>, <includesRule>, <rdfs:subClassOf> )<br />
+ ( <inferenceModel2>, <includesRule>, <rdfs:domain> )<br />
+ ...<br />
+]</p>
+<div class="anchor"><a name="o3142"> </a></div>
+
+
+<p>Any user queries are now performed against the union of three models:</p>
+<ol><li>Base facts (<code>baseModel1</code>)</li><li>The <code>subClassOf</code> inference model (<code>inferenceModel1</code>)</li><li>The remaining RDFS rules (<code>inferenceModel2</code>)</li></ol>
+<div class="anchor"><a name="o3143"> </a></div>
+
+
+<p>In this way each inference model handles different groups of inferred statements. By splitting the two inference models between <code>subClassOf</code> and the other RDFS rules we are saying that they are computationally equivalent. This is determinate on the following factors:</p>
+<ul><li>The rules to apply</li><li>The schema</li><li>The original data</li><li>How often and what type of changes occur to the schema or original data</li></ul>
+<div class="anchor"><a name="o3144"> </a></div>
+
+
+<p>A performance enhancement that a user or the system can determine is when certain queries are leading to continual dropping and re-inferencing. Alternatively, continually inferring the same set of statements at query time would benefit from caching these statements in an inference model.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/inferencing/infersemweb.html
===================================================================
--- trunk/docs/site/inferencing/infersemweb.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/inferencing/infersemweb.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,123 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Semantic Web</title>
+ <meta name="keywords" content="Semantic Web, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/inferencing/infersemweb.html#o2644">Semantic Web</a> |
+ <a href="/inferencing/infersemweb.html#o2648">Implementing Inferencing</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/inferencing/infersitu.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/inferencing/infersummery.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/inferencing/inferintro.html">Introduction to Inferencing</a></p>
+<p class="relateditem"><a href="/inferencing/infersitu.html">Current Situation</a></p>
+<p class="relateditem"><a href="/inferencing/infersummery.html">Summary</a></p>
+
+ -->
+
+
+
+
+<h3>Semantic Web</h3>
+
+<p>Now imagine that all the information on the World Wide Web (about bicycles and everything else), currently locked away in a series of unrelated HTML files, was somehow organized and linked in such a way as to be processable by computer applications. These computer applications could wade through the mountains of information available and present to you the specific information you require, in the format you desire. This is the vision of what people call <em>The Semantic Web</em>.</p>
+
+<p>Going back to the bicycle example, this time using a Semantic Web browser (which does not exist yet, by the way), you specify the following criteria for the bicycle you want to buy:</p>
+<ul><li>Road bicycle (as opposed to a mountain, recreational, BMX or child's bicycle)</li><li>Price range</li><li>Gender (some bicycle are built especially for women, for example)</li><li>Height and weight (so that the bicycle is suitable for your body size)</li><li>Your address and a maximum distance radius that you are prepared to travel to visit a bicycle shop
+<p class="listcontinue">Alternatively, you could order on-line, but it is recommended that you do test rides before you buy.</p>
+</li><li>The color red (nice, but not essential)</li></ul>
+<p>Your Semantic Web browser returns for you:</p>
+<ul><li>A list of bicycles that meet your requirements (type, price, gender, size and color) along with full specifications, recommended retail prices and pictures to view</li><li>A list of bicycle shops (within your specified distance radius) that sell the above bicycles, their advertised prices, whether the bicycles are currently in stock, and address and contact details</li><li>Directions on how to get to each of the shops from your address</li></ul>
+<p>How did the Semantic Web browser determine all this? First of all, the available information was organized and categorized in such a way as to be computer application processable. Secondly, using rules associated with the information, and the criteria you specified, <em>inferences</em> were made to determine the information to present to you.</p>
+
+<div class="anchor"><a name="o2644"> </a></div>
+<h4>Elements of the Semantic Web</h4>
+
+<p>How is data on the Semantic Web linked and organized? What are the rules and how are they specified?</p>
+
+<p>All data on the Semantic Web is described using (among other things) <em>Classes</em>, <em>SubClasses</em>, <em>Properties</em> and <em>Subproperties</em>. How classes and properties fit together is described using <em>Ranges</em> and <em>Domains</em>.</p>
+<div class="anchor"><a name="o2645"> </a></div>
+<h5>Classes</h5>
+
+<p><em>Classes</em> refer to a type or a category of something. Classes that are a subset of one or more classes are called <em>subclasses</em>. Individual resources that belong to a class are called <em>instances</em> of that class. Instances of a class, which is a subclass of another class, are automatically instances of the higher level class.</p>
+
+<p>Using the bicycle example again, we have the following definitions:</p>
+<ul><li>Four classes: <code>HumanPoweredVehicle</code>, <code>Bicycle</code>, <code>RoadBicycle</code> and <code>MountatinBicycle</code></li><li>The <code>Bicycle</code> class is a subclass of the <code>HumanPoweredVehicle</code> class</li><li>The <code>RoadBicycle</code> and <code>MountainBicycle</code> classes are subclasses of the <code>Bicycle</code> class</li></ul>
+<p>Automatically, without any further definitions, we know that all instances of the <code>RoadBicycle</code> class also belong to the <code>Bicycle</code> class and the <code>HumanPoweredVehicle</code> class.</p>
+
+<p>This is an example of inferencing. Knowing that a resource belongs to a class, which is a subclass of another class, we can deduce, or <em>infer</em>, that the resource also belongs to the higher level class.</p>
+<div class="anchor"><a name="o2646"> </a></div>
+<h5>Properties</h5>
+
+<p>Now that we have classes of things, we need to be able to describe them. <em>Properties</em> are the characteristics, or descriptions, of classes. Properties of high level classes also apply to all subclasses of the class.</p>
+<div class="anchor"><a name="o3019"> </a></div>
+<h5>Ranges</h5>
+
+<p>The values a property can have are specified using <em>Ranges</em>. Properties can have zero or more ranges (where ranges are in fact defined as classes).</p>
+
+<p>For example, we have the following definitions:</p>
+<ul><li>A property of <code>Color</code></li><li>Three classes: <code>Red</code>, <code>White</code> and <code>Blue</code></li></ul>
+<p>In order to specify the possible values for the <code>Color</code> property (red, white or blue), we define that the:</p>
+<ul><li><code>Color</code> property has range of <code>Red</code> class</li><li><code>Color</code> property has range of <code>White</code> class</li><li><code>Color</code> property has range of <code>Blue</code> class</li></ul>
+<div class="anchor"><a name="o3018"> </a></div>
+<h5>Domains</h5>
+
+<p>Properties are assigned to classes using <em>Domains</em>.</p>
+
+<p>For example, to assign the <code>Color</code> property to the <code>Bicycle</code> class, we define that the <code>Color</code> property is in the domain of the <code>Bicycle</code> class. That is, bicycles have color.</p>
+
+<p>Based on the above range and domain definitions, we have stated that all bicycles have color, and the color can be red, white or blue. From this, we can <em>infer</em> that all bicycles (road and mountain bicycles) come in three colors and three colors only: red, white and blue.</p>
+
+<p class="note"><strong>Note -</strong> There are no definitions regarding the other types of human powered vehicles besides bicycles. With no rules specified, we can not make any inferences about the color, for example, of row boats, kayaks or any other instances of the <code>HumanPoweredVehicle</code> class.</p>
+<div class="anchor"><a name="o2647"> </a></div>
+<h5>Additional Features for Describing Classes and Properties</h5>
+
+<p>There are many other features used in inferencing, some of which include:</p>
+<ul><li>Equivalent classes. That is, where two classes are equivalent, the instances of one class are also instances of the other, and vice versa.
+<p class="listcontinue">For example, the <code>Bicycle</code> and <code>TwoWheeledHumanPoweredVehicle</code> classes are equivalent, and the instances of one class are automatically instances of the other.</p>
+</li><li>Equivalent properties. That is, where two properties are equivalent, an instance of a class with a property also has the equivalent property.
+<p class="listcontinue">For example, <code>BicycleSize</code> and <code>FrameSize</code> are equivalent properties. An instance of the <code>Bicycle</code> class has a <code>BicycleSize</code> property, and from this you can infer that the instance also has the <code>FrameSize</code> property.</p>
+</li><li>Cardinality. That is, the number of values for a property associated with a class.
+<p class="listcontinue">For example, if the <code>Color</code> property has a <em>minimum</em> Cardinality of one with respect to the <code>Bicycle</code> class, then you can infer that all bicycles must have at least one color. They might have two, three or more colors, but they must have at least one.</p>
+
+<p class="listcontinue">If the <code>Color</code> property has a <em>maximum</em> Cardinality of one with respect to the <code>Bicycle</code> class, then you can infer that all bicycles must have <em>only one</em> color.</p>
+</li></ul>
+<div class="anchor"><a name="o2648"> </a></div>
+<h4>Implementing Inferencing</h4>
+
+<p>The Semantic Web and inferencing is implemented using the features of the following languages:</p>
+<ul><li>RDF (Resource Description Framework). Originally developed by the World-Wide Web Consortium (W3C) as a standard way of describing resources on the Web. As well as resources <em>on</em> the Web, RDF can be used to describe resources that <em>could</em> be on the Web. This means that for any resource (such as a person, a bicycle, or even a concept), whether it exists on the Web or not, provided it can be <em>identified</em> as being on the Web, it can be described using RDF.</li><li>RDF Schema (or RDFS). Provides the vocabulary for defining and describing classes and properties with regards to RDF.</li><li>OWL (Web Ontology Language). Extends the RDFS vocabulary for describing classes and properties, including relationships between classes and properties, equality and inequality, and cardinality.</li></ul>
+<p>The intent of this document is only to introduce the concept of inferencing. If you want to know more about inferencing and other Semantic Web related topics, the Semantic Web Best Practices and Deployment Working Group's <a class="internetlinktemplate" title="" href="http://www.w3.org/2001/sw/BestPractices/Tutorials">Semantic Web Tutorials site</a> provides many links to RDF, OWL, SOFA and other sources of information.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/inferencing/infersitu.html
===================================================================
--- trunk/docs/site/inferencing/infersitu.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/inferencing/infersitu.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,79 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Current Situation</title>
+ <meta name="keywords" content="Current Situation, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/inferencing/infersitu.html#o3015">First Search</a> |
+ <a href="/inferencing/infersitu.html#o3016">Second Search</a> |
+ <a href="/inferencing/infersitu.html#o3017">Third Search</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/inferencing/inferintro.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/inferencing/infersemweb.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/inferencing/inferintro.html">Introduction to Inferencing</a></p>
+<p class="relateditem"><a href="/inferencing/infersemweb.html">Semantic Web</a></p>
+<p class="relateditem"><a href="/inferencing/infersummery.html">Summary</a></p>
+
+ -->
+
+
+
+
+<h3>Current Situation</h3>
+
+<p>Currently, resources on the World Wide Web are primarily available for display purposes to humans. There is a limited ability by computer applications to process these resources. If you want to find some information on the Web, and you do not know the exact address of a resource, you can use a search engine. Given keywords that you specify, search engines find the resources that contain embedded text, or have metadata tags associated with the resources, that match the keywords. The process works, but it is very inefficient.</p>
+
+<p>Consider an example of this. Suppose you want to buy a bicycle. With a basic knowledge of the kind of bicycle you want and how much you want to spend, but not knowing what is available in the marketplace, you turn to the Internet for help.</p>
+
+<div class="anchor"><a name="o3015"> </a></div>
+<h4>First Search</h4>
+
+<p>Using your favorite search engine, you type in the keyword <em>bicycle</em> and click on the Search button. Your search returns a list of over 16 million web sites, all of which have something to do with <em>bicycle</em>. The first page of your search result lists sites for:</p>
+<ul><li>Bicycle manufacturers</li><li>Cycling accessories</li><li>Cycling advocacy groups</li><li>Cycling magazines</li></ul>
+<p>The manufacturer and accessory sites are useful (but incomplete) because they give you information about the type of bicycle and kinds of accessories (like helmets, clothing and lights) you can buy. What they don't tell you is where you can buy them or how much they cost.</p>
+<div class="anchor"><a name="o3016"> </a></div>
+<h4>Second Search</h4>
+
+<p>Refining your search, you type the name of your city, in addition to <em>bicycle</em>, as a second keyword. Clicking on the Search button now returns just over 100,000 web sites (still an unmanageable list). The first page of this new search result lists sites for:</p>
+<ul><li>City council web sites with information on transport planning and how to get around the city by bicycle</li><li>Cycling organizations for your city and state</li><li>Bicycle tours in and around your city</li></ul>
+<div class="anchor"><a name="o3017"> </a></div>
+<h4>Third Search</h4>
+
+<p>Refining the search further, you type <em>shops</em> as a third keyword. Clicking on the Search button now returns over 23,000 web sites. The result is getting better, but the size is still unmanageable. But at least your search is now starting to list sites that provide links to bicycle shops in your city.</p>
+
+<p>Navigating the links to the bicycle shops that you think are appropriate, perhaps because of their close proximity to your home or work, you can now visit each bike shop's web site individually and determine information such as:</p>
+<ul><li>Address, phone number and e-mail address</li><li>Brands of bicycles sold</li><li>Types of bicycles sold</li><li>Models of bicycles sold</li><li>Accessories sold</li><li>Prices</li><li>Do they have a service department?</li><li>Do they sell second hand bicycles?</li></ul>
+<p>Without taking this example any further, you can see that this is a fairly long and involved process. It is not very efficient as you didn't get the information you were looking for straight away. And you are still left with the prospect of visiting each bike shop's web site (individually!) to find the bicycle you want, at the price you want to pay. And if you do find what you want, at a price you are prepared to pay, there is nothing about whether it is in stock and what the wait will be if it has to be ordered from the manufacturer.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/inferencing/infersummary.html
===================================================================
--- trunk/docs/site/inferencing/infersummary.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/inferencing/infersummary.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,57 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Summary</title>
+ <meta name="keywords" content="Summary, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/inferencing/infersemweb.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/inferencing/infermulgara.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/inferencing/inferintro.html">Introduction to Inferencing</a></p>
+<p class="relateditem"><a href="/inferencing/infersitu.html">Current Situation</a></p>
+<p class="relateditem"><a href="/inferencing/infersemweb.html">Semantic Web</a></p>
+
+ -->
+
+
+
+
+<h3>Summary</h3>
+
+<p>Currently, resources on the World Wide Web are primarily available for display purposes to humans.</p>
+
+<p>The vision of the Semantic Web is to organize and link this information such that it becomes processable by computer applications.</p>
+
+<p>With data stored in RDF, we can define classes and properties that categorize and describe the data (RDF Schema). We can further describe these classes and properties by specifying relationships between classes and properties, equality and inequality, and cardinality (OWL).</p>
+
+<p>From the data we know (RDF), and the rules that are defined (RDFS and OWL), we can make inferences to discover new information.</p>
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/inferencing/ontomanage.html
===================================================================
--- trunk/docs/site/inferencing/ontomanage.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/inferencing/ontomanage.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,106 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Ontology Management</title>
+ <meta name="keywords" content="Ontology, Management, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/inferencing/ontomanage.html#o2828">AnnotationProperty</a> |
+ <a href="/inferencing/ontomanage.html#o2829">backwardCompatibleWith</a> |
+ <a href="/inferencing/ontomanage.html#o2830">DeprecatedClass</a> |
+ <a href="/inferencing/ontomanage.html#o2831">DeprecatedProperty</a> |
+ <a href="/inferencing/ontomanage.html#o2832">imports</a> |
+ <a href="/inferencing/ontomanage.html#o2833">incompatibleWith</a> |
+ <a href="/inferencing/ontomanage.html#o2834">Ontology</a> |
+ <a href="/inferencing/ontomanage.html#o2835">OntologyProperty</a> |
+ <a href="/inferencing/ontomanage.html#o2836">priorVersion</a> |
+ <a href="/inferencing/ontomanage.html#o2837">versionInfo</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/inferencing/consistency.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/inferencing/sofa.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/inferencing/consistency.html">Consistency Checking</a></p>
+<p class="relateditem"><a href="/inferencing/consistency.html#o2817">Restricting Data Types</a></p>
+<p class="relateditem"><a href="/inferencing/consistency.html#o2820">Cardinality Operations</a></p>
+<p class="relateditem"><a href="/inferencing/consistency.html#o2824">owl:Nothing</a></p>
+<p class="relateditem"><a href="/inferencing/consistency.html#o2825">owl:Restriction</a></p>
+<p class="relateditem"><a href="/inferencing/consistency.html#o2826">owl:Thing</a></p>
+
+ -->
+
+
+
+
+<h4>Ontology Management</h4>
+
+<p>Ontology management operations allow you to maintain and version ranges of predicates.</p>
+<div class="anchor"><a name="o2828"> </a></div>
+<h5>owl:AnnotationProperty</h5>
+
+<p>Available in next release.</p>
+<div class="anchor"><a name="o2829"> </a></div>
+<h5>owl:backwardCompatibleWith</h5>
+
+<p>Available in next release.</p>
+<div class="anchor"><a name="o2830"> </a></div>
+<h5>owl:DeprecatedClass</h5>
+
+<p>Available in next release.</p>
+<div class="anchor"><a name="o2831"> </a></div>
+<h5>owl:DeprecatedProperty</h5>
+
+<p>Available in next release.</p>
+<div class="anchor"><a name="o2832"> </a></div>
+<h5>owl:imports</h5>
+
+<p>Available in next release.</p>
+<div class="anchor"><a name="o2833"> </a></div>
+<h5>owl:incompatibleWith</h5>
+
+<p>Available in next release.</p>
+<div class="anchor"><a name="o2834"> </a></div>
+<h5>owl:Ontology</h5>
+
+<p>Available in next release.</p>
+<div class="anchor"><a name="o2835"> </a></div>
+<h5>owl:OntologyProperty</h5>
+
+<p>Available in next release.</p>
+<div class="anchor"><a name="o2836"> </a></div>
+<h5>owl:priorVersion</h5>
+
+<p>Available in next release.</p>
+<div class="anchor"><a name="o2837"> </a></div>
+<h5>owl:versionInfo</h5>
+
+<p>Available in next release.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/inferencing/owl.html
===================================================================
--- trunk/docs/site/inferencing/owl.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/inferencing/owl.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,80 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - OWL-Lite Operations Using iTQL</title>
+ <meta name="keywords" content="OWL-Lite, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/inferencing/infermulgara.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/inferencing/entailment.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">In This Section</p>
+<p class="relateditem"><a href="/inferencing/entailment.html">Entailment</a></p>
+<p class="relateditem"><a href="/inferencing/consistency.html">Consistency Checking</a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/inferencing/index.html">Inferencing</a></p>
+<p class="relateditem"><a href="/inferencing/inferintro.html">Introduction to Inferencing</a></p>
+<p class="relateditem"><a href="/inferencing/infermulgara.html">Inferencing and Mulgara</a></p>
+<p class="relateditem"><a href="/inferencing/sofa.html">SOFA</a></p>
+<p class="relateditem"><a href="/inferencing/inferexample.html">Inferencing Examples Using SOFA and iTQL</a></p>
+
+
+ -->
+
+
+
+
+<h2>OWL-Lite Operations Using iTQL</h2>
+
+<p>There are three types of operations to perform for ontologies:</p>
+<ol><li>Entailment</li><li>Consistency checking</li><li>Ontology management</li></ol>
+<p>Entailment operations lead statements being inferred whereas consistency checks determine if all of the statements are valid with respect to the schema.</p>
+
+<p>The examples in this section of the documentation make use of the following pre-declared namespaces:</p>
+
+<p class="commandtext">owl: http://www.w3.org/2002/07/owl#<br />
+rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#<br />
+rdfs: http://www.w3.org/2000/01/rdf-schema#<br />
+xsd: http://www.w3.org/2001/XMLSchema#<br />
+mulgara: http://mulgara.org/mulgara#<br />
+camera: http://www.xfront.com/owl/ontologies/camera/#</p>
+
+<p>These can all be defined using the iTQL<sup>TM</sup> <code><a id="h1223" class="documentlinktemplate" title="alias" href="/itqlcommands/alias.html">alias</a></code> command:</p>
+
+<p class="commandtext">alias <http://www.w3.org/2002/07/owl#> as owl;<br />
+alias <http://www.w3.org/1999/02/22-rdf-syntax-ns#> as rdf;<br />
+alias <http://www.w3.org/2000/01/rdf-schema#> as rdfs;<br />
+alias <http://www.w3.org/2001/XMLSchema#> as xsd;<br />
+alias <http://mulgara.org/mulgara#> as mulgara;<br />
+alias <http://www.xfront.com/owl/ontologies/camera/#> as camera;</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/inferencing/sofa.html
===================================================================
--- trunk/docs/site/inferencing/sofa.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/inferencing/sofa.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,708 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - SOFA</title>
+ <meta name="keywords" content="SOFA, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/inferencing/sofa.html#o2624">Prerequisites</a> |
+ <a href="/inferencing/sofa.html#o2625">Getting Started</a> |
+ <a href="/inferencing/sofa.html#o2626">Creating the Ontology</a> |
+ <a href="/inferencing/sofa.html#o2627">Changing the Backing</a> |
+ <a href="/inferencing/sofa.html#o2628">Populating the Ontology</a> |
+ <a href="/inferencing/sofa.html#o2639">Compiling and Running</a> |
+ <a href="/inferencing/sofa.html#o2629">Integration</a>
+
+
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/inferencing/ontomanage.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/inferencing/inferexample.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/inferencing/index.html">Inferencing</a></p>
+<p class="relateditem"><a href="/inferencing/inferintro.html">Introduction to Inferencing</a></p>
+<p class="relateditem"><a href="/inferencing/infermulgara.html">Inferencing and Mulgara</a></p>
+<p class="relateditem"><a href="/inferencing/owl.html">OWL-Lite Operations Using iTQL</a></p>
+<p class="relateditem"><a href="/inferencing/inferexample.html">Inferencing Examples Using SOFA and iTQL</a></p>
+
+ -->
+
+
+
+
+<h2>SOFA</h2>
+
+<p><a class="internetlinktemplate" title="" href="https://sofa.dev.java.net/">SOFA (Simple Ontology Framework API)</a> is a simple but powerful ontology API that allows for inter-operation between several different ontology description formats. Additionally, SOFA is not tied down to a particular storage layer and can easily be integrated into any application that requires an ontology manager. Due to the structure of the API, virtually any Java object can be used to model ontology datatype nodes, allowing the model to be as complex or simple as necessary. Features of the API include:</p>
+<ul><li>Multiple inheritance, allowing the discovery of nodes beyond the first set of sub, or super-concepts.</li><li>Ontology inter-operation, so two ontologies in the same session can talk to each other and use the same resources.</li><li>Inferencing and reasoning about relationships.</li><li>Support for W3C OWL, DAML and OIL, and RDF and RDF Schema.</li><li>Ontology creation and querying.</li></ul>
+<p>Visit the <a class="internetlinktemplate" title="" href="https://sofa.dev.java.net/doc/">SOFA documentation Web site</a> for additional information such as a Getting Started guide and an API reference guide.</p>
+<div class="anchor"><a name="o2624"> </a></div>
+<h3>Prerequisites</h3>
+
+<p>The following prerequisites should be met before this SOFA tutorial can be compiled and run:</p>
+<ul><li>Java<sup>TM</sup> software, version 1.4 or higher. You can check the version you have installed by typing at a command line:
+<p class="listcontinuecommandtext">java -version</p>
+
+<p class="listcontinue">Something similar to the following should display:</p>
+
+<p class="listcontinuecommandtext">java version "1.4.2_04"<br />
+Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)<br />
+Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)</p>
+
+<p class="listcontinue">If the above does not display, add <code><JAVA_HOME>/bin</code>, where <code><JAVA_HOME></code> is the location where J2SE<sup>TM</sup> is installed, to your <code>PATH </code>(in the appropriate way for your shell).</p>
+
+<p class="listcontinue">For more information on installing and running Java software, read the <a class="jumptemplate" title="" href="http://java.sun.com/j2se/1.4.2/install.html">J2SE 1.4 Installation guide</a>.</p>
+</li><li>A valid installation of Mulgara. For information on installing Mulgara, see the relevant sections in the Mulgara documentation.</li><li>Basic Java programming experience.</li></ul>
+<div class="anchor"><a name="o2625"> </a></div>
+<h3>Getting Started</h3>
+
+<p>Before creating an ontology, you need to consider its purpose, even if you are just extending an existing one. Questions you need to ask include:</p>
+<ul><li>What is the ontology describing and what relationships should there be between the objects and data in it?</li><li>What sort of information should be conveyed by the ontology?</li><li>How should the hierarchy be structured?</li></ul>
+<p>For the purpose of this tutorial we will extend a <code><a class="jumptemplate" title="" href="http://www.xfront.com/camera/camera.owl">Camera</a></code><a class="jumptemplate" title="" href="http://www.xfront.com/camera/camera.owl"> ontology</a> to include a mobile phone camera concept, and a new relation describing the standard of the phone (GSM or CDMA). </p>
+
+<p class="note"><strong>Note -</strong> We are using a slightly modified version of the <code>camera.owl</code> ontology named <code>kamera.owl</code>. This is because of a bug in the way that SOFA handles namespaces, which will be fixed in a later version of Mulgara.</p>
+
+<p>The code for this example, plus the <code>kamera.owl</code>, is in the <code>Resources</code> directory of the Mulgara directory.</p>
+
+<p>The SOFA API documentation, including the Mulgara classes that provide persistence storage for SOFA objects, is located in <code><a class="internetlinktemplate" title="" href="api/sofa/index.html"><Mulgara install>/docs/api/sofa</a></code>.</p>
+<div class="anchor"><a name="o2626"> </a></div>
+<h3>Creating the Ontology</h3>
+
+<p>The following class is a simple class that creates and displays data about the <code>CameraPhone</code> ontology, which is an extension of the <code>Camera</code> ontology. This code is available as <code>CameraPhoneOntologyApp.java</code> in the the <code>Resources</code> directory of your Mulgara installation.</p>
+
+<p class="commandtext">package org.mulgara.sofa.example;<br />
+<br />
+import java.util.*;<br />
+import java.util.Collection;<br />
+import java.net.*;<br />
+import java.io.*;<br />
+<br />
+import net.java.dev.sofa.*;<br />
+import net.java.dev.sofa.impl.*;<br />
+import net.java.dev.sofa.model.*;<br />
+import org.mulgara.server.Session;<br />
+import org.mulgara.server.SessionFactory;<br />
+import org.mulgara.server.driver.SessionFactoryFinder;<br />
+import org.mulgara.client.jrdf.AbstractGraphFactory;<br />
+import org.mulgara.store.jrdf.JRDFGraph;<br />
+import org.mulgara.store.xa.XADatabaseImpl;<br />
+import org.mulgara.store.*;<br />
+import org.mulgara.sofa.*;<br />
+import org.mulgara.sofa.serialize.owl.*;<br />
+import org.jrdf.graph.*;<br />
+<br />
+public class CameraPhoneOntologyApp {<br />
+<br />
+ public static void main(String[] args) {<br />
+<br />
+ // Create a new Camera Ontology Application<br />
+ CameraPhoneOntologyApp app = new CameraPhoneOntologyApp();<br />
+<br />
+ // SOFA Ontology object<br />
+ Ontology ontology = null;<br />
+<br />
+ try {<br />
+<br />
+ System.out.println("Creating empty Ontology");<br />
+ String ontologyURI = "http://www.xfront.com/owl/ontologies/camera/";<br />
+<br />
+ // Create in memory based Ontology<br />
+ ontology = OntoConnector.getInstance().createOntology(ontologyURI);<br />
+<br />
+ // uncomment this to..<br />
+ // Create Ontology on the client (communicates with Mulgara server)<br />
+ //ontology = OntoConnector.getInstance().createOntology(<br />
+ // app.createClientOntologyModel(), ontologyURI);<br />
+<br />
+ // uncomment this to..<br />
+ // Create Ontology on the server (same JVM)<br />
+ //ontology = OntoConnector.getInstance().createOntology(<br />
+ // app.createServerOntologyModel(), ontologyURI);<br />
+<br />
+ // Populate the ontology data<br />
+ app.loadCameraOntology(ontology);<br />
+<br />
+ } catch (Exception exception) {<br />
+<br />
+ System.out<br />
+ .println("Failed to create the ontolgy due to the following exception:");<br />
+ exception.printStackTrace();<br />
+ }<br />
+<br />
+ try {<br />
+<br />
+ // Create the ontology data<br />
+ app.populateOntology(ontology);<br />
+ } catch (Exception exception) {<br />
+<br />
+ System.out<br />
+ .println("Failed to populate the ontolgy due to the following exception:");<br />
+ exception.printStackTrace();<br />
+ }<br />
+ }<br />
+<br />
+<br />
+ /**<br />
+ * Loads the example Camera ontology into the supplied ontology object.<br />
+ * <br />
+ * @param onto<br />
+ * @throws Exception<br />
+ */<br />
+ public void loadCameraOntology(Ontology onto) throws Exception {<br />
+<br />
+ System.out.println("Loading Camera Ontology");<br />
+ OWLReader.getReader().read(onto, "file:Resources/kamera.owl");<br />
+<br />
+ System.out.println("Loaded Ontology");<br />
+<br />
+ // get the Digital Camera Thing, a Concept is like an OWL Class,<br />
+ // Thing is more like an Instance<br />
+ Concept digiCam = onto.getConcept("Digital");<br />
+<br />
+ // Create a new type of camera: camera phone<br />
+<br />
+ // create phone first<br />
+ Concept phone = onto.createConcept("Phone");<br />
+ // give it a property/relation of GSM or CDMA<br />
+ Relation standard = onto.createRelation("standard");<br />
+ Set standards = new HashSet();<br />
+ standards.add("GSM");<br />
+ standards.add("CDMA");<br />
+ phone.setRestrictionOn(standard, standards, 1, 2); // 1=minCard, 2=maxCard<br />
+<br />
+ // make phone a sub class of purchaseable item<br />
+ Concept purchaseableItem = onto.getConcept("PurchaseableItem");<br />
+ phone.addSuperConcept(purchaseableItem);<br />
+<br />
+ // create camera phone<br />
+ Concept cameraPhone = onto.createConcept("CameraPhone");<br />
+ cameraPhone.addSuperConcept(phone);<br />
+ cameraPhone.addSuperConcept(digiCam);<br />
+<br />
+ // Show super classes<br />
+ System.out.println("SUPER CLASSES");<br />
+ Concept superConcept = null;<br />
+ Collection superConcepts = cameraPhone.getSuperConcepts(true);<br />
+<br />
+ // test for N superclasses<br />
+ System.out.println("Number of superConcepts found: " + superConcepts.size());<br />
+<br />
+ // test a phone is our superclass<br />
+ System.out.println("Found phone concept in list of super concepts: "<br />
+ + superConcepts.contains(phone));<br />
+<br />
+ for (Iterator sc = superConcepts.iterator(); sc.hasNext();) {<br />
+ superConcept = (Concept) sc.next();<br />
+<br />
+ System.out.println(superConcept.getId());<br />
+ }<br />
+<br />
+ // show properties, including super properties 'true'<br />
+ System.out.println("PROPERTIES");<br />
+<br />
+ for (Iterator ri = cameraPhone.definedRelations(true); ri.hasNext();) {<br />
+ Relation relation = (Relation) ri.next();<br />
+<br />
+ System.out.println(relation.getId());<br />
+ }<br />
+<br />
+ // test camera phones have 'standard'<br />
+ System.out.println("CameraPhone contains the 'standard' relation: "<br />
+ + cameraPhone.hasDefinedRelation(standard, true));<br />
+<br />
+ // Write new ontology to Standard out<br />
+ OWLWriter.getWriter().write(onto, System.out);<br />
+ }<br />
+<br />
+ // Misc supporting methods removed<br />
+}</p>
+
+<p>An analysis of the class is as follows:</p>
+
+<p class="indentcommandtext">import java.util.*;<br />
+import java.util.Collection;<br />
+import java.net.*;<br />
+import java.io.*;<br />
+<br />
+import net.java.dev.sofa.*;<br />
+import net.java.dev.sofa.impl.*;<br />
+import net.java.dev.sofa.model.*;<br />
+import org.mulgara.server.Session;<br />
+import org.mulgara.server.SessionFactory;<br />
+import org.mulgara.server.driver.SessionFactoryFinder;<br />
+import org.mulgara.client.jrdf.AbstractGraphFactory;<br />
+import org.mulgara.store.jrdf.JRDFGraph;<br />
+import org.mulgara.store.xa.XADatabaseImpl;<br />
+import org.mulgara.store.*;<br />
+import org.mulgara.sofa.*;<br />
+import org.mulgara.sofa.serialize.owl.*;<br />
+import org.jrdf.graph.*;</p>
+
+<p class="indent">In order to use the SOFA API, the <code>net.java.dev.sofa</code> packages need to be imported, along with the <code>org.mulgara.sofa.serialize.owl</code> packages to allow for reading OWL files.</p>
+
+<p class="indentcommandtext">System.out.println("Creating empty Ontology");<br />
+String ontologyURI = "http://www.xfront.com/owl/ontologies/camera/";<br />
+<br />
+// Create in memory based Ontology<br />
+ontology = OntoConnector.getInstance().createOntology(ontologyURI);</p>
+
+<p class="indent">Ontologies created or loaded during a session are maintained in a pool by a singleton instance of the <code>OntoConnector</code> class and are identified by the namespace given during construction. Namespace identifiers should be unique within a session and in valid URI format. Ontologies created in this way are memory based, which is fine for ontology viewing. SOFA provides another ontology creation method, <code>createOntology(OntologyModel, String)</code>, that produces an ontology that is backed by the given OntologyModel, which can be a Mulgara model. See the <a id="h2632" class="documentlinktemplate" title="Changing the Backing of an Ontology" href="/inferencing/sofa.html#o2627">Changing the Backing of an Ontology section</a> for more information.</p>
+
+<p class="indentcommandtext">System.out.println("Loading Camera Ontology");<br />
+OWLReader.getReader().read(onto,"file:Resources/kamera.owl");</p>
+
+<p class="indent">Often an ontology is specified in a file of some format, so there are classes available that will read them in and store the data in the given ontology. In this case, the OWL file, <code>kamera.owl</code>, contains the camera ontology and we want to read it into the ontology we created previously. We use the <code>org.mulgara.sofa.serialize.owl.OWLReader</code> class to populate our ontology model. Note that this OWLReader is an updated version of the one built in to SOFA (<code>net.java.dev.sofa.serialize.owl.OWLReader</code>) which uses an outdated version of Jena to parse RDF.</p>
+
+<p class="indentcommandtext">// get the Digital Camera Thing, a Concept is like an OWL Class,<br />
+// Thing is more like an Instance<br />
+Concept digiCam = onto.getConcept("Digital");</p>
+
+<p class="indent">After the ontology is loaded, all concepts, relations and instances are instantly available for browsing and manipulating. To retrieve any of these objects, use the <code>getConcept(String)</code>, <code>getRelation(String)</code> and <code>getThing(String)</code> (<em>Thing</em> is another way of referring to <em>instances</em>) methods in the Ontology class. All objects in the ontology have unique names and these are used to retrieve the values as objects.</p>
+
+<p class="indentcommandtext">// create phone first<br />
+Concept phone = onto.createConcept("Phone");</p>
+
+<p class="indent">Since we are adding a new concept and relation to the ontology, we need to create the concept we want to add by invoking the <code>createConcept(String)</code> method found in the Ontology class. The string passed in is used as the identifier for the concept when the ontology is queried. There are similar methods available for relations and instances.</p>
+
+<p class="indentcommandtext">// give it a property/relation of GSM or CDMA<br />
+Relation standard = onto.createRelation("standard");<br />
+Set standards = new HashSet();<br />
+standards.add("GSM");<br />
+standards.add("CDMA");<br />
+phone.setRestrictionOn(standard, standards, 1,2); // 1=minCard, 2=maxCard</p>
+
+<p class="indent">Since we are creating our phone concept, we should add the <em>standard</em> relation to it as well, which can be one or both of two possibilities: GSM or CDMA. As mentioned in the previous step, there are similar methods to the <code>createConcept(String)</code> method available that allows us to create a new relation, giving it a unique identifier. The two aforementioned standards are strict and have no other possibilities, so we need to create a set of options that the relation can select from when assigning values using the <code>java.util.Collection</code> class or subclasses. When assigning the value of the relation we can have one or both of the values so the cardinality needs to be set for the relation using the <code>setRestrictionOn(Relation, Set, int, int)</code> method available in the <code>Concept</code> class. This adds the relation to the concept along with the set of values and the minimum and maximum cardinalities, respectively. If the restriction does not contain an enumeration of values and is only required to restrict the number of relation instances of that type that can exist for a concept, then the <code>setRestrictionOn(Relation, int, int)</code> method should be used instead.</p>
+
+<p class="indentcommandtext">// make phone a sub class of purchaseable item<br />
+Concept purchaseableItem = onto.getConcept("PurchaseableItem");<br />
+phone.addSuperConcept(purchaseableItem);<br />
+<br />
+// create camera phone<br />
+Concept cameraPhone = onto.createConcept("CameraPhone");<br />
+cameraPhone.addSuperConcept(phone);<br />
+cameraPhone.addSuperConcept(digiCam);</p>
+
+<p class="indent">Quite often a concept is a subconcept of another type, like a phone is a subconcept of a purchasable item. To add a concept as a super concept of another, use the <code>addSuperConcept(Concept)</code> method found in the <code>Concept</code> class. Alternately, there exists a method called <code>addSubConcept(Concept)</code> which does the opposite and adds the given concept as a subconcept. A concept can be added as a subconcept to different superconcepts, which is useful because we want a 'CameraPhone' concept to be both a camera and a phone subconcept.</p>
+
+<p class="indentcommandtext">// Show super classes<br />
+System.out.println("SUPER CLASSES");<br />
+Concept superConcept = null;<br />
+Collection superConcepts = cameraPhone.getSuperConcepts(true);<br />
+<br />
+// test for N superclasses<br />
+System.out.println("Number of superConcepts found: " + superConcepts.size());<br />
+<br />
+// test a phone is our superclasses<br />
+System.out.println("Found phone concept in list of super concepts: "<br />
+ + superConcepts.contains(phone));<br />
+<br />
+for (Iterator sc = superConcepts.iterator(); sc.hasNext();) {<br />
+ superConcept = (Concept) sc.next();<br />
+<br />
+ System.out.println(superConcept.getId());<br />
+}</p>
+
+<p class="indent">At some point in working with an ontology you might want to discover the superconcepts or subconcepts of a particular concept. This can be done using the <code>getSuperConcepts(boolean)</code> and <code>getSubConcepts(boolean)</code> methods. A boolean of false retrieves only the direct superconcepts or subconcepts while a boolean of true retrieves all the indirect ones. Retrieving the indirect concepts is also called <em>inferencing</em>. In the CameraPhone example, you expect the list of superconcepts to be Phone, Camera, Digital and PurchaseableItem. From this you can determine that the phone is both a digital camera and a phone concept (direct superconcepts) as well as being a camera and a purchaseable item concept (indirect superconcepts).</p>
+
+<p class="indentcommandtext">// show properties, including super properties 'true'<br />
+System.out.println("PROPERTIES");<br />
+<br />
+for (Iterator ri = cameraPhone.definedRelations(true); ri.hasNext();) {<br />
+ Relation relation = (Relation) ri.next();<br />
+<br />
+ System.out.println(relation.getId());<br />
+}<br />
+<br />
+// test camera phones have 'standard'<br />
+System.out.println("CameraPhone contains the 'standard' relation: " <br />
+ + cameraPhone.hasDefinedRelation(standard, true));</p>
+
+<p class="indent">Just as you can navigate the direct and indirect super and sub concepts, you can navigate the indirect and direct domains to find out the values of all relations for a particular concept. To retrieve the relations, the <code>definedRelations(boolean)</code> is available in the <code>Concept</code> class. The boolean value works in much the same way as for super and subconcept listing where false lists only the relations for the concept and true lists the concept relation and any superconcept relations. Therefore, you expect to find the standard relation in a camera phone inherited from the phone concept.</p>
+
+<p class="indentcommandtext">// Write new ontology to Standard out<br />
+OWLWriter.getWriter().write(onto, System.out);</p>
+
+<p class="indent">Once the ontology is created or modified, you might want to save it to disk for use in another application. Use the <code>write(Ontology, OutputStream)</code> method available in the <code>OWLWriter</code> class.</p>
+<div class="anchor"><a name="o2627"> </a></div>
+<h3>Changing the Backing of an Ontology</h3>
+
+<p>The standard memory model of SOFA's ontology object is acceptable for tasks such as viewing small ontologies. However, data stored within an ontology can get very large very quickly so it becomes less feasible to use memory as a storage facility. Also you might change the ontology and then want to save these changes.</p>
+
+<p>You can use Mulgara to store the data as well as to provide a structured querying interface, allowing you to search the ontology for particular pieces of information and infer relationships. In order to do this you need to construct an <code>OntologyModel</code> object that plugs into the Mulgara framework and uses that as the backing instead of memory. To create a Mulgara backed ontology:</p>
+<ol><li>Comment out the memory based ontology code:
+<p class="listcontinuecommandtext">// Create in memory based Ontology<br />
+ontology = OntoConnector.getInstance().createOntology(ontologyURI);</p>
+</li><li>Then uncomment either the ontology on the client or server code:
+<p class="listcontinuecommandtext">// uncomment this to..<br />
+// Create Ontology on the client (communicates with Mulgara server)<br />
+//ontology = OntoConnector.getInstance().createOntology(<br />
+// app.createClientOntologyModel(), ontologyURI);</p>
+
+<p class="listnote"><strong>Note -</strong> If you use the client based ontology, the Mulgara server must be running.</p>
+
+<p class="listcontinuecommandtext">// uncomment this to..<br />
+// Create Ontology on the server (same JVM)<br />
+//ontology = OntoConnector.getInstance().createOntology(<br />
+// app.createServerOntologyModel(), ontologyURI);</p>
+
+<p class="listnote"><strong>Note -</strong> If you use the server based ontology, you must shutdown Mulgara, and include the Mulgara server jar in your Java class path. See the <a id="h3200" class="documentlinktemplate" title="Compiling and Running the Example" href="/inferencing/sofa.html#o2639">Compiling and Running the Example section</a> for more information.</p>
+</li></ol>
+<p>An analysis of the code is as follows:</p>
+
+<p class="indentcommandtext">ontology = OntoConnector.getInstance().createOntology(app.createServerOntologyModel(), ontologyURI);</p>
+
+<p class="indent">The code section before this is concerned with initializing a Mulgara backed JRDF graph and using this graph, you can use an implementation of the ontology model to create our ontology. Inside the <code>OntologyJRDFModel</code> implementation are the hooks to direct all ontology manipulations towards the Mulgara backed JRDF graph. It is important to note that the constructor for the ontology is slightly different in that the model to use is passed in also. Omitting this parameter defaults the backing to the memory based model.</p>
+<div class="anchor"><a name="o2628"> </a></div>
+<h3>Populating the Ontology</h3>
+
+<p>Once an ontology is written, data is required to give it meaning. To achieve this use the <code>populateOntology(Ontology ontology)</code> method, which looks like the following:</p>
+
+<p class="commandtext">public void populateOntology(Ontology ontology) throws Exception {<br />
+<br />
+ // Retrieve the CameraPhone concept<br />
+ Concept cameraPhone = ontology.getConcept("CameraPhone");<br />
+<br />
+ // Create a CameraPhone instance called 'Nokia'<br />
+ Thing mobile = cameraPhone.createInstance("Nokia");<br />
+<br />
+ // Retrieve the Digital concept<br />
+ Concept digital = ontology.getConcept("Digital");<br />
+<br />
+ // Create an instance of the digital camera called 'Olympus'<br />
+ Thing camera = digital.createInstance("Olympus");<br />
+<br />
+ // Retrieve the 'standard' relation<br />
+ Relation standardRelation = ontology.getRelation("standard");<br />
+<br />
+ // Retrieve the 'lens' relation<br />
+ Relation lensRelation = ontology.getRelation("lens");<br />
+<br />
+ // Set the lens and standard type for the mobile phone<br />
+ mobile.add(standardRelation, "CDMA");<br />
+ mobile.add(lensRelation, "CompanyX");<br />
+<br />
+ // Set the lens for the camera<br />
+ camera.add(lensRelation, "Carl Zeiss");<br />
+<br />
+ System.out.println("Listing standards for mobile phone:");<br />
+<br />
+ // Iterate through the standards of the phone<br />
+ for (Iterator iterator = mobile.list(standardRelation).iterator();<br />
+ iterator.hasNext(); ) {<br />
+<br />
+ // Print the next standard<br />
+ System.out.println(iterator.next());<br />
+ }<br />
+<br />
+ System.out.println("Listing lenses for mobile phone:");<br />
+<br />
+ // Iterate through the lenses of the phone<br />
+ for (Iterator iterator = mobile.list(lensRelation).iterator(); iterator.hasNext(); ) {<br />
+<br />
+ // Print the next lens<br />
+ System.out.println(iterator.next());<br />
+ }<br />
+<br />
+ System.out.println("Listing lenses for camera:");<br />
+<br />
+ // Iterate through the lenses of the camera<br />
+ for (Iterator iterator = camera.list(lensRelation).iterator(); iterator.hasNext(); ) {<br />
+<br />
+ // Print the next lens<br />
+ System.out.println(iterator.next());<br />
+ }<br />
+<br />
+ System.out.println("All Things:");<br />
+<br />
+ // Iterate through all 'Things' in the ontology framework<br />
+ for (Iterator iterator = ontology.things(); iterator.hasNext(); ) {<br />
+<br />
+ System.out.println("\t" + ((Thing) iterator.next()).getId());<br />
+ }<br />
+}</p>
+
+<p>An analysis of the population method is as follows:</p>
+
+<p class="indentcommandtext">// Retrieve the CameraPhone concept<br />
+Concept cameraPhone = ontology.getConcept("CameraPhone");<br />
+<br />
+// Create a CameraPhone instance called 'Nokia'<br />
+Thing mobile = cameraPhone.createInstance("Nokia");<br />
+<br />
+// Retrieve the Digital concept<br />
+Concept digital = ontology.getConcept("Digital");<br />
+<br />
+// Create an instance of the digital camera called 'Olympus'<br />
+Thing camera = digital.createInstance("Olympus");</p>
+
+<p class="indent">Adding and retrieving concepts in an ontology are not really useful on their own unless you can create objects with meaningful data based on the concept's structure. Every object and datatype within an ontology can be traced down to a common base object, <code>Thing</code>, and this is what instances are created as. To create a new instance of a concept, invoke the <code>createInstance(String)</code> method, passing in the value of the name of the instance as a parameter. The resulting object represents a new instance of that concept with the data set as the string. Since we created a CameraPhone ontology, let's create an instance of it to represent a Nokia phone with a camera, and an Olympus digital camera.</p>
+
+<p class="indentcommandtext">// Retrieve the 'standard' relation<br />
+Relation standardRelation = ontology.getRelation("standard");<br />
+<br />
+// Retrieve the 'lens' relation<br />
+Relation lensRelation = ontology.getRelation("lens");<br />
+<br />
+// Set the lens and standard type for the mobile phone<br />
+mobile.add(standardRelation, "CDMA");<br />
+mobile.add(lensRelation, "CompanyX");<br />
+<br />
+// Set the lens for the camera<br />
+camera.add(lensRelation, "Carl Zeiss");</p>
+
+<p class="indent">Concepts are rarely useful on their own as ontologies are used to describe the concepts using relations. So the next step is to add some data about various relations on the concepts. There are several ways to add data to an instance of a concept and these are the <code>set(Relation, String)</code>, <code>add(Relation, String)</code>, <code>setAll(Relation, String[])</code>, and <code>addAll(Relation, String[])</code> methods. These associate one or more string values with the given relation for the concept. The <code>add</code> methods are for adding a new relation value or values to the current list while the <code>set</code> methods replace the current value with the new value or values. Be sure to keep this in mind when creating new relations else data may be lost. As seen during the creation method (see the <a id="h2633" class="documentlinktemplate" title="Creating the Ontology" href="/inferencing/sofa.html#o2626">Creating the Ontology section</a>), a subconcept inherits the relations of its superconcepts so we are able to set not only the standard, but the lens type and other information on our camera phone. Remember that the phone can only have a standard value of either one of or both of CDMA or GSM.</p>
+
+<p class="indentcommandtext">System.out.println("Listing standards for mobile phone:");<br />
+<br />
+// Iterate through the standards of the phone<br />
+for (Iterator iterator = mobile.list(standardRelation).iterator();<br />
+ iterator.hasNext(); ) {<br />
+<br />
+ // Print the next standard<br />
+ System.out.println(iterator.next());<br />
+}<br />
+<br />
+System.out.println("Listing lenses for mobile phone:");<br />
+<br />
+// Iterate through the lenses of the phone<br />
+for (Iterator iterator = mobile.list(lensRelation).iterator(); iterator.hasNext(); ) {<br />
+<br />
+ // Print the next lens<br />
+ System.out.println(iterator.next());<br />
+}<br />
+<br />
+System.out.println("Listing lenses for camera:");<br />
+<br />
+// Iterate through the lenses of the camera<br />
+for (Iterator iterator = camera.list(lensRelation).iterator(); iterator.hasNext(); ) {<br />
+<br />
+ // Print the next lens<br />
+ System.out.println(iterator.next());<br />
+}</p>
+
+<p class="indent">After adding data, you will probably want to retrieve it again for a search operation or some form of query. To retrieve the list of values for a particular relation of a concept, use the <code>list(Relation)</code> method, which returns a <code>java.util.Collection</code> object which can be iterated through. The above code lists the values we inserted previously for each relation. Again, the indirect relations lens and standard are picked up as a relation of a superconcept for CameraPhone concepts.</p>
+
+<p class="indentcommandtext">System.out.println("All Things:");<br />
+<br />
+// Iterate through all 'Things' in the ontology framework<br />
+for (Iterator iterator = ontology.things(); iterator.hasNext(); ) {<br />
+<br />
+ System.out.println("\t" + ((Thing) iterator.next()).getId());<br />
+}</p>
+
+<p class="indent">Now that some concepts are added to the ontology you can view that they are indeed part of it by using the <code>things()</code> method, which return an <code>iterator</code> object. This iterates over the entire collection of objects in the ontology, concepts, relations, instances and other content alike. Similarly, there are <code>concepts()</code>, and <code>relations()</code> methods for iteration over the concepts and relations of the ontology respectively. Unlike the <code>things()</code> method, they do not return instances and values of concepts and relations. That is, you see CameraPhone, but not Nokia in the concepts iterator.</p>
+<div class="anchor"><a name="o2639"> </a></div>
+<h3>Compiling and Running the Example</h3>
+
+<p>To run the example:</p>
+<ol><li>Retrieve it from the <code>Resources</code> directory of your Mulgara installation and place it in a directory hierarchy like the one shown below:
+<p class="listcontinuecommandtext">example/sofa/java/org/mulgara/sofa/example/CameraPhoneOntologyApp.java</p>
+</li><li>Compile it from the directory in which you created the above hierarchy:
+<p class="listcontinuecommandtext">javac -classpath <Mulgara directory>/Resources/driver-2.1.jar<br />
+ example/sofa/java/org/mulgara/sofa/example/CameraPhoneOntologyApp.java</p>
+</li><li>Depending on the ontology implementation you are running (that is, a memory, client or server based ontology), there are different requirements for a Mulgara server:<ul><li>If you are using the memory based ontology:
+<p class="listcontinuecommandtext">// Create in memory based Ontology <br />
+ontology = OntoConnector.getInstance().createOntology(ontologyURI);</p>
+</li><li>If you are using the client based ontology:
+<p class="listcontinuecommandtext">// Create Ontology on the client (communicates with Mulgara server)<br />
+ontology = OntoConnector.getInstance().createOntology( <br />
+app.createClientOntologyModel(), ontologyURI);</p>
+
+<p class="listcontinue2"><strong>Note -</strong> If you use the client based ontology, you must have a running Mulgara server as the example tries to connect it. See the Starting and Stopping Mulgara section for more information.</p>
+</li><li>If you are using the server based ontology:
+<p class="listcontinuecommandtext">// Create Ontology on the server (same JVM)<br />
+ontology = OntoConnector.getInstance().createOntology( <br />
+app.createServerOntologyModel(), ontologyURI);</p>
+
+<p class="listcontinue2"><strong>Note -</strong> If you use the server based ontology, you must shutdown the Mulgara server, and include the Mulgara server jar in your Java class path. See the next point for more information.</p>
+</li></ul></li><li>Depending on the ontology implementation you are running (that is, a memory, client or server based ontology), run the example application from the Mulgara installation directory, with one of the following commands:<ul><li>If you are using the memory or client based ontology:
+<p class="listcontinuecommandtext">java -classpath <Mulgara directory>/Resources/driver-2.1.jar:example/sofa/java<br />
+ org.mulgara.sofa.example.CameraPhoneOntologyApp</p>
+</li><li>If you are using the server based ontology:
+<p class="listcontinuecommandtext">java -classpath <Mulgara directory>/Resources/driver-1.1.0.jar:example/sofa/java:<Mulgara directory>/mulgara-1.0.0.jar<br />
+ org.mulgara.sofa.example.CameraPhoneOntologyApp</p>
+</li></ul></li></ol>
+<div class="anchor"><a name="o2629"> </a></div>
+<h3>Integration</h3>
+
+<p>Integration depends on which of the three ontology models you decide to use. The following table outlines the advantages and disadvantages of each ontology model.</p>
+<table width="522" cellpadding="2" cellspacing="0" border="0" style="border-collapse:collapse">
+<tr>
+<td width="252" height="0"></td>
+<td width="270" height="0"></td>
+</tr>
+<tr align="left" valign="top">
+<td colspan="2" width="522">
+<p class="tableheading">In Memory Ontology Model</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<th width="252">
+<p class="tableheading">Advantages</p>
+</th>
+<th width="270">
+<p class="tableheading">Disadvantages</p>
+</th>
+</tr>
+<tr align="left" valign="top">
+<td width="252">
+<p>Very fast</p>
+</td>
+<td width="270">
+<p>Not persisted to disk</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="252">
+<p>Small footprint</p>
+</td>
+<td width="270">
+<p>Not transaction safe </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="252">
+<p> </p>
+</td>
+<td width="270">
+<p>Not scalable</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="252">
+<p> </p>
+</td>
+<td width="270">
+<p> </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td colspan="2" width="522">
+<p class="tableheading">Embedded Server Ontology Model</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<th width="252">
+<p class="tableheading">Advantages</p>
+</th>
+<th width="270">
+<p class="tableheading">Disadvantages</p>
+</th>
+</tr>
+<tr align="left" valign="top">
+<td width="252">
+<p>Simple deployment</p>
+</td>
+<td width="270">
+<p>Not suitable for client/server applications</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="252">
+<p>Persistent datastore</p>
+</td>
+<td width="270">
+<p>Slower than in memory ontology</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="252">
+<p>Full Mulgara server advantages</p>
+</td>
+<td width="270">
+<p> </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="252">
+<p>Scalable </p>
+</td>
+<td width="270">
+<p> </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="252">
+<p> </p>
+</td>
+<td width="270">
+<p> </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td colspan="2" width="522">
+<p class="tableheading">Client/Server Ontology Model</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<th width="252">
+<p class="tableheading">Advantages</p>
+</th>
+<th width="270">
+<p class="tableheading">Disadvantages</p>
+</th>
+</tr>
+<tr align="left" valign="top">
+<td width="252">
+<p>Client/server architecture means client can be on different machine to server</p>
+</td>
+<td width="270">
+<p>Slower than memory and embedded ontology model</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="252">
+<p>Persistent datastore</p>
+</td>
+<td width="270">
+<p> </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="252">
+<p>Full Mulgara server advantages</p>
+</td>
+<td width="270">
+<p> </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="252">
+<p>Scalable </p>
+</td>
+<td width="270">
+<p> </p>
+</td>
+</tr>
+
+</table>
+
+<p>In most cases simply including the driver.jar when compiling and running is sufficient for using the SOFA API. When using the client server ontology model a Mulgara server must be running.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/compiling.html
===================================================================
--- trunk/docs/site/integration/compiling.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/compiling.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,93 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Compiling with Ant</title>
+ <meta name="keywords" content="Compiling, Ant, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/statements.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/integrate.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="2686.htm">HTTP Resolver and MP3 Content Handler Tutorial</a></p>
+<p class="relateditem"><a href="2686.htm#o3182"></a></p>
+<p class="relateditem"><a href="2687.htm">Prerequisites</a></p>
+<p class="relateditem"><a href="3183.htm">Developing Protocol Resolvers</a></p>
+<p class="relateditem"><a href="3184.htm">Developing Content Handlers</a></p>
+<p class="relateditem"><a href="/integration/integrate.html">Integrating into Mulgara</a></p>
+
+ -->
+
+
+
+<h3>Compiling with Ant</h3>
+
+<p>Example Ant script files (<code>build-tutorial.xml</code> and <code>build-tutorial.properties</code> in the directory you unzipped the tutorial to) are provided to allow you to compile the resolver and content handler. Make sure that you have Apache Ant installed and set up on your machine first. For more information on installing and running Ant software, read the <a class="internetlinktemplate" title="" href="http://ant.apache.org/manual/index.html" target="_blank">Apache Ant Manual</a>.</p>
+
+<p>The following structure within the Mulgara installation directory is assumed:</p>
+
+<p class="commandtext">/tutorial<br />
+ build-tutorial.xml<br />
+ build-tutorial.properties<br />
+ /conf<br />
+ /handler<br />
+ parserfactory.conf<br />
+ /handler<br />
+ /java<br />
+ compile-handler.list<br />
+ **Handler package directory structure**<br />
+ /rdfs<br />
+ mp3.rdfs<br />
+ /resolver<br />
+ /java<br />
+ compile-resolver.list<br />
+ **Resolver package directory structure**<br />
+ /lib<br />
+ **Supporting jars for the resolver and content handler**</p>
+
+<div class="anchor"><a name="o3174"> </a></div>
+
+
+<p>Change the following properties:</p>
+<ul><li><code>server-version</code> property in the <code>build-tutorial.properties</code> file to be the version of the server you are using. For example, 1.1.0</li><li>server.base.dir property to the directory you installed TKS in</li></ul>
+<p>All other properties should not require changing.</p>
+<div class="anchor"><a name="o3185"> </a></div>
+
+
+<p>Both of the modules used in this tutorial are in the Mulgara distribution and can be built using the main build file.</p>
+
+<p>From the main directory of your Mulgara installation, run:</p>
+<ul><li><code>build.bat content-mp3-jar</code> (for systems running a Linux<sup>®</sup> or UNIX<sup>®</sup> operating system use <code>./build.sh content-mp3-jar</code>)
+<p class="listcontinue">This produces the file <code>content-mp3-base-<Mulgara version>.jar</code> (where <code><Mulgara version></code> is the version of your Mulgara installation) in the <code>bin</code> directory.</p>
+</li><li><code>build.bat resolver-http-jar</code> (for systems running a Linux<sup>®</sup> or UNIX<sup>®</sup> operating system use <code>./build.sh resolver-http-jar</code>)
+<p class="listcontinue">This produces a file called <code>resolver-http-base-<Mulgara version>.jar</code> in the <code>bin</code> directory.</p>
+</li></ul>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/contenthandlers.html
===================================================================
--- trunk/docs/site/integration/contenthandlers.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/contenthandlers.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,290 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Content Handlers</title>
+ <meta name="keywords" content=" Handlers, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/integration/contenthandlers.html#o2710">Configuration and Initialisation</a> |
+ <a href="/integration/contenthandlers.html#o2711">Implementing the Interface</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/contenthandlersdev.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/parsers.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/contenthandlersdev.html">Developing Content Handlers</a></p>
+<p class="relateditem"><a href="/integration/parsers.html">Parsers</a></p>
+<p class="relateditem"><a href="/integration/statements.html">Statements</a></p>
+
+ -->
+
+
+
+
+<h4>Content Handlers</h4>
+
+<p>Working in conjunction with resolvers are content handlers that perform the actual conversion of data in a file into RDF triples for the resolver to constrain. All content handlers use an implementation of the <code>Statements</code> interface to hold the triples extracted from the file and allow for navigation of the results.</p>
+
+<p>While the <code>ContentHandler</code> interface is relatively simple, there are important decisions to be made before implementing it.</p>
+
+<div class="anchor"><a name="o3171"> </a></div>
+
+
+<p>First, you need to determine the purpose of the content handler. The issue of protocols is dealt with by the <code>Resolver</code> classes, so you can create individual content handlers for each file type without having to worry about which protocol you are using to connect to it. In this case the content handler is for MP3 files.</p>
+<div class="anchor"><a name="o3172"> </a></div>
+
+
+<p>Second, you need to decide how the triples are transferred to the <code>Statements</code> object. In the case of the MP3 content handler, it parses directly into an MP3 specific statements container. However, it is possible to parse the triples first and then feed them into the <code>Statements</code> object.</p>
+<div class="anchor"><a name="o3173"> </a></div>
+
+
+<p>Finally, in addition to creating the statements, there is the issue of parsing the file. The MP3 content handler uses an ID3 tag parsing utility that is called from the <code>Statements</code> implementation. Whether this is done as part of the content handler or as a separate utility, and whether the statements are generated as a result of parsing or are fed the triples, is up to the implementer.</p>
+<div class="anchor"><a name="o2710"> </a></div>
+<h5>Configuration and Initialisation</h5>
+
+<p>Depending on the design choices made (see the <a id="h2723" class="documentlinktemplate" title="Content Handlers" href="/integration/contenthandlers.html">Creating the Content Handler section</a>) configuration might not be done in the <code>ContentHandler</code> class. If pre-configuration of the parser is required, then it can be done in the implementation, however, the class itself does not require any configuration.</p>
+<div class="anchor"><a name="o2711"> </a></div>
+<h5>Implementing the Interface</h5>
+
+<p>Once the usage and structure for the handler is set, the interface can be implemented. The MP3 content handler performs its parsing as part of the statements container so not much implementing is required. The implementation looks something like the following (extracted from <code>MP3ContentHandler.java</code>):</p>
+
+<p class="commandtext">package org.kowari.content.mp3;<br />
+<br />
+// Java 2 standard packages<br />
+import java.io.InputStream;<br />
+import java.net.URI;<br />
+import java.util.Map;<br />
+<br />
+// Java 2 enterprise packages<br />
+import javax.activation.MimeType;<br />
+import javax.activation.MimeTypeParseException;<br />
+<br />
+// Third party packages<br />
+import org.apache.log4j.Logger; // Apache Log4J<br />
+<br />
+// Local packages<br />
+import org.kowari.content.Content;<br />
+import org.kowari.content.ContentHandler;<br />
+import org.kowari.content.ContentHandlerException;<br />
+import org.kowari.resolver.spi.ResolverSession;<br />
+import org.kowari.resolver.spi.Statements;<br />
+import org.kowari.query.TuplesException;<br />
+<br />
+public class MP3ContentHandler implements ContentHandler {<br />
+<br />
+ /** Logger. */<br />
+ private static Logger logger =<br />
+ Logger.getLogger(MP3ContentHandler.class.getName());<br />
+<br />
+ /**<br />
+ * The MIME type of RDF/XML.<br />
+ */<br />
+ private static final MimeType AUDIO_MPEG;<br />
+<br />
+ static {<br />
+ try {<br />
+ AUDIO_MPEG = new MimeType("audio", "mpeg");<br />
+ }<br />
+ catch (MimeTypeParseException e) {<br />
+ throw new ExceptionInInitializerError(e);<br />
+ }<br />
+ }<br />
+<br />
+ /**<br />
+ * Parses the ID3 tags of the MP3 file pointed to by the content object which<br />
+ * are then converted to a statements object.<br />
+ *<br />
+ * @param content The actual content we are going to be parsing<br />
+ * @param resolverSession The session in which this resolver is being used<br />
+ *<br />
+ * @return The parsed statements object<br />
+ *<br />
+ * @throws ContentHandlerException<br />
+ */<br />
+ public Statements parse(Content content, ResolverSession resolverSession) throws<br />
+ ContentHandlerException {<br />
+<br />
+ // Container for our statements<br />
+ MP3Statements statements = null;<br />
+<br />
+ try {<br />
+<br />
+ // Attempt to create the MP3 statements<br />
+ statements = new MP3Statements(content, resolverSession);<br />
+ } catch (TuplesException tuplesException) {<br />
+<br />
+ throw new ContentHandlerException("Unable to create statements object from " +<br />
+ "content object: " + content.getURI().toString(),<br />
+ tuplesException);<br />
+ }<br />
+<br />
+ return statements;<br />
+ }<br />
+<br />
+ /**<br />
+ * @return true if the file part of the URI has an<br />
+ * .mp3 extension<br />
+ */<br />
+ public boolean canParse(Content content)<br />
+ {<br />
+ MimeType contentType = content.getContentType();<br />
+ if (contentType != null && AUDIO_MPEG.match(contentType)) {<br />
+ return true;<br />
+ }<br />
+<br />
+ if (content.getURI() == null)<br />
+ {<br />
+ return false;<br />
+ }<br />
+<br />
+ // Obtain the path part of the URI<br />
+ String path = content.getURI().getPath();<br />
+ if (path == null) {<br />
+ return false;<br />
+ }<br />
+ assert path != null;<br />
+<br />
+ // We recognize a fixed extension<br />
+ return path.endsWith(".mp3");<br />
+ }<br />
+<br />
+}</p>
+
+<p>An analysis of the class is as follows:</p>
+
+<p class="indentcommandtext">package org.kowari.content.mp3;<br />
+<br />
+// Java 2 standard packages<br />
+import java.io.InputStream;<br />
+import java.net.URI;<br />
+import java.util.Map;<br />
+<br />
+// Java 2 enterprise packages<br />
+import javax.activation.MimeType;<br />
+import javax.activation.MimeTypeParseException;<br />
+<br />
+// Third party packages<br />
+import org.apache.log4j.Logger; // Apache Log4J<br />
+<br />
+// Local packages<br />
+import org.kowari.content.Content;<br />
+import org.kowari.content.ContentHandler;<br />
+import org.kowari.content.ContentHandlerException;<br />
+import org.kowari.resolver.spi.ResolverSession;<br />
+import org.kowari.resolver.spi.Statements;<br />
+import org.kowari.query.TuplesException;</p>
+
+<p class="indent">There are no specific requirements for the packaging of the implementation but it is recommended that related classes be kept in the same package for easier implementing. For the interface, you also need to import:</p>
+<ul><li><code>org.kowari.content.Content</code></li><li><code>org.kowari.content.ContentHandler</code></li><li><code>org.kowari.content.ContentHandlerException</code></li><li><code>org.kowari.resolver.spi.ResolverSession</code></li><li><code>org.kowari.resolver.spi.Statements</code></li></ul>
+<p class="indent">In most cases the <code>javax.activation.MimeType</code> class also needs to be imported to do proper mime type handling. Any supporting classes for the implementation should also be imported.</p>
+
+<p class="indentcommandtext">public class MP3ContentHandler implements ContentHandler {</p>
+
+<p class="indent">All content handlers must implement the <code>ContentHandler</code> interface unless they are extending an existing implementation, in which case the superclass should handle the implementation. Any extra interfaces or extensions are valid.</p>
+
+<p class="indentcommandtext">/**<br />
+ * The MIME type of RDF/XML.<br />
+ */<br />
+ private static final MimeType AUDIO_MPEG;<br />
+<br />
+ static {<br />
+ try {<br />
+ AUDIO_MPEG = new MimeType("audio", "mpeg");<br />
+ }<br />
+ catch (MimeTypeParseException e) {<br />
+ throw new ExceptionInInitializerError(e);<br />
+ }<br />
+ }</p>
+
+<p class="indent">Content handlers are written to handle specific content types and most often these have a mime type associated with them that can be used to determine if the handler is able to parse the content. Although not strictly necessary, it is preferable to set up the mime type using a static initialization block for the class, creating a variable that can be used during the <code>canParse()</code> method.</p>
+
+<p class="indentcommandtext"> /**<br />
+ * Parses the ID3 tags of the MP3 file pointed to by the content object which<br />
+ * are then converted to a statements object.<br />
+ *<br />
+ * @param content The actual content we are going to be parsing<br />
+ * @param resolverSession The session in which this resolver is being used<br />
+ *<br />
+ * @return The parsed statements object<br />
+ *<br />
+ * @throws ContentHandlerException<br />
+ */<br />
+ public Statements parse(Content content, ResolverSession resolverSession) throws<br />
+ ContentHandlerException {<br />
+<br />
+ // Container for our statements<br />
+ MP3Statements statements = null;<br />
+<br />
+ try {<br />
+<br />
+ // Attempt to create the MP3 statements<br />
+ statements = new MP3Statements(content, resolverSession);<br />
+ } catch (TuplesException tuplesException) {<br />
+<br />
+ throw new ContentHandlerException("Unable to create statements object from " +<br />
+ "content object: " + content.getURI().toString(),<br />
+ tuplesException);<br />
+ }<br />
+<br />
+ return statements;<br />
+ }</p>
+
+<p class="indent">The purpose of the <code>parse(Content, ResolverSession)</code> method is to convert the resource pointed to by the <code>Content</code> object into a series of triples inside a <code>Statements</code> object. This means there are two parts to consider, the parsing of the resource and the conversion of the results into statements. It is possible to perform both operations in the single method, but in the MP3 implementation, the content is parsed directly into the <code>Statements</code> object. The result is that you only need to create a <code>MP3Statements</code> object that handles the parsing and setting up of the statements. See the <a id="h3020" class="documentlinktemplate" title="Statements" href="/integration/statements.html">Creating the Statements section</a> for more information.</p>
+
+<p class="indentcommandtext"> /**<br />
+ * @return true if the file part of the URI has an<br />
+ * .mp3 extension<br />
+ */<br />
+ public boolean canParse(Content content)<br />
+ {<br />
+ MimeType contentType = content.getContentType();<br />
+ if (contentType != null && AUDIO_MPEG.match(contentType)) {<br />
+ return true;<br />
+ }<br />
+<br />
+ if (content.getURI() == null)<br />
+ {<br />
+ return false;<br />
+ }<br />
+<br />
+ // Obtain the path part of the URI<br />
+ String path = content.getURI().getPath();<br />
+ if (path == null) {<br />
+ return false;<br />
+ }<br />
+ assert path != null;<br />
+<br />
+ // We recognize a fixed extension<br />
+ return path.endsWith(".mp3");<br />
+ }</p>
+
+<p class="indent">Before a <code>Content</code> object is sent to the handler, a search is done through the list of registered handlers to find out which to use to parse it into statements. For the resolver to know which content handlers support which content, it uses the <code>canParse(Content)</code> method. If the method returns <code>true</code> then the content is passed to the <code>parse(Content, ResolverSession)</code> method of that handler. One of the first checks that should be made is whether the content is of the correct mime type. Sometimes the mime type is unavailable (for example, for a file protocol resolver) so you should also check the URI and extensions. If the content is supported by the handler then this method should return <code>true</code>, otherwise <code>false</code>.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/contenthandlersdev.html
===================================================================
--- trunk/docs/site/integration/contenthandlersdev.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/contenthandlersdev.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,69 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Developing Content Handlers</title>
+ <meta name="keywords" content="Handlers, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/resolverwrite.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/contenthandlers.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">In This Section</p>
+<p class="relateditem"><a href="/integration/contenthandlers.html">Content Handlers</a></p>
+<p class="relateditem"><a href="/integration/parsers.html">Parsers</a></p>
+<p class="relateditem"><a href="/integration/statements.html">Statements</a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/resolverhttpmp3.html">HTTP Resolver and MP3 Content Handler Tutorial</a></p>
+<p class="relateditem"><a href="/integration/resolverhttpmp3.html#o3182"></a></p>
+<p class="relateditem"><a href="/integration/resolverpre.html">Prerequisites</a></p>
+<p class="relateditem"><a href="/integration/resolveprot.html">Developing Protocol Resolvers</a></p>
+<p class="relateditem"><a href="/integration/compiling.html">Compiling with Ant</a></p>
+<p class="relateditem"><a href="/integration/integrate.html">Integrating into Mulgara</a></p>
+
+
+ -->
+
+
+
+<h3>Developing Content Handlers</h3>
+
+<p>There are three components that make up a content handler:</p>
+<ol><li>Content Handlers
+<p class="listcontinue">Perform the actual conversion of data in a file into RDF triples for the resolver to constrain.</p>
+</li><li>Parsers
+<p class="listcontinue">Converts data from the target file into RDF.</p>
+</li><li>Statements
+<p class="listcontinue">Hold and navigate the triples generated by the parser.</p>
+</li></ol>
+<p>The following sections outline how to create these components. The source files used for the content handler part of the tutorial are located in the <code>src/jar/content-mp3/java/</code> directory of your Kowari installation.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/includeTOC.inc
===================================================================
--- trunk/docs/site/integration/includeTOC.inc 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/includeTOC.inc 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,80 @@
+ <ul>
+ <li><a href="/integration/resolverhttpmp3.html">HTTP Resolver and MP3 Content Handler Tutorial</a></li>
+ <ul>
+ <li><a href="/integration/resolverpre.html">Prerequisites</a></li>
+ <li><a href="/integration/resolveprot.html">Developing Protocol Resolvers</a></li>
+ <ul>
+ <li><a href="/integration/resolverfactories.html">Factories</a></li>
+ <ul class="toc">
+ <li><a href="/integration/resolverfactories.html#o2692">Writing a Factory</a></li>
+ </ul>
+ <li><a href="/integration/resolverwrapper.html">Content Wrappers</a></li>
+ <ul class="toc">
+ <li><a href="/integration/resolverwrapper.html#o2700">Implementing the Interface</a></li>
+ </ul>
+ <li><a href="/integration/resolverwrite.html">Resolvers</a></li>
+ <ul class="toc">
+ <li><a href="/integration/resolverwrite.html#o2950">Writing a Resolver</a></li>
+ </ul>
+ </ul>
+ <li><a href="/integration/contenthandlersdev.html">Developing Content Handlers</a></li>
+ <ul>
+ <li><a href="/integration/contenthandlers.html">Content Handlers</a></li>
+ <ul class="toc">
+ <li><a href="/integration/contenthandlers.html#o2710">Configuration and Initialisation</a></li>
+ <li><a href="/integration/contenthandlers.html#o2711">Implementing the Interface</a></li>
+ </ul>
+ <li><a href="/integration/parsers.html">Parsers</a></li>
+ <ul class="toc">
+ <li><a href="/integration/parsers.html#o2704">Configuration and Initialisation</a></li>
+ <li><a href="/integration/parsers.html#o2705">Processing ID3 Tags into RDF</a></li>
+ <li><a href="/integration/parsers.html#o2706">Storing Data</a></li>
+ </ul>
+ <li><a href="/integration/statements.html">Statements</a></li>
+ <ul class="toc">
+ <li><a href="/integration/statements.html#o2952">Implementing the Interface</a></li>
+ </ul>
+ </ul>
+ <li><a href="/integration/compiling.html">Compiling with Ant</a></li>
+ <li><a href="/integration/integrate.html">Integrating into Mulgara</a></li>
+ </ul>
+ <li><a href="/integration/jena.html">Jena</a></li>
+ <ul class="toc">
+ <li><a href="/integration/jena.html#o3186">Creating Sessions</a></li>
+ <li><a href="/integration/jena.html#o3187">Available Jena Interfaces</a></li>
+ <li><a href="/integration/jena.html#o3188">Using the Jena Maker Interfaces</a></li>
+ <li><a href="/integration/jena.html#o949">Using Iterators</a></li>
+ <li><a href="/integration/jena.html#o950">Exceptions and Logging</a></li>
+ <li><a href="/integration/jena.html#o951">Threading</a></li>
+ <li><a href="/integration/jena.html#o952">Porting an Existing Jena Application</a></li>
+ </ul>
+ <li><a href="/integration/perl.html">Perl</a></li>
+ <li><a href="/integration/jsptutorial.html">JavaServer Pages Tag Library</a></li>
+ <ul class="toc">
+ <li><a href="/integration/jsptutorial.html#o991">Before you Begin</a></li>
+ <li><a href="/integration/jsptutorial.html#o993">Load the Sample Data</a></li>
+ <li><a href="/integration/jsptutorial.html#o994">Develop the JSPs</a></li>
+ <li><a href="/integration/jsptutorial.html#o995">Deploy the JSPs</a></li>
+ <li><a href="/integration/jsptutorial.html#o996">Open the Application</a></li>
+ </ul>
+ <li><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></li>
+ <ul>
+ <li><a href="/integration/jrdfprereq.html">Prerequisites</a></li>
+ <ul class="toc">
+ <li><a href="/integration/jrdfprereq.html#o2898">Obtaining a Session from a Mulgara Server</a></li>
+ <li><a href="/integration/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations</a></li>
+ </ul>
+ <li><a href="/integration/jrdfcreategraph.html">Creating the Graph</a></li>
+ <ul class="toc">
+ <li><a href="/integration/jrdfcreategraph.html#o2901">JRDF Graph (Memory Graph)</a></li>
+ <li><a href="/integration/jrdfcreategraph.html#o3189">Server-side JRDF Graph (Server Graph)</a></li>
+ <li><a href="/integration/jrdfcreategraph.html#o2902">Server Backed JRDF Graph (Client Graph)</a></li>
+ <li><a href="/integration/jrdfcreategraph.html#o2903">Read Only iTQL Result JRDF Graph (iTQL Graph)</a></li>
+ </ul>
+ <li><a href="/integration/jrdfcreatenodes.html">Creating Nodes and Triples</a></li>
+ <li><a href="/integration/jrdfaddtriples.html">Adding Triples to the Graph</a></li>
+ <li><a href="/integration/searchgraph.html">Searching the Graph</a></li>
+ <li><a href="/integration/jrdfreify.html">Reify Triples</a></li>
+ <li><a href="/integration/jrdfremove.html">Removing Triples from the Graph</a></li>
+ </ul>
+ </ul>
Added: trunk/docs/site/integration/index.html
===================================================================
--- trunk/docs/site/integration/index.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/index.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,55 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Integration Tutorials</title>
+ <meta name="keywords" content="Integration, Tutorials, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/system/jrdfexamples.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/resolverhttpmp3.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+ -->
+
+
+
+
+<h1>Integration Tutorials</h1>
+
+<p>The following sections are a series of tutorials, using different APIs, on integrating your applications with Mulgara.</p>
+
+
+<p class="relatedheading">In This Section</p>
+<p class="relateditem"><a href="/integration/resolverhttpmp3.html">HTTP Resolver and MP3 Content Handler Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jena.html">Jena</a></p>
+<p class="relateditem"><a href="/integration/perl.html">Perl</a></p>
+<p class="relateditem"><a href="/integration/jsptutorial.html">JavaServer Pages Tag Library</a></p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
+
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/integrate.html
===================================================================
--- trunk/docs/site/integration/integrate.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/integrate.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,74 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Integrating into Mulgara</title>
+ <meta name="keywords" content="Integrating, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/compiling.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/jena.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/resolverhttpmp3.html">HTTP Resolver and MP3 Content Handler Tutorial</a></p>
+<p class="relateditem"><a href="/integration/resolverhttpmp3.html#o3182"></a></p>
+<p class="relateditem"><a href="/integration/resolverpre.html">Prerequisites</a></p>
+<p class="relateditem"><a href="/integration/resolveprot.html">Developing Protocol Resolvers</a></p>
+<p class="relateditem"><a href="/integration/contenthandlersdev.html">Developing Content Handlers</a></p>
+<p class="relateditem"><a href="/integration/compiling.html">Compiling with Ant</a></p>
+
+
+
+ -->
+
+
+
+
+<h3>Integrating into Mulgara</h3>
+
+<p>Since the resolver and content handler jars are external, it is difficult to integrate them into the Mulgara jar. Therefore they need to be added to the CLASSPATH environment variable to be accessible when Mulgara runs.</p>
+
+<p>For systems running the Windows<sup>®</sup> operating system, set the <code>classpath</code> as follows:</p>
+
+<p class="commandtext">set CLASSPATH=%CLASSPATH%;<Full jar path>\myResolver.jar;<Full jar path>\myHandler.jar</p>
+
+<p>Where <code>myResolver.jar</code> and <code>myHandler.jar</code> are the names of your compiled jars and <code><Full jar path></code> is their fully qualified path (for example, <code>C:\myResolvers</code>).</p>
+
+<p>For systems running a Linux<sup>®</sup> or UNIX<sup>®</sup> operating system, set the <code>classpath</code> as follows:</p>
+
+<p class="commandtext">export CLASSPATH=$CLASSPATH:{Full jar path}/myResolver.jar:{Full jar path}/myHandler.jar</p>
+
+<p>Both the HTTP resolver and MP3 content handler are already packaged in Mulgara so doing this with the jars created by the tutorial have no effect. They are for learning purposes only.</p>
+
+<p>In addition to adding the jars to the <code>classpath</code>, the server also needs to know about the new resolvers and content handlers so it can use them when required. These are stored in the <code>mulgara-config.xml</code> file (see the <a id="h3021" class="documentlinktemplate" title="Mulgara Configuration File" href="/overview/install.html#o402">Mulgara Configuration File section</a>).</p>
+
+<p>To include your resolver or handler in the Mulgara server, use the following steps:</p>
+<ol><li>In the <code>mulgara-config.xml</code> file, find the <code><TripleStoreImplementation></code> tag. In this section there may already be some configured resolvers and handlers. The order is not important, so find a suitable place to insert your new resolver or handler.</li><li>For resolvers, add a tag <code><ResolverFactoryClass>{class name}</ResolverFactoryClass></code> where <code>{class name}</code> is the full class name of the resolver's factory class. For example, <code>org.mulgara.resolver.http.HttpResolverFactory</code></li><li>For content handlers, add a tag <code><ContentHandlerClass>{class name}</ContentHandlerClass></code> where <code>{class name}</code> is the full class name of the content handler's implementation class. For example, <code>org.mulgara.content.mp3.MP3ContentHandler</code></li></ol>
+<p>The MP3 content handler and HTTP resolver are already configured as part of Mulgara and should not be added again. They are for learning purposes only.</p>
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/jena.html
===================================================================
--- trunk/docs/site/integration/jena.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/jena.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,309 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Jena</title>
+ <meta name="keywords" content="Jena, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/integration/jena.html#o3186">Sessions</a> |
+ <a href="/integration/jena.html#o3187">Interfaces</a> |
+ <a href="/integration/jena.html#o3188">Jena Maker</a> |
+ <a href="/integration/jena.html#o949">Iterators</a> |
+ <a href="/integration/jena.html#o950">Exceptions and Logging</a> |
+ <a href="/integration/jena.html#o951">Threading</a> |
+ <a href="/integration/jena.html#o952">Porting</a>
+
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/integrate.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/perl.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/index.html">Integration Tutorials</a></p>
+<p class="relateditem"><a href="/integration/resolverhttpmp3.html">HTTP Resolver and MP3 Content Handler Tutorial</a></p>
+<p class="relateditem"><a href="/integration/perl.html">Perl</a></p>
+<p class="relateditem"><a href="/integration/jsptutorial.html">JavaServer Pages Tag Library</a></p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
+
+ -->
+
+
+
+
+<h2>Jena</h2>
+
+<p>Jena is a Java<sup>TM</sup> API that is commonly used to develop applications using RDF. This tutorial describes any changes or modifications to existing Jena code that are required for it to use Mulgara.</p>
+
+<div class="anchor"><a name="o3186"> </a></div>
+<h3>Creating Sessions</h3>
+
+<p>The Mulgara server can be accessed using the the Jena API using either a local connection (in the same Java Virtual Machine (JVM)) or via a client/server interface.</p>
+
+<p>The local connection provides the ability to create a new server or start an existing one and access it through the Jena API. The client/server interface connects to an existing server using RMI, if it exists, or if this fails, falls back to creating a new local server. Falling back to local server does not start the RMI registry and other external clients cannot access it unless started manually.</p>
+
+<p>The main APIs in Jena are the <code>Model</code> and <code>Graph</code> interfaces. The Mulgara server has its own implementation of these. To use these APIs you must first have a <code>JenaSession</code>. A <code>JenaSession</code> first requires a <code>SessionFactory</code>. To construct a new <code>SessionFactory</code> the URI of the server is required as well as an optional boolean parameter indicating whether the server is remote or not. If this boolean parameter is not provided, the server is assumed to be local (in the same JVM). For example:</p>
+
+<p class="commandtext">// Create the host name<br />
+String hostname = InetAddress.getLocalHost().getCanonicalHostName();<br />
+<br />
+// Create the URI of the server<br />
+serverURI = new URI("rmi", hostname, "/" + SERVER_NAME, null);<br />
+<br />
+// Create a new session factory, ensure that it's local<br />
+SessionFactory sessionFactory = SessionFactoryFinder.newSessionFactory(serverURI, false);<br />
+<br />
+// Get a local Jena session<br />
+LocalJenaSession session = (LocalJenaSession) sessionFactory.newJenaSession();</p>
+
+<p>If a local server is created, the server configuration file is used to determine which directory to place the server's files in. See the <a id="h3021" class="documentlinktemplate" title="Mulgara Configuration File" href="/overview/install.html#o402">Mulgara Configuration File section</a> in the Administrator Guide for more information.</p>
+
+<p>If a remote Session Factory is used, then the session can only be cast to a <code>JenaSession</code>. For example:</p>
+
+<p class="commandtext">// Create a new remote session factory<br />
+SessionFactory sessionFactory = SessionFactoryFinder.newSessionFactory(serverURI, true);<br />
+<br />
+// Get a local Jena<br />
+JenaSession session = (JenaSession) sessionFactory.newJenaSession();</p>
+<div class="anchor"><a name="o3187"> </a></div>
+<h3>Available Jena Interfaces</h3>
+
+<p>The type of session determines which Jena interfaces are available. The client Jena interfaces consist of <code>KModel</code> and <code>KGraph</code>. The server side Jena interfaces are much larger and include Jena interfaces such as <code>GraphMaker</code>, <code>ModelMaker</code>, <code>BulkUpdateHandler</code> and the interfaces used in querying, reification, and transactions.</p>
+<div class="anchor"><a name="o3188"> </a></div>
+<h3>Using the Jena Maker Interfaces</h3>
+
+<p>Jena defines two interfaces responsible for the creation of new models and graphs. Mulgara has its own implementation of these interfaces: <code>ModelMulgaraMaker</code> and <code>GraphMulgaraMaker</code>.</p>
+
+<p>Once the session is successfully created you can construct a <code>GraphMulgaraMaker</code>, then a <code>ModelMulgaraMaker</code> and finally create a new model, as follows:</p>
+
+<p class="commandtext">GraphMulgaraMaker graphMaker = new GraphMulgaraMaker(session, serverURI, ReificationStyle.Minimal);<br />
+ModelMulgaraMaker modelMaker = new ModelMulgaraMaker(graphMaker);<br />
+Model model = modelMaker.createModel("camera");</p>
+
+<p>The above example creates a new model called <code>rmi://mysite.com/server1#camera</code>, where <code>mysite.com</code> is the fully qualified name of the machine Mulgara is running on.</p>
+
+<p>If code requires an ontology model, then use the following example:</p>
+
+<p class="commandtext">// Create a new model with the default specification (OWL_MEM)<br />
+OntModel newModel = ModelFactory.createOntologyModel();</p>
+
+<p>Assuming that the database and <code>ModelMulgaraMaker</code> are created in a method called <code>createMaker</code>, then the code becomes:</p>
+
+<p class="commandtext">// Get ModelMulgaraMaker<br />
+ModelMaker maker = createMaker(ReificationStyle.Minimal);<br />
+<br />
+// Specify ontology model type (OWL_MEM)<br />
+OntModelSpec spec = new OntModelSpec(OntModelSpec.OWL_MEM);<br />
+spec.setModelMaker(maker);<br />
+<br />
+// Create a new base model.<br />
+Model baseModel = maker.createModel();<br />
+<br />
+// Create a new ontology model.<br />
+OntModel m = ModelFactory.createOntologyModel(spec, baseModel);</p>
+
+<p>The <code>GraphMulgaraMaker</code> interface defines the <code>removeAll()</code> and <code>removeGraph(String)</code> methods. These remove all model entries or an individual model's entry from the server's system model. This means that the models are no longer accessible and the data they were holding is lost.</p>
+
+<p>Models and Graphs must be closed after use by calling <code>close()</code>. This ensures that the files and other resources used are closed correctly. If the objects are not closed, because of a hardware or other unexpected termination of the program, no data is lost and the database cleans up the file data on next start up.</p>
+
+<p>The database and session that are created to create the Jena object implementations must also have <code>close()</code> called on them in order to correctly clean up resources that are being used.</p>
+
+<p>Two calls are available to shutdown a database cleanly. The first, <code>close()</code>, just stops the database. The second, <code>delete()</code>, stops the database and removes all files associated with it. This permanently erases the database from the disk.</p>
+<div class="anchor"><a name="o949"> </a></div>
+<h3>Using Iterators</h3>
+
+<p>The standard base iterator class for Jena is <code>ClosableIterator</code>. This is extended by other iterators such as <code>ExtendedIterator</code>, <code>StmtIterator</code> and <code>TripleIterator</code>. The default iterator implementation used in this Jena implementation is <code>TuplesClosableIteratorImpl</code>. It is backed by a Tuples object, which must be closed. Failure to close an iterator could lead to the system eventually running out of files and other resources.</p>
+
+<p>Most Jena applications do not call <code>close()</code> on iterators. Most, but not all, of the standard Jena code does call <code>close()</code> on iterators. If you are unable to change the behavior of the code, objects such as <code>FileTuples</code>, log warning messages indicating they were not properly closed. To support iterators not being closed, functionality has been added into <code>close()</code> on <code>GraphMulgaraMaker</code>. It tracks the creation of iterators and closes any un-closed iterators. Best practice, however, is to ensure that iterators are closed as soon as possible.</p>
+
+<p>In existing Jena code, calling <code>listStatements</code> usually takes the following form:</p>
+
+<p class="commandtext">StmtIterator sti = model.listStatements();<br />
+while (sti.hasNext()) {<br />
+ Statement st = (Statement) sti.next();<br />
+ ...<br />
+}</p>
+
+<p>The usual way of ensuring that iterators are always closed is as follows:</p>
+
+<p class="commandtext">StmtIterator sti = null;<br />
+<br />
+try {<br />
+ sti = model.listStatements();<br />
+ while (sti.hasNext()) {<br />
+ Statement st = (Statement) sti.next();<br />
+ ...<br />
+ }<br />
+}<br />
+finally {<br />
+ if (sti != null) {<br />
+ sti.close();<br />
+ }<br />
+}</p>
+
+<p>If an iterator is to be reused you should also set the iterator to null within the <code>finally</code> block. For example:</p>
+
+<p class="commandtext">ExtendedIterator iter = null;<br />
+<br />
+// First use of iterator.<br />
+try {<br />
+ ...<br />
+ iter = model.listClasses();<br />
+ ...<br />
+}<br />
+finally {<br />
+ if (iter != null) {<br />
+ iter.close();<br />
+ iter = null;<br />
+ }<br />
+}<br />
+<br />
+// Next use of the same variable.<br />
+try {<br />
+ ...<br />
+ iter = model.listOntProperties();<br />
+ ...<br />
+}<br />
+finally {<br />
+ if (iter != null) {<br />
+ iter.close();<br />
+ }<br />
+}</p>
+<div class="anchor"><a name="o950"> </a></div>
+<h3>Exceptions and Logging</h3>
+
+<p>The Jena API uses unchecked or runtime exceptions. The exception hierarchy begins with <code>JenaException,</code> which extends <code>RuntimeException</code> and there are specific exceptions for various parts of the Jena API.</p>
+
+<p>Mulgara follows the expected Jena semantics on exceptions. For example, <code>GraphMulgaraMaker</code> generates an <code>AddedDeniedException</code> exception if an <code>add(Triple)</code> method fails. However, most of the exceptions generated by the underlying store layers do not have equivalent Jena exceptions. For example, the construction of <code>GraphMulgaraMaker</code> generates a <code>JenaException</code> if any of the following occurs:</p>
+<ul><li>The given URI is invalid</li><li>The server is not found</li><li>Acquiring a session failed</li><li>The statement store failed to initialize</li></ul>
+<p>Currently, no new exceptions are created to wrap the semantics of these cases. Only <code>JenaException</code> is used.</p>
+
+<p>In Mulgara, whenever an exception occurs within the store layer it is logged as a warning or error and then rethrown, if appropriate, as a runtime exception. Some interfaces, such as <code>ClosableIterator</code>, are not expected to generate an exception so the TKS implementation, <code>TuplesClosableIteratorImpl</code>, simply logs the exception and continues. If an exception occurs, it returns null when calling <code>next()</code> and false when calling <code>hasNext()</code>. This provides the maximum compatibility with existing Jena implementations.</p>
+<div class="anchor"><a name="o951"> </a></div>
+<h3>Threading</h3>
+
+<p>The implementation of Jena's Graph is tied to the implementation of the underlying store's session. Each session only supports a one-to-one mapping of threads to instances. This means that one and only one thread should access an instance of Graph.</p>
+<div class="anchor"><a name="o952"> </a></div>
+<h3>Porting an Existing Jena Application</h3>
+
+<p>The following example goes through the steps to modify an application called <a class="internetlinktemplate" title="" href="http://www.mindswap.org/2004/SWOOP/">SWOOP (Semantic Web Ontology Overview and Perusal)</a> and present it using the Mulgara implementation of the Jena APIs. The modified source (Swoop-src.zip) is also provided for you in the <code>Resources</code> directory of your Mulgara installation.</p>
+
+<p>SWOOP has two instances where it creates a new model. Both require a way to create <code>ModelMulgaraMaker</code>. This is implemented with the static <code>createModelMaker</code> added to <code>SwoopCode.java</code>:</p>
+
+<p class="commandtext">...<br />
+// Static definition of the session<br />
+static LocalJenaSession session = null;<br />
+...<br />
+<br />
+public static ModelMaker createMaker() {<br />
+boolean exceptionOccurred = true;<br />
+try {<br />
+ String hostname = InetAddress.getLocalHost().getCanonicalHostName();<br />
+ URI serverURI = new URI("rmi", hostname, "/server1", null);<br />
+<br />
+ if (session == null) {<br />
+ SessionFactory sessionFactory = SessionFactoryFinder.newSessionFactory(serverURI, false);<br />
+ session = (LocalJenaSession) sessionFactory.newJenaSession();<br />
+ }<br />
+<br />
+ exceptionOccurred = false;<br />
+ return new ModelMulgaraMaker(new GraphMulgaraMaker(session, serverURI, ReificationStyle.Convenient));<br />
+}<br />
+catch (Exception e) {<br />
+<br />
+ // You wouldn't normally do this - just for demonstration<br />
+ // purposes<br />
+ e.printStackTrace();<br />
+ return null;<br />
+}<br />
+finally {<br />
+ if ((exceptionOccurred) && (session != null)) {<br />
+ session.close();<br />
+ }<br />
+}</p>
+
+<p>If successful, this method creates a <code>ModelMulgaraMaker,</code> otherwise it returns null and closes the database if required. The main difference between this and most other Jena implementations is the requirement to set aside a directory to persist the triples in the store. You need to ensure that the current user has exclusive access to the creation of the directory and to the files underneath. Multiple access to the same directory and set of files by separate Java instances is not supported.</p>
+
+<p>Previously, the SWOOP code initialized the <code>OntModel</code> with the <code>no-args</code> constructor:</p>
+
+<p class="commandtext">OntModel newModel = ModelFactory.createOntologyModel();</p>
+
+<p>Following the example given in the Jena documentation, you construct a persistent ontology using the following code:</p>
+
+<p class="commandtext">// Default OWL Model Specification<br />
+OntModelSpec spec = new OntModelSpec(OntModelSpec.OWL_MEM);<br />
+<br />
+// Get ModelMaker - assume doesn't return null.<br />
+ModelMaker maker = createMaker();<br />
+spec.setModelMaker(maker);<br />
+<br />
+// Create a new base model.<br />
+Model baseModel = maker.createModel();<br />
+OntModel newModel = ModelFactory.createOntologyModel(spec, baseModel);</p>
+
+<p>Once the model is created, the SWOOP code lists the statements. Following the standard for iterators, transforms the coding in the following lines of <code>SwoopCode.java</code> to become:</p>
+
+<p class="commandtext">StmtIterator sti = null; <br />
+try {<br />
+ sti = model.listStatements();<br />
+ while (sti.hasNext()) {<br />
+ Statement st = (Statement) sti.next();<br />
+ //System.out.println(st.toString());<br />
+ boolean removeStatement = false;<br />
+ try {<br />
+ if (st.getSubject().getURI().startsWith(RDF)) removeStatement = true;<br />
+ if (st.getSubject().getURI().startsWith(RDFS)) removeStatement = true;<br />
+ if (st.getSubject().getURI().startsWith(OWL)) removeStatement = true;<br />
+ }<br />
+ catch (NullPointerException e) { <br />
+ }<br />
+<br />
+ if (!removeStatement) newModel.add(st);<br />
+ }<br />
+}<br />
+finally { <br />
+ if (sti != null) { <br />
+ sti.close();<br />
+ }<br />
+}</p>
+
+<p>As noted in the previous section, this ensures that if an iterator is created, it is always closed even if an exception or other error occurs. Unclosed iterators do not generally cause a problem under normal usage. Under heavy load however, when the garbage collector does not collect the resources quickly enough, you can run out of resources.</p>
+
+<p>Likewise, changes are made to access the static <code>createMaker()</code> from <code>SwoopFrame.java</code> in the <code>addOntology()</code> method:</p>
+
+<p class="commandtext">OntModelSpec spec = new OntModelSpec(OntModelSpec.OWL_MEM);<br />
+ModelMaker maker = SwoopCode.createMaker();<br />
+spec.setModelMaker(maker);<br />
+<br />
+// Create a new base model.<br />
+Model baseModel = maker.createModel();<br />
+OntModel newOntologyModel = ModelFactory.createOntologyModel(spec, baseModel);</p>
+
+<p>The rest of the changes require modifying the use of iterators. They must always be closable iterators when working from the model and Mulgara ensures that they are closed.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/jrdfaddtriples.html
===================================================================
--- trunk/docs/site/integration/jrdfaddtriples.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/jrdfaddtriples.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,68 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Adding Triples to the Graph</title>
+ <meta name="keywords" content="Triples, Graph, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/jrdfcreatenodes.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/searchgraph.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html">Prerequisites</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2898">Obtaining a Session from a Mulgara Server</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations</a></p>
+<p class="relateditem"><a href="/integration/jrdfcreategraph.html">Creating the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfcreatenodes.html">Creating Nodes and Triples</a></p>
+<p class="relateditem"><a href="/integration/searchgraph.html">Searching the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfreify.html">Reify Triples</a></p>
+<p class="relateditem"><a href="/integration/jrdfremove.html">Removing Triples from the Graph</a></p>
+
+ -->
+
+
+
+
+<h3>Adding Triples to the Graph</h3>
+
+<p>Triples are inserted a graph using the graph's <code>add(Triple triple)</code> method.</p>
+
+<p class="commandtext">graph.add(addressStatement);<br />
+graph.add(streetStatement);<br />
+graph.add(cityStatement);<br />
+graph.add(stateStatement);<br />
+graph.add(postCodeStatement);</p>
+
+<p>The graph now contains the following statements (where <code>_blankNode123</code> represents a blank node instance):</p>
+
+<p class="commandtext">http://example.org/staffid#85740 http://example.org/terms#address _blankNode123<br />
+_blankNode123 http://example.org/terms#street "1501 Grant Avenue"<br />
+_blankNode123 http://example.org/terms#city "Bedford"<br />
+_blankNode123 http://example.org/terms#state "Massachusetts"<br />
+_blankNode123 http://example.org/terms#postalCode "01730"</p>
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/jrdfcreategraph.html
===================================================================
--- trunk/docs/site/integration/jrdfcreategraph.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/jrdfcreategraph.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,123 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Creating the Graph</title>
+ <meta name="keywords" content="Graph, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/integration/jrdfcreategraph.html#o2901">Memory Graph</a> |
+ <a href="/integration/jrdfcreategraph.html#o3189">Server Graph</a> |
+ <a href="/integration/jrdfcreategraph.html#o2902">Client Graph</a> |
+ <a href="/integration/jrdfcreategraph.html#o2903">iTQL Graph</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/jrdfprereq.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/jrdfcreatenodes.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html">Prerequisites</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2898">Obtaining a Session from a Mulgara Server</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations</a></p>
+<p class="relateditem"><a href="/integration/jrdfcreatenodes.html">Creating Nodes and Triples</a></p>
+<p class="relateditem"><a href="/integration/jrdfaddtriples.html">Adding Triples to the Graph</a></p>
+<p class="relateditem"><a href="/integration/searchgraph.html">Searching the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfreify.html">Reify Triples</a></p>
+<p class="relateditem"><a href="/integration/jrdfremove.html">Removing Triples from the Graph</a></p>
+
+ -->
+
+
+
+
+<h3>Creating the Graph</h3>
+
+<p>The <a id="h3190" class="documentlinktemplate" title="Comparison of JRDF Graph Implementations" href="/integration/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations section</a> outlines the advantages and disadvantages of the different implementation options. Choose the one that is most suitable for your requirements.</p>
+
+<p>You can create more than one graph and use them together. For example, you might use an iTQL graph to retrieve results from a query, load the contents into a memory graph for efficient presentation and editing, and then persist the edited statements using a client graph.</p>
+
+<div class="anchor"><a name="o2901"> </a></div>
+<h4>JRDF Graph (Memory Graph)</h4>
+
+<p>The following code creates a memory graph:</p>
+
+<p class="commandtext">Graph graph = new GraphImpl();</p>
+<div class="anchor"><a name="o3189"> </a></div>
+<h4>Server-side JRDF Graph (Server Graph)</h4>
+
+<p>You need to obtain a session for your Mulgara server before you can create a server graph. When obtaining the session, use <code>SessionFactoryFinder.newSessionFactory(serverURI, false)</code> to indicate that the server is running in the same JVM (that is, it is running locally).</p>
+
+<p>The server graph is created using a <code>LocalJRDFSession</code>. See the Obtaining a Session from the TKS Server section for more information on how to obtain a <code>LocalJRDFSession</code>.</p>
+
+<p>After obtaining a local session, the following code creates a server graph:</p>
+
+<p class="commandtext">//create a new Model<br />
+URI modelURI = new URI("rmi://mysite.com/server1#exampleGraph");<br />
+URI modelType = new URI("http://mulgara.org/mulgara#Model");<br />
+session.createModel(modelURI, modelType);<br />
+<br />
+//create a JRDF Graph for the model<br />
+Graph graph = new JRDFGraph(session, modelURI);</p>
+<div class="anchor"><a name="o2902"> </a></div>
+<h4>Server Backed JRDF Graph (Client Graph)</h4>
+
+<p>You need to obtain a session for your Mulgara server before you can create a client graph. When obtaining the session, use <code>SessionFactoryFinder.newSessionFactory(serverURI, true)</code> to indicate that the server is running remotely.</p>
+
+<p>The Client Graph is created using a <code>JRDFSession</code>. See the Obtaining a Session from the Mulgara Server section for more information on how to obtain a <code>JRDFSession</code>.</p>
+
+<p>After obtaining a session, the following code creates a client graph:</p>
+
+<p class="commandtext">//create a new Model<br />
+URI modelURI = new URI("rmi://mysite.com/server1#exampleGraph");<br />
+URI modelType = new URI("http://mulgara.org/mulgara#Model");<br />
+session.createModel(modelURI, modelType);<br />
+<br />
+//create a JRDF Graph for the model<br />
+Graph graph = AbstractGraphFactory.createGraph(modelURI, session);</p>
+
+<p>The code <code>session.createModel(modelURI, modelType);</code> creates a new model if the model does not exist. If the model already exists, this line is not required.</p>
+<div class="anchor"><a name="o2903"> </a></div>
+<h4>Read Only iTQL Result JRDF Graph (iTQL Graph)</h4>
+
+<p>You need to obtain a session for your Mulgara server before you can create an iTQL graph. After obtaining a session, the following code creates an iTQL graph.</p>
+
+<p class="commandtext">//create the query<br />
+String queryText = "select $s $p $o from <rmi://mysite.com/server1#testModel> where $s $p $o ; ";<br />
+ItqlInterpreter interpreter = new ItqlInterpreter(new HashMap());<br />
+Query query = interpreter.parse(queryText);<br />
+<br />
+//execute the query<br />
+Answer queryResult = session.query(query);<br />
+<br />
+//create a JRDF Graph<br />
+Graph graph = AbstractGraphFactory.createGraph(queryResult);</p>
+
+<p>The iTQL query <code>select $s $p $o from <rmi://mysite.com/server1#testModel> where $s $p $o;</code> returns all statements from the model.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/jrdfcreatenodes.html
===================================================================
--- trunk/docs/site/integration/jrdfcreatenodes.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/jrdfcreatenodes.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,87 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Creating Nodes and Triples</title>
+ <meta name="keywords" content="Nodes, Triples, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/jrdfcreategraph.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/jrdfaddtriples.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html">Prerequisites</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2898">Obtaining a Session from a Mulgara Server</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations</a></p>
+<p class="relateditem"><a href="/integration/jrdfcreategraph.html">Creating the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfaddtriples.html">Adding Triples to the Graph</a></p>
+<p class="relateditem"><a href="/integration/searchgraph.html">Searching the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfreify.html">Reify Triples</a></p>
+<p class="relateditem"><a href="/integration/jrdfremove.html">Removing Triples from the Graph</a></p>
+
+
+ -->
+
+
+
+
+<h3>Creating Nodes and Triples</h3>
+
+<p>Nodes and tiples are created using a <code>GraphElementFactory</code> that is obtained from a JRDF graph using the graph's <code>getElementFactory()</code> method. The following code creates example nodes and triples:</p>
+
+<p class="commandtext">//get the Factory<br />
+GraphElementFactory elementFactory = graph.getElementFactory();<br />
+<br />
+//create resources<br />
+URIReference person = elementFactory.createResource(new URI("http://example.org/staffid#85740"));<br />
+BlankNode address = elementFactory.createResource();<br />
+<br />
+//create properties<br />
+URIReference hasAddress = elementFactory.createResource(new URI("http://example.org/terms#address"));<br />
+URIReference hasStreet = elementFactory.createResource(new URI("http://example.org/terms#street"));<br />
+URIReference hasCity = elementFactory.createResource(new URI("http://example.org/terms#city"));<br />
+URIReference hasState = elementFactory.createResource(new URI("http://example.org/terms#state"));<br />
+URIReference hasPostCode = elementFactory.createResource<br />
+ (new URI("http://example.org/terms#postalCode"));<br />
+<br />
+//create values<br />
+Literal street = elementFactory.createLiteral("1501 Grant Avenue");<br />
+Literal city = elementFactory.createLiteral("Bedford");<br />
+Literal state = elementFactory.createLiteral("Massachusetts");<br />
+Literal postCode = elementFactory.createLiteral("01730");<br />
+<br />
+//create statements<br />
+Triple addressStatement = elementFactory.createTriple(person, hasAddress, address);<br />
+Triple streetStatement = elementFactory.createTriple(address, hasStreet, street);<br />
+Triple cityStatement = elementFactory.createTriple(address, hasCity, city);<br />
+Triple stateStatement = elementFactory.createTriple(address, hasState, state);<br />
+Triple postCodeStatement = elementFactory.createTriple(address, hasPostCode, postCode);</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/jrdfprereq.html
===================================================================
--- trunk/docs/site/integration/jrdfprereq.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/jrdfprereq.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,293 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Prerequisites</title>
+ <meta name="keywords" content="Prerequisites, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/jrdftutorial.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/jrdfcreategraph.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2898">Obtaining a Session from a Mulgara Server</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations</a></p>
+<p class="relateditem"><a href="/integration/jrdfcreategraph.html">Creating the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfcreatenodes.html">Creating Nodes and Triples</a></p>
+<p class="relateditem"><a href="/integration/jrdfaddtriples.html">Adding Triples to the Graph</a></p>
+<p class="relateditem"><a href="/integration/searchgraph.html">Searching the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfreify.html">Reify Triples</a></p>
+<p class="relateditem"><a href="/integration/jrdfremove.html">Removing Triples from the Graph</a></p>
+
+ -->
+
+
+
+
+<h3>Prerequisites</h3>
+
+<p>The following prerequisites should be met before this JRDF tutorial can be run:</p>
+<ul><li>Java<sup>TM</sup> software, version 1.4 or higher. You can check the version you have installed by typing at a command line:
+<p class="listcontinuecommandtext">java -version</p>
+
+<p class="listcontinue">Something similar to the following should display:</p>
+
+<p class="listcontinuecommandtext">java version "1.4.2_04"<br />
+Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)<br />
+Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)</p>
+
+<p class="listcontinue">If the above does not display, add <code><JAVA_HOME>/bin</code>, where <code><JAVA_HOME></code> is the location where J2SE<sup>TM</sup> is installed, to your <code>PATH </code>(in the appropriate way for your shell).</p>
+
+<p class="listcontinue">For more information on installing and running Java software, read the <a class="jumptemplate" title="" href="http://java.sun.com/j2se/1.4.2/install.html">J2SE 1.4 Installation guide</a>.</p>
+</li><li>A valid installation of Mulgara. For information on installing Mulgara, see the relevant sections in the Mulgara documentation.</li><li>Basic Java programming experience.</li></ul>
+<div class="anchor"><a name="o2898"> </a></div>
+<h3>Obtaining a Session from a Mulgara Server</h3>
+
+<p>The Mulgara server can be accessed using the the JRDF API using either a local connection (in the same Java Virtual Machine (JVM)) or via a client/server interface.</p>
+
+<p>The local connection provides the ability to create a new server or start an existing one and access it through the JRDF API. The client/server interface connects to an existing server using RMI, if it exists, or failing this, falls back to creating a new local server. Falling back to local server does not start the RMI registry and other external clients cannot access it unless started manually.</p>
+
+<p>The Mulgara server has a local implementation of the JRDF API that can be created using a <code>LocalJRDFSession</code> and a remote implementation that uses a <code>JRDFSession</code>. In order to use these APIs, you must first have the corresponding Session. These Sessions are obtained via a <code>SessionFactory</code>. To construct a new <code>SessionFactory</code>, the URI of the server is required as well as an optional boolean parameter indicating whether the server is remote or not. If this boolean parameter is not provided, the server is assumed to be local (in the same JVM). For example:</p>
+
+<p class="commandtext">// Create the host name<br />
+String hostname = InetAddress.getLocalHost().getCanonicalHostName();<br />
+<br />
+// Create the URI of the server<br />
+serverURI = new URI("rmi", hostname, "/" + SERVER_NAME, null);<br />
+<br />
+// Create a new session factory, ensure that it's local<br />
+SessionFactory sessionFactory = SessionFactoryFinder.newSessionFactory(serverURI, false);<br />
+<br />
+// Get a local JRDF Session (local)<br />
+LocalJRDFSession session = (LocalJRDFSession) sessionFactory.newJRDFSession();</p>
+
+<p>If a local server is created, the server configuration file is used to determine which directory to place the server's files in.</p>
+
+<p>If a remote <code>SessionFactory</code> is used, then the session can only be cast to a <code>JRDFSession</code>. For example:</p>
+
+<p class="commandtext">// Create a new remote session factory<br />
+SessionFactory sessionFactory = SessionFactoryFinder.newSessionFactory(serverURI, true);<br />
+<br />
+// Get a Remote JRDF Session (client/server)<br />
+JRDFSession session = (JRDFSession) sessionFactory.newJRDFSession();</p>
+<div class="anchor"><a name="o2899"> </a></div>
+<h3>Comparison of JRDF Graph Implementations</h3>
+
+<p>The following table outlines the advantages and disadvantages of the different JRDF graph implementations.</p>
+<table width="516" cellpadding="2" cellspacing="0" border="0" style="border-collapse:collapse">
+<tr>
+<td width="258" height="0"></td>
+<td width="258" height="0"></td>
+</tr>
+<tr align="left" valign="top">
+<td colspan="2" width="516">
+<p class="tableheading">Memory Graph</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p class="tableheading">Advantages</p>
+</td>
+<td width="258">
+<p class="tableheading">Disadvantages</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p>Very fast</p>
+</td>
+<td width="258">
+<p>Not persisted to disk</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p>Small footprint</p>
+</td>
+<td width="258">
+<p>Not scalable</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p> </p>
+</td>
+<td width="258">
+<p> </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td colspan="2" width="516">
+<p class="tableheading">Server Graph</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p class="tableheading">Advantages</p>
+</td>
+<td width="258">
+<p class="tableheading">Disadvantages</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p>No network overhead</p>
+</td>
+<td width="258">
+<p>Slower than memory graph, but faster than client graph</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p>Persistent datastore</p>
+</td>
+<td width="258">
+<p>Must be run in the same JVM as the Mulgara server</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p>Scalable</p>
+</td>
+<td width="258">
+<p> </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p> </p>
+</td>
+<td width="258">
+<p> </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td colspan="2" width="516">
+<p class="tableheading">Client Graph</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p class="tableheading">Advantages</p>
+</td>
+<td width="258">
+<p class="tableheading">Disadvantages</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p>Client/server architecture means client can be on different machine to server</p>
+</td>
+<td width="258">
+<p>Slower than memory graph</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p>Persistent datastore</p>
+</td>
+<td width="258">
+<p> </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p>Full Mulgara server advantages</p>
+</td>
+<td width="258">
+<p> </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p>Scalable </p>
+</td>
+<td width="258">
+<p> </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p> </p>
+</td>
+<td width="258">
+<p> </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td colspan="2" width="516">
+<p class="tableheading">iTQL Graph</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p class="tableheading">Advantages</p>
+</td>
+<td width="258">
+<p class="tableheading">Disadvantages</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p>Client/server architecture means client can be on different machine to server</p>
+</td>
+<td width="258">
+<p>Slower than memory graph and client graph</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p>Creates a graph from the results of an iTQL query</p>
+</td>
+<td width="258">
+<p>Read-only (cannot add or remove statements)</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p>Persistent datastore</p>
+</td>
+<td width="258">
+<p> </p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="258">
+<p>Scalable </p>
+</td>
+<td width="258">
+<p> </p>
+</td>
+</tr>
+
+</table>
+
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/jrdfreify.html
===================================================================
--- trunk/docs/site/integration/jrdfreify.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/jrdfreify.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,93 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Reify Triples</title>
+ <meta name="keywords" content="reification, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/searchgraph.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/jrdfremove.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html">Prerequisites</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2898">Obtaining a Session from a Mulgara Server</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations</a></p>
+<p class="relateditem"><a href="/integration/jrdfcreategraph.html">Creating the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfcreatenodes.html">Creating Nodes and Triples</a></p>
+<p class="relateditem"><a href="/integration/jrdfaddtriples.html">Adding Triples to the Graph</a></p>
+<p class="relateditem"><a href="/integration/searchgraph.html">Searching the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfremove.html">Removing Triples from the Graph</a></p>
+
+
+
+ -->
+
+
+
+<h3>Reify Triples</h3>
+
+<p>A statement can be made about another statement using reification. JRDF supports reification via a <code>TripleFactory</code> obtained using a graph's <code>getTripleFactory()</code> method. The following code inserts a reified statement:</p>
+
+<p class="commandtext">TripleFactory tripleFactory = graph.getTripleFactory();<br />
+<br />
+//create a resource to identify the statement<br />
+URIReference statement = elementFactory.createResource<br />
+ (new URI("http://example.org/statement#address"));<br />
+<br />
+//reify the address statement (person, hasAddress, address)<br />
+tripleFactory.reifyTriple(addressStatement, statement);<br />
+<br />
+//insert a statement about the original statement<br />
+URIReference manager = elementFactory.createResource(new URI("http://example.org/managerid#65"));<br />
+URIReference hasConfirmed = elementFactory.createResource<br />
+ (new URI("http://example.org/terms#hasConfirmed"));<br />
+Triple confirmationStatement = elementFactory.createTriple(manager, hasConfirmed, statement);<br />
+graph.add(confirmationStatement);</p>
+
+<p>The graph now contains:</p>
+
+<p class="commandtext">http://example.org/staffid#85740 http://example.org/terms#address _blankNode123<br />
+_blankNode123 http://example.org/terms#street "1501 Grant Avenue"<br />
+_blankNode123 http://example.org/terms#city "Bedford"<br />
+_blankNode123 http://example.org/terms#state "Massachusetts"<br />
+_blankNode123 http://example.org/terms#postalCode "01730"<br />
+<br />
+http://example.org/managerid#65 http://example.org/terms#hasConfirmed<br />
+ http://example.org/statement#address<br />
+http://example.org/statement#address http://www.w3.org/1999/02/22-rdf-syntax-ns#subject<br />
+ http://example.org/staffid#85740<br />
+http://example.org/statement#address http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate<br />
+ http://example.org/terms#address<br />
+http://example.org/statement#address http://www.w3.org/1999/02/22-rdf-syntax-ns#object<br />
+ _blankNode123<br />
+http://example.org/statement#address http://www.w3.org/1999/02/22-rdf-syntax-ns#type<br />
+ http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement</p>
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/jrdfremove.html
===================================================================
--- trunk/docs/site/integration/jrdfremove.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/jrdfremove.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,79 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Removing Triples from the Graph</title>
+ <meta name="keywords" content=", mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/jrdfreify.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/index.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html">Prerequisites</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2898">Obtaining a Session from a Mulgara Server</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations</a></p>
+<p class="relateditem"><a href="/integration/jrdfcreategraph.html">Creating the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfcreatenodes.html">Creating Nodes and Triples</a></p>
+<p class="relateditem"><a href="/integration/jrdfaddtriples.html">Adding Triples to the Graph</a></p>
+<p class="relateditem"><a href="/integration/searchgraph.html">Searching the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfreify.html">Reify Triples</a></p>
+
+
+ -->
+
+
+
+<h3>Removing Triples from the Graph</h3>
+
+<p>You can remove triples from a graph using it's <code>remove(Triple triple)</code> method. The following code removes a triple:</p>
+
+<p class="commandtext">//delete the city (address, hasCity, city) <br />
+graph.remove(cityStatement);</p>
+
+<p>The graph now contains:</p>
+
+<p class="commandtext">http://example.org/staffid#85740 http://example.org/terms#address _blankNode123 <br />
+_blankNode123 http://example.org/terms#street "1501 Grant Avenue" <br />
+_blankNode123 http://example.org/terms#state "Massachusetts" <br />
+_blankNode123 http://example.org/terms#postalCode "01730" <br />
+<br />
+http://example.org/managerid#65 http://example.org/terms#hasConfirmed<br />
+ http://example.org/statement#address <br />
+http://example.org/statement#address http://www.w3.org/1999/02/22-rdf-syntax-ns#subject<br />
+ http://example.org/staffid#85740 <br />
+http://example.org/statement#address http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate<br />
+ http://example.org/terms#address <br />
+http://example.org/statement#address http://www.w3.org/1999/02/22-rdf-syntax-ns#object<br />
+ _blankNode123<br />
+http://example.org/statement#address http://www.w3.org/1999/02/22-rdf-syntax-ns#type<br />
+ http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/jrdftutorial.html
===================================================================
--- trunk/docs/site/integration/jrdftutorial.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/jrdftutorial.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,87 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - JRDF Tutorial</title>
+ <meta name="keywords" content="JRDF, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/jsptutorial.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/jrdfprereq.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">In This Section</p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html">Prerequisites</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2898">Obtaining a Session from a Mulgara Server</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations</a></p>
+<p class="relateditem"><a href="/integration/jrdfcreategraph.html">Creating the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfcreatenodes.html">Creating Nodes and Triples</a></p>
+<p class="relateditem"><a href="/integration/jrdfaddtriples.html">Adding Triples to the Graph</a></p>
+<p class="relateditem"><a href="/integration/searchgraph.html">Searching the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfreify.html">Reify Triples</a></p>
+<p class="relateditem"><a href="/integration/jrdfremove.html">Removing Triples from the Graph</a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/index.html">Integration Tutorials</a></p>
+<p class="relateditem"><a href="/integration/resolverhttpmp3.html">HTTP Resolver and MP3 Content Handler Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jena.html">Jena</a></p>
+<p class="relateditem"><a href="/integration/perl.html">Perl</a></p>
+<p class="relateditem"><a href="/integration/jsptutorial.html">JavaServer Pages Tag Library</a></p>
+
+ -->
+
+
+
+
+<h2>JRDF Tutorial</h2>
+
+<p>JRDF is a set of APIs that provide a concise implementation of the Resource Description Framework (RDF) using standard Java conventions. JRDF offers a highly modular and type safe interface allowing users to create, store and query RDF statements. It includes a default memory implementation that can be used in conjunction with Mulgara<sup>TM</sup> to provide a scalable RDF solution.</p>
+
+<p>The example code provided in this tutorial is from the <code>org.jrdf.mem.JRDFExample</code> class. The <code>JRDFExample</code> class uses an in-memory JRDF graph implementation and can be run by typing at a command line:</p>
+
+<p class="commandtext">java -cp <TKS installation directory>/driver-2.1.jar org.jrdf.mem.JRDFExample</p>
+
+<p>The code for <code>JRDFExample</code> is in the <code>Resources</code> directory of your TKS installation. The JRDF API documentation is in <code><a class="internetlinktemplate" title="" href="api/jrdf/index.html"><TKS install>/docs/api/jrdf</a></code>.</p>
+
+<p>There are four JRDF graph implementations to choose from:</p>
+<ol><li>JRDF graph (memory graph)
+<p class="listcontinue">The JRDF jar provides a memory implementation under 60Kb and is available for download from <code><a class="jumptemplate" title="" href="http://sourceforge.net/projects/jrdf/">http://sourceforge.net/projects/jrdf/</a></code>. The memory graph is easy to create and is useful for small graphs and caching of results from larger graphs (subgraphs). The classes are in the <code>org.jrdf.graph.mem</code> package of the JRDF jar.</p>
+</li><li>Server-side JRDF Graph (server graph)
+<p class="listcontinue">Mulgara provides a server-side JRDF Graph interface for accessing a model. The graph must be created in the same JVM that the Mulgara server is running in.</p>
+
+<p class="listcontinue">Server graphs can be used for direct access to the database using a graph API. This is useful for applications that use Mulgara as an embedded component. The server graph classes are in the <code>org.mulgara.jrdf</code> package of the server jar.</p>
+</li><li>Server backed JRDF graph (client graph)
+<p class="listcontinue">Mulgara also provides a client-side JRDF graph interface for accessing a model. This provides a scalable RDF solution for remote client applications.</p>
+
+<p class="listcontinue">Client graphs can be used in conjunction with memory graphs. Memory implemented nodes and triples can be inserted into, removed from and used to query client graphs. Other JRDF implementations can also be used, but may not be supported. The client graph classes are in the <code>org.mulgara.client.jrdf</code> package of the Driver jar.</p>
+</li><li>Read-only iTQL result JRDF graph (iTQL graph)
+<p class="listcontinue">Mulgara also allows you to create read-only JRDF graphs from the results of an iTQL query. This provides a powerful mechanism for displaying search results as a subgraph. The classes are in the <code>org.mulgara.client.jrdf</code> package of the Driver jar.</p>
+</li></ol>
+<p>Each of these JRDF graph implementations are outlined in the following sections.</p>
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/jsptutorial.html
===================================================================
--- trunk/docs/site/integration/jsptutorial.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/jsptutorial.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,205 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - JavaServer Pages Tag Library Tutorial</title>
+ <meta name="keywords" content="JavaServer Pages Tag Library, tutorial, jsp, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/integration/jsptutorial.html#o991">Before you Begin</a> |
+ <a href="/integration/jsptutorial.html#o993">Sample Data</a> |
+ <a href="/integration/jsptutorial.html#o994">Develop the JSPs</a> |
+ <a href="/integration/jsptutorial.html#o995">Deploy</a> |
+ <a href="/integration/jsptutorial.html#o996">Open the Application</a>
+
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/perl.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/jrdftutorial.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/index.html">Integration Tutorials</a></p>
+<p class="relateditem"><a href="/integration/resolverhttpmp3.html">HTTP Resolver and MP3 Content Handler Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jena.html">Jena</a></p>
+<p class="relateditem"><a href="/integration/perl.html">Perl</a></p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
+
+ -->
+
+
+
+
+<h2>JavaServer Pages Tag Library</h2>
+
+<p>This tutorial outlines the steps for creating a simple web-based application using Mulgara JavaServer Pages<sup>TM</sup> (JSP) tags.</p>
+
+<p class="note"><strong>Note -</strong> Some sections of this tutorial are still under construction.</p>
+
+<div class="anchor"><a name="o991"> </a></div>
+<h3>Before you Begin</h3>
+
+<p>Before you begin this tutorial, you should be familiar with <a class="internetlinktemplate" title="" href="http://java.sun.com/products/jsp/">JSP</a> development, including topics such as using tag libraries, deploying JSP pages and creating WAR files. You should also read the <a id="h1309" class="documentlinktemplate" title="JavaServer Pages Tag Library" href="/system/jsptaglib.html">JavaServer Pages Tag Library section</a> for detailed information on using the JSP tags used in this tutorial.</p>
+
+<p>You also need Mulgara to be running.</p>
+<div class="anchor"><a name="o993"> </a></div>
+<h3>Load the Sample Data</h3>
+
+<p>This tutorial uses sample vCards in RDF/XML format. Complete the following steps:</p>
+<ol><li>Copy the following RDF and paste it into a file called <code>vcards.rdf</code>.
+<p class="listcontinuecommandtext"><?xml version="1.0"?><br />
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"<br />
+ xmlns:vCard =" http://www.w3.org/2001/vcard-rdf/3.0#"><br />
+<br />
+<rdf:Description rdf:about =" http://qqq.com/staff/ataylor" ><br />
+ <vCard:FN>Alex Taylor </vCard:FN><br />
+ <vCard:N rdf:parseType="Resource"><br />
+ <vCard:Family>Taylor</vCard:Family><br />
+ <vCard:Given>Alex</vCard:Given><br />
+ <vCard:Other>Perry</vCard:Other><br />
+ <vCard:Prefix>Mr</vCard:Prefix><br />
+ </vCard:N><br />
+ <vCard:BDAY>1981-01-01</vCard:BDAY><br />
+ <vCard:TITLE>Project Manager</vCard:TITLE><br />
+ <vCard:ROLE>Management of projects</vCard:ROLE><br />
+ <vCard:TEL rdf:parseType="Resource"><br />
+ <rdf:value>+61 7 455 234</rdf:value><br />
+ <rdf:type rdf:resource ="http://imc.org/vCard/3.0#work" /><br />
+ <rdf:type rdf:resource ="http://imc.org/vCard/3.0#voice" /><br />
+ </vCard:TEL><br />
+ <vCard:EMAIL><br />
+ <vCard:internet rdf:value="ataylor at qqq.com"/><br />
+ </vCard:EMAIL><br />
+ <vCard:ADR rdf:parseType="Resource"><br />
+ <vCard:Street>45 Peterson Drive </vCard:Street><br />
+ <vCard:Locality>Brisbane</vCard:Locality><br />
+ <vCard:Pcode>4066</vCard:Pcode><br />
+ <vCard:Country>Australia </vCard:Country><br />
+ </vCard:ADR><br />
+ <vCard:NOTE>Interested in eXtreme Programing</vCard:NOTE><br />
+</rdf:Description><br />
+<br />
+<rdf:Description rdf:about =" http://qqq.com/staff/ppan" ><br />
+ <vCard:FN>Peter Pan</vCard:FN><br />
+ <vCard:N rdf:parseType="Resource"><br />
+ <vCard:Family>Pan</vCard:Family><br />
+ <vCard:Given>Peter</vCard:Given><br />
+ <vCard:Prefix>Mr</vCard:Prefix><br />
+ </vCard:N><br />
+ <vCard:TITLE>Deck hand</vCard:TITLE><br />
+ <vCard:ROLE>Actor</vCard:ROLE><br />
+ <vCard:TEL rdf:parseType="Resource"><br />
+ <rdf:value>+61 4193 34223</rdf:value><br />
+ <rdf:type rdf:resource ="http://imc.org/vCard/3.0#mobile" /><br />
+ </vCard:TEL><br />
+ <vCard:EMAIL><br />
+ <vCard:internet rdf:value="peter at qqq.com"/><br />
+ </vCard:EMAIL><br />
+ <vCard:ADR rdf:parseType="Resource"><br />
+ <vCard:Street> Ocean Rd</vCard:Street><br />
+ <vCard:Locality>Morton Bay</vCard:Locality><br />
+ <vCard:Pcode>4239</vCard:Pcode><br />
+ <vCard:Country>Australia</vCard:Country><br />
+ </vCard:ADR><br />
+ <vCard:NOTE>Mobile phone maybe out-of-range during week days</vCard:NOTE><br />
+</rdf:Description><br />
+<br />
+<rdf:Description rdf:about =" http://qqq.com/staff/bsimpson" ><br />
+ <vCard:FN>Bart Simpson</vCard:FN><br />
+ <vCard:N rdf:parseType="Resource"><br />
+ <vCard:Family>Simpson</vCard:Family><br />
+ <vCard:Given>Bart</vCard:Given><br />
+ <vCard:Prefix>Master</vCard:Prefix><br />
+ </vCard:N><br />
+ <vCard:TITLE>Comic character</vCard:TITLE><br />
+ <vCard:ROLE>Cause mayhem</vCard:ROLE><br />
+ <vCard:TEL rdf:parseType="Resource"><br />
+ <rdf:value>+61 045 45665 456</rdf:value><br />
+ <rdf:type rdf:resource ="http://imc.org/vCard/3.0#mobile" /><br />
+ </vCard:TEL><br />
+ <vCard:EMAIL><br />
+ <vCard:internet rdf:value="bart at simpsons.com"/><br />
+ </vCard:EMAIL><br />
+ <vCard:ADR rdf:parseType="Resource"><br />
+ <vCard:Street>Jackson Rd</vCard:Street><br />
+ <vCard:Locality>New York</vCard:Locality><br />
+ <vCard:Pcode>4249</vCard:Pcode><br />
+ <vCard:Country>US</vCard:Country><br />
+ </vCard:ADR><br />
+ <vCard:NOTE>Possesses little brains</vCard:NOTE><br />
+</rdf:Description><br />
+<br />
+<rdf:Description rdf:about =" http://qqq.com/staff/lsimpson" ><br />
+ <vCard:FN>Lisa Simpson</vCard:FN><br />
+ <vCard:N rdf:parseType="Resource"><br />
+ <vCard:Family>Simpson</vCard:Family><br />
+ <vCard:Given>Lisa</vCard:Given><br />
+ <vCard:Prefix>Ms</vCard:Prefix><br />
+ </vCard:N><br />
+ <vCard:ROLE>Smart Responsible Student</vCard:ROLE><br />
+ <vCard:TEL rdf:parseType="Resource"><br />
+ <rdf:value>+61 045 45665 456</rdf:value><br />
+ <rdf:type rdf:resource ="http://imc.org/vCard/3.0#mobile" /><br />
+ </vCard:TEL><br />
+ <vCard:EMAIL><br />
+ <vCard:internet rdf:value="lisa at simpsons.com"/><br />
+ </vCard:EMAIL><br />
+ <vCard:ADR rdf:parseType="Resource"><br />
+ <vCard:Street>Jackson Rd</vCard:Street><br />
+ <vCard:Locality>New York</vCard:Locality><br />
+ <vCard:Pcode>4249</vCard:Pcode><br />
+ <vCard:Country>US</vCard:Country><br />
+ </vCard:ADR><br />
+ <vCard:NOTE>Possesses mostly of brains</vCard:NOTE><br />
+</rdf:Description><br />
+<br />
+</rdf:RDF></p>
+</li><li>Using the Mulgara Viewer<sup>TM</sup> or the iTQL<sup>TM</sup> command line interface, create a model to store the vCard data. Use the following iTQL command:
+<p class="listcontinuecommandtext">create <rmi://mysite.com/server1#vcards>;</p>
+
+<p class="listcontinue">The following message displays:</p>
+
+<p class="listcontinuecommandtext">Successfully created model rmi://mysite.com/server1#vcard</p>
+</li><li>Load the sample vCard data into the model just created, using the following iTQL command:
+<p class="listcontinuecommandtext">load <file:/home/user/jspdemo/vcards.rdf> into<br />
+ <rmi://mysite.com/server1#vcard>;</p>
+
+<p class="listcontinue">The following message displays:</p>
+
+<p class="listcontinuecommandtext">Successfully loaded 78 statements from file:/home/user/jspdemo/vcards2.rdf<br />
+ into rmi://localhost/server1#vcard</p>
+</li><li></li><li></li><li></li><li></li><li></li></ol>
+<div class="anchor"><a name="o994"> </a></div>
+<h3>Develop the JSPs</h3>
+<div class="anchor"><a name="o995"> </a></div>
+<h3>Deploy the JSPs</h3>
+<div class="anchor"><a name="o996"> </a></div>
+<h3>Open the Application</h3>
+
+<p>When you have developed the application, connect to it with your web browser by opening the page, <a class="internetlinktemplate" title="" href="http://localhost/jspdemo/index.jsp">http://localhost/jspdemo/index.jsp</a>.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/parsers.html
===================================================================
--- trunk/docs/site/integration/parsers.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/parsers.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,104 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Parsers</title>
+ <meta name="keywords" content="Parser, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/integration/parsers.html#o2704">Configuration and Initialisation</a> |
+ <a href="/integration/parsers.html#o2705">Processing ID3 Tags into RDF</a> |
+ <a href="/integration/parsers.html#o2706">Storing Data</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/contenthandlers.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/statements.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/contenthandlersdev.html">Developing Content Handlers</a></p>
+<p class="relateditem"><a href="/integration/contenthandlers.html">Content Handlers</a></p>
+<p class="relateditem"><a href="/integration/statements.html">Statements</a></p>
+
+ -->
+
+
+
+
+<h4>Parsers</h4>
+
+<p>The content handler takes data from files and converts it into RDF triples that can be navigated using the <code>Statements</code> interface. Usually the data contained in the target file is not in a natural RDF format so the content handler must convert the data for it to be relevant. Whether this is a matter of parsing text or converting binary data is up to the implementer. The MP3 resolver uses a parser package that transforms the ID3 tags into meaningful RDF triples, which the <code>Statements</code> implementation can then navigate.</p>
+
+<p>When parsing the data you need to decide on what kind of temporary storage to use for the RDF triples. Remember that the <code>Statements</code> object navigates through triples in a list style so the storage method used must be able to accommodate this.</p>
+
+<p>You also need to consider how the triples should be stored across queries against the URL. Should you cache them to save time if the URL is queried again? Should you store the data in memory (you can only process small files but has faster access) or on disk (you can handle large files but with slower access)? For the purposes of the MP3 parser, a JRDF graph stores the triples in memory, as ID3 tags are small.</p>
+
+<div class="anchor"><a name="o2704"> </a></div>
+<h5>Configuration and Initialisation</h5>
+
+<p>How the parsing section of the handler is set up is up to the developer. The way the data is added is irrelevant, only the fact that the data is added in a <code>Statements</code> API navigable format is important. Some configuration for your parsing solution might be required. For the MP3 resolver there is a configuration file with properties telling the factory where to find the implementations of the ID3 tag parsing classes.</p>
+
+<p>The properties file looks like the following (see the <code>parserfactory.conf</code> file in the <code>conf/resolvers/mp3/</code> directory of your Mulgara installation):</p>
+
+<p class="commandtext">id3parser.class = org.mulgara.resolver.mp3.parser.ID3ParserImpl<br />
+id3v1parser.class = org.mulgara.resolver.mp3.parser.ID3v1ParserImpl<br />
+id3v2parser.class = org.mulgara.resolver.mp3.parser.ID3v2ParserImpl</p>
+
+<p>The properties file with name value pairs is read into the factory's properties by the following lines of code (see <code>ParserFactory.java</code>):</p>
+
+<p class="commandtext">// Initialise our properties<br />
+properties = new Properties();<br />
+<br />
+// Retrieve the resource url for our configuration file<br />
+URL parserConfiguration = this.getClass().getResource("/parserfactory.conf");<br />
+<br />
+try {<br />
+<br />
+ // Load the properties for the parser factory using the stream from the URL<br />
+ properties.load(parserConfiguration.openStream());<br />
+} catch (IOException ioException) {<br />
+<br />
+ throw new FactoryException("Unable to load the parser factory " +<br />
+ "configuration from: " +<br />
+ parserConfiguration.toString(), ioException);<br />
+}</p>
+
+<p>No other configuration is required for the parser.</p>
+<div class="anchor"><a name="o2705"> </a></div>
+<h5>Processing ID3 Tags into RDF</h5>
+
+<p>Since parsers vary depending on the content of what they are parsing, only a summary of the steps are included here, highlighting the process of data conversion. The actual implementation of this process is in the the <code>src/jar/content-mp3/java/org/mulgara/content/mp3/parser/</code> directory of your Mulgara installation.</p>
+
+<p>ID3 tags are passed into the <code>ID3Parser</code> class using the <code>MP3Conversion</code> container bean. Within the general <code>ID3Parser</code> class, the version 2 and version 1 tags are separately parsed with the <code>ID3v2Parser</code> and <code>ID3v1Parser</code> implementation classes respectively. Within the <code>MP3Conversion</code> object there is a <code>JRDF Graph</code> object that stores the statements pertaining to the ID3 tag data. Available to each <code>MP3Conversion</code> object's graph is a dictionary of RDF predicates, which correspond to each of the tag headers that might be found in ID3 tags (see <code>IdentifierProcessor.java</code>).</p>
+
+<p>Both ID3 tag parsers (<code>ID3v1ParserImpl.java</code> and <code>ID3v2ParserImpl.java</code>) contain a method called <code>parseRDF()</code> that is used to generate the RDF triples that the ID3 tags parse to. Each tag set belongs to its own resource, unified under a single MP3 resource unique to the original file. As tag identifiers are processed, the respective resources have triples which contain the tag's resource ID, the predicate mapping for the current identifier and the literal value from the tag added. After completion of this parsing process the conversion is then handed back to the calling object (<code>MP3Statements</code>) for processing of the <code>Graph</code> object.</p>
+<div class="anchor"><a name="o2706"> </a></div>
+<h5>Storing Data</h5>
+
+<p>As described above, all triples are added to the graph and are then passed to the <code>MP3Statements</code> object for navigation when the resolver resolves the constraints. Everything is done in memory and is relatively fast. The drawback to this is that the triples are lost once the resolver has finished constraining the statements. Since ID3 tags are relatively small, this is not too much of a problem. However, in something like an MBox handler, file sizes and message counts are larger so caching of the graph occurs to prevent the duplication of processing. It also means that the data is persisted across executions.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/perl.html
===================================================================
--- trunk/docs/site/integration/perl.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/perl.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,269 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Perl</title>
+ <meta name="keywords" content="Perl, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/jena.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/jsptutorial.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/index.html">Integration Tutorials</a></p>
+<p class="relateditem"><a href="/integration/resolverhttpmp3.html">HTTP Resolver and MP3 Content Handler Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jena.html">Jena</a></p>
+<p class="relateditem"><a href="/integration/jsptutorial.html">JavaServer Pages Tag Library</a></p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
+
+ -->
+
+
+
+
+<h2>Perl</h2>
+
+<p>The following are two sample Perl programs that allow you to issue iTQL<sup>TM</sup> commands. The first uses Inline Java, the second uses SOAP Lite.</p>
+
+<p>For the first example, ensure you have the following installed:</p>
+<ul><li><a class="internetlinktemplate" title="Inline for Perl" href="http://inline.perl.org/inline/home.html">Inline package for Perl</a></li><li><a class="internetlinktemplate" title="Inline::Java" href="http://inline.perl.org/java/home.html">Inline::Java</a></li><li>driver-1.1.0.jar in the <code>Resources</code> directory of your Mulgara installation</li><li><a class="internetlinktemplate" title="log4j" href="http://logging.apache.org/log4j/docs/">log4j-1.2.8.jar</a> or higher</li></ul>
+<p>Ensure that the Inline::Java test suite operates correctly and that Mulgara is running.</p>
+
+<p class="note"><strong>Note -</strong> In the program below, replace <code>mulgaradirectory</code>, <code>ApacheLog4Jdirectory</code> and <code>mysite.com</code> (highlighted in <strong>bold</strong>), with the appropriate settings for your local environment.</p>
+
+<p class="commandtext">use CGI;<br />
+use Inline (<br />
+ Java => <<'END',<br />
+<br />
+// Java 2 standard packages<br />
+import java.sql.*;<br />
+<br />
+// Mulgara packages<br />
+import org.mulgara.itql.ItqlInterpreterBean;<br />
+import org.mulgara.query.Answer;<br />
+<br />
+// Logging<br />
+import org.apache.log4j.*;<br />
+<br />
+/**<br />
+ * iTQL Perl Bean. <p><br />
+ *<br />
+ * This class provides a simple interface for the execution of iTQL queries<br />
+ * via Perl using Inline Java 4.0<br />
+ * </p><br />
+ *<br />
+ * @created 2004-March-01<br />
+ *<br />
+ * @author <a href="http://staff.PIsoftware.com/tate/">Tate Jones</a><br />
+ *<br />
+ * @version $Revision: 1.5 $<br />
+ *<br />
+ * @modified $Date: 2004/12/22 05:01:58 $ by $Author: newmana $<br />
+ *<br />
+ * @copyrights &copy;2001 <a href="http://www.pisoftware.com/">Tucana Technologies, Inc.</a><br />
+ *<br />
+ * @licence <a href="http://www.mozilla.org/MPL/MPL-1.1.html">Mozilla Public License v1.1</a><br />
+ */<br />
+<br />
+public class iTQLPerlBean {<br />
+<br />
+ /** iTQL Bean used to query Mulgara */<br />
+ private ItqlInterpreterBean interpreter;<br />
+<br />
+ /** Answer object to hold the result of an iTQL query */<br />
+ Answer answer = null;<br />
+<br />
+ /**<br />
+ * Creates a iTQL interpreter bean for queries.<br />
+ *<br />
+ */<br />
+ <br />
+ public iTQLPerlBean() {<br />
+<br />
+ // Initialise logging<br />
+ BasicConfigurator.configure();<br />
+ <br />
+ // Set logging level<br />
+ Logger.getRootLogger().<br />
+ setLevel( Level.WARN );<br />
+<br />
+ // Create the iTQL Bean to use for queries<br />
+ interpreter = new ItqlInterpreterBean();<br />
+<br />
+ }<br />
+ <br />
+<br />
+ /**<br />
+ * Executes an iTQL query.<br />
+ *<br />
+ * @param query String containing the iTQL query<br />
+ * @return the Answer containing the result of the query.<br />
+ */<br />
+<br />
+ public void execute(String query) {<br />
+<br />
+ try {<br />
+<br />
+ // close any previous answer<br />
+ this.closeAnswer();<br />
+ <br />
+ // Do the query<br />
+ answer = interpreter.executeQuery(query);<br />
+ <br />
+ // move to the first row <br />
+ if ( answer != null ) {<br />
+ answer.beforeFirst();<br />
+ }<br />
+<br />
+ }<br />
+ catch (Exception e) {<br />
+<br />
+ System.err.println("iTQLInterpreterBean Error : ");<br />
+ e.printStackTrace(System.err); <br />
+ }<br />
+<br />
+ }<br />
+<br />
+ /** <br />
+ * Return an answer row as a Perl Array.<br />
+ *<br />
+ * @param answer Answer <br />
+ * @return String arrary for conversion to a perl array <br />
+ **/<br />
+<br />
+ public String[] getRow() {<br />
+<br />
+ String columns[] = null; <br />
+ <br />
+ try {<br />
+ if ( answer != null && answer.next() ) {<br />
+<br />
+ // initialise the number of columns<br />
+ int numberOfColumns = answer.getNumberOfVariables();<br />
+ columns = new String[numberOfColumns]; <br />
+ <br />
+ // populate the array with the column values<br />
+ for ( int column=0; column < numberOfColumns; column++ ) {<br />
+ columns[column] = answer.getObject(column).toString();<br />
+ }<br />
+ } <br />
+ } <br />
+ catch (Exception e) {<br />
+<br />
+ System.err.println("iTQLInterpreterBean fetchRow error : ");<br />
+ e.printStackTrace(System.err); <br />
+ }<br />
+<br />
+ return columns;<br />
+<br />
+ }<br />
+<br />
+ /**<br />
+ * Close the answer to reclaim resources.<br />
+ *<br />
+ */<br />
+<br />
+ public void closeAnswer() {<br />
+<br />
+ try {<br />
+<br />
+ // close the answer<br />
+ if ( answer != null ) {<br />
+ answer.close();<br />
+ }<br />
+<br />
+ }<br />
+ catch (Exception e) {<br />
+<br />
+ System.err.println("iTQLInterpreterBean Error : ");<br />
+ e.printStackTrace(System.err); <br />
+ }<br />
+<br />
+ }<br />
+<br />
+<br />
+}<br />
+<br />
+END<br />
+ DIRECTORY => '/tmp',<br />
+ CLASSPATH =><br />
+'/<strong>mulgaradirectory</strong>/driver-2.0.jar:/<strong>ApacheLog4Jdirectory</strong>/log4j-1.2.8.jar',<br />
+) ;<br />
+<br />
+# Create a iTQL session bean for executing queries<br />
+<br />
+my $bean = new iTQLPerlBean();<br />
+<br />
+# Execute the query via the bean<br />
+<br />
+$bean->execute('select $s $p $o from <rmi://<strong>mysite.com</strong>/server1#> where $s $p $o ;');<br />
+<br />
+# Print out the results until empty<br />
+<br />
+while ( my $cols = $bean->getRow() ) {<br />
+ print($cols->[0] . " ");<br />
+ print($cols->[1] . " ");<br />
+ print($cols->[2] . "");<br />
+}<br />
+<br />
+# Close answer resources<br />
+<br />
+$bean->closeAnswer();</p>
+
+<p>As stated previously, this second example uses SOAP Lite.</p>
+
+<p class="commandtext">#!usr/bin/perl<br />
+# -*- perl-indent-level: 2 -*-<br />
+#<br />
+# SoapModule.pm<br />
+#<br />
+# $Id: 746.htm,v 1.5 2004/12/22 05:01:58 newmana Exp $<br />
+#<br />
+<br />
+use 5.006;<br />
+use warnings;<br />
+use SOAP::Lite;<br />
+1;<br />
+<br />
+my $serverEnd =<br />
+ "http://mysite.com:8080/webservices/services/ItqlBeanService";<br />
+<br />
+my $iTQLcommand = "select \$subject \$predicate \$object from<br />
+ <rmi://mysite.com/server1#example> where \$subject \$predicate \$object ;";<br />
+<br />
+print soapProcess($serverEnd, $iTQLcommand);<br />
+<br />
+sub soapProcess {<br />
+ my ($serverSoapEndpoint, $iTQLcommand) = @_;<br />
+ my $resultString = SOAP::Lite<br />
+ -> uri($serverSoapEndpoint)<br />
+ -> proxy($serverSoapEndpoint)<br />
+ -> executeQueryToString($iTQLcommand)<br />
+ -> result;<br />
+ return $resultString;<br />
+}<br />
+</p>
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/resolveprot.html
===================================================================
--- trunk/docs/site/integration/resolveprot.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/resolveprot.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,69 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Developing Protocol Resolvers</title>
+ <meta name="keywords" content="Protocol, Resolvers, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/resolverpre.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/resolverfactories.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">In This Section</p>
+<p class="relateditem"><a href="/integration/resolverfactories.html">Factories</a></p>
+<p class="relateditem"><a href="/integration/resolverwrapper.html">Content Wrappers</a></p>
+<p class="relateditem"><a href="/integration/resolverwrite.html">Resolvers</a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/resolverhttpmp3.html">HTTP Resolver and MP3 Content Handler Tutorial</a></p>
+<p class="relateditem"><a href="/integration/resolverhttpmp3.html#o3182"></a></p>
+<p class="relateditem"><a href="/integration/resolverpre.html">Prerequisites</a></p>
+<p class="relateditem"><a href="/integration/contenthandlersdev.html">Developing Content Handlers</a></p>
+<p class="relateditem"><a href="/integration/compiling.html">Compiling with Ant</a></p>
+<p class="relateditem"><a href="/integration/integrate.html">Integrating into Mulgara</a></p>
+
+ -->
+
+
+
+
+<h3>Developing Protocol Resolvers</h3>
+
+<p>There are three components that make up a protocol resolver:</p>
+<ol><li>Factories
+<p class="listcontinue">Creates resolver instances and registers them with the appropriate protocols.</p>
+</li><li>Content Wrappers
+<p class="listcontinue">Wraps the content of files being resolved under a specific protocol.</p>
+</li><li>Resolvers
+<p class="listcontinue">Resolve constraints against a file or store that is not naturally in RDF.</p>
+</li></ol>
+<p>The following sections outline how to create these components. The source files used for the protocol resolver part of the tutorial are located in the <code>src/jar/resolver-http/java/</code> directory of your Mulgara installation.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/resolverfactories.html
===================================================================
--- trunk/docs/site/integration/resolverfactories.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/resolverfactories.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,267 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Factories</title>
+ <meta name="keywords" content="Factories, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/integration/resolverfactories.html#o2692">Writing a Factory</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/resolveprot.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/resolverwrapper.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/resolveprot.html">Developing Protocol Resolvers</a></p>
+<p class="relateditem"><a href="/integration/resolverwrapper.html">Content Wrappers</a></p>
+<p class="relateditem"><a href="/integration/resolverwrite.html">Resolvers</a></p>
+
+ -->
+
+
+
+
+<h4>Factories</h4>
+
+<p>Factories are an important part of the resolver framework as they are responsible for both creating resolver instances and registering themselves with the appropriate protocols. They also act as a bridge between resolvers and sessions, assigning it the session it will be working for, along with any other initial data or configuration that is required. For <a id="h2564" class="documentlinktemplate" title="Internal Resolvers" href="/resolvers/resolverdbclass.html#o2559">Internal Resolvers</a> the factory also manages the cleanup of any persistent resources when the database or factory shuts down.</p>
+
+<p>Most of the decisions to be made about the resolver are made when creating the resolver itself. See the <a id="h2722" class="documentlinktemplate" title="Resolvers" href="/integration/resolverwrite.html">Creating the Resolver section</a> for more information. You should at least know the protocol the resolver is associating itself with when writing the factory. For this tutorial we are creating a resolver that resolves http URLs (both secure and non-secure). If the resolver's purpose is to handle a file type, such as MP3, then a content handler should be written instead of the resolver. See the <a id="h2723" class="documentlinktemplate" title="Content Handlers" href="/integration/contenthandlers.html">Creating the Content Handler section</a> for more information.</p>
+
+<p>The resolver classes should be reserved mainly for resolving a protocol type, which then refers to the content handlers for the statements.</p>
+
+
+
+<div class="anchor"><a name="o2692"> </a></div>
+<h5>Writing a Factory</h5>
+
+<p>After deciding on the protocol to resolve, write the factory to obtain instances of the resolver. This is a compulsory step for any type of resolver, as without it, the database has no way of obtaining resolver instances for its sessions. The following code represents a factory that creates and manages our http resolver instances (extracted from <code>HttpResolverFactory.java</code>):</p>
+
+<p class="commandtext">package org.mulgara.resolver.http;<br />
+<br />
+// Java 2 standard packages<br />
+import java.io.*;<br />
+import java.net.*;<br />
+import java.util.List;<br />
+<br />
+// Third party packages<br />
+import org.apache.log4j.Logger;<br />
+<br />
+// Locally written packages<br />
+import org.mulgara.query.rdf.Mulgara;<br />
+import org.mulgara.query.rdf.URIReferenceImpl;<br />
+import org.mulgara.resolver.spi.*;<br />
+<br />
+public class HttpResolverFactory implements ResolverFactory {<br />
+ /**<br />
+ * Logger.<br />
+ */<br />
+ private static Logger logger =<br />
+ Logger.getLogger(HttpResolverFactory.class.getName());<br />
+<br />
+ private final List contentHandlerList;<br />
+<br />
+ /**<br />
+ * Instantiate a {@link HttpResolverFactory}.<br />
+ */<br />
+ private HttpResolverFactory(ResolverFactoryInitializer resolverFactoryInitializer)<br />
+ throws FactoryInitializerException {<br />
+<br />
+ // Validate "resolverFactoryInitializer" parameter<br />
+ if (resolverFactoryInitializer == null) {<br />
+<br />
+ throw new IllegalArgumentException(<br />
+ "Null \"resolverFactoryInitializer\" parameter");<br />
+ }<br />
+<br />
+ // Obtain the content handler list<br />
+ contentHandlerList = resolverFactoryInitializer.getContentHandlerList();<br />
+<br />
+ // Claim the http: protocol<br />
+ resolverFactoryInitializer.addProtocol("http", this);<br />
+ ***resolverFactoryInitializer.addProtocol("https", this);***<br />
+ }<br />
+<br />
+ /**<br />
+ * {@inheritDoc ResolverFactory}<br />
+ *<br />
+ * This is actually a non-operation, because the only persistent resources<br />
+ * are outside the database.<br />
+ */<br />
+ public void close() {<br />
+ // null implementation<br />
+ }<br />
+<br />
+ /**<br />
+ * {@inheritDoc ResolverFactory}<br />
+ *<br />
+ * This is actually a non-operation, because the only persistent resources<br />
+ * are outside the database.<br />
+ */<br />
+ public void delete() {<br />
+ // null implementation<br />
+ }<br />
+<br />
+ /**<br />
+ * Register this resolver upon database startup.<br />
+ *<br />
+ * @param resolverFactoryInitializer the database within which to find or<br />
+ * create the various XML Schema resources<br />
+ * @throws FactoryInitializerException if the XML Schema resources<br />
+ * can't be found or created<br />
+ */<br />
+ public static ResolverFactory newInstance(ResolverFactoryInitializer resolverFactoryInitializer)<br />
+ throws FactoryInitializerException {<br />
+<br />
+ return new HttpResolverFactory(resolverFactoryInitializer);<br />
+ }<br />
+<br />
+ /**<br />
+ * Obtain an http resolver.<br />
+ *<br />
+ * @param resolverSession the session which this query is local to<br />
+ * @param canWrite {@inheritDoc}; ignored in this implementation<br />
+ *<br />
+ * @throws IllegalArgumentException if resolverSession is<br />
+ * null<br />
+ * @throws ResolverFactoryException {@inheritDoc}<br />
+ */<br />
+ public Resolver newResolver(boolean canWrite, ResolverSession resolverSession,<br />
+ Resolver systemResolver)<br />
+ throws ResolverFactoryException {<br />
+<br />
+ return new HttpResolver(resolverSession, systemResolver, contentHandlerList);<br />
+ }<br />
+}</p>
+
+<p>An analysis of the factory is as follows:</p>
+
+<p class="indentcommandtext">package org.mulgara.resolver.http;<br />
+<br />
+// Java 2 standard packages<br />
+import java.io.*;<br />
+import java.net.*;<br />
+import java.util.List;<br />
+<br />
+// Third party packages<br />
+import org.apache.log4j.Logger;<br />
+<br />
+// Locally written packages<br />
+import org.mulgara.query.rdf.Mulgara;<br />
+import org.mulgara.query.rdf.URIReferenceImpl;<br />
+import org.mulgara.resolver.spi.*;</p>
+
+<p class="indent">Factories and resolvers are not required to be in the same package as the Mulgara resolvers. As long as the custom resolver classes are accessible by the Mulgara resolver framework it does not matter how you structure the packaging. The <code>org.mulgara.resolver.spi</code> package requires importing to allow access to the resolver framework and APIs.</p>
+
+<p class="indentcommandtext"> public class HttpResolverFactory implements ResolverFactory {</p>
+
+<p class="indent">All factories are required to implement the <code>ResoverFactory</code> API.</p>
+
+<p class="indentcommandtext"> /**<br />
+ * Instantiate a {@link HttpResolverFactory}.<br />
+ */<br />
+ private HttpResolverFactory(ResolverFactoryInitializer resolverFactoryInitializer)<br />
+ throws FactoryInitializerException {<br />
+<br />
+ // Validate "resolverFactoryInitializer" parameter<br />
+ if (resolverFactoryInitializer == null) {<br />
+<br />
+ throw new IllegalArgumentException(<br />
+ "Null \"resolverFactoryInitializer\" parameter");<br />
+ }<br />
+<br />
+ // Obtain the content handler list<br />
+ contentHandlerList = resolverFactoryInitializer.getContentHandlerList();<br />
+<br />
+ // Claim the http: protocol<br />
+ resolverFactoryInitializer.addProtocol("http", this);<br />
+ resolverFactoryInitializer.addProtocol("https", this);<br />
+ }</p>
+
+<p class="indent">Constructors for resolver factories should be private as they are managed by an API call that creates new instances as required. The <code>ResolverFactoryInitializer</code> object passed in contains initialization information for the parent resolver factory allowing new factory objects to register themselves so they can receive constraints to resolve.</p>
+
+<p class="indent">Once the factory object is created it should not hold onto the initialization object as this causes errors if anything is invoked on it later. During construction the factory should register itself with the protocol or protocols, which lets the database know that queries against models with this protocol should be directed to our resolver. This is achieved using the <code>resolverFactoryInitializer.addProtocol(String, Resolver);</code> method.</p>
+
+<p class="indentcommandtext"> /**<br />
+ * {@inheritDoc ResolverFactory}<br />
+ *<br />
+ * This is actually a non-operation, because the only persistent resources<br />
+ * are outside the database.<br />
+ */<br />
+ public void close() {<br />
+ // null implementation<br />
+ }<br />
+<br />
+ /**<br />
+ * {@inheritDoc ResolverFactory}<br />
+ *<br />
+ * This is actually a non-operation, because the only persistent resources<br />
+ * are outside the database.<br />
+ */<br />
+ public void delete() {<br />
+ // null implementation<br />
+ }</p>
+
+<p class="indent">Both the <code>delete()</code> and <code>close()</code> operations are used for freeing persistent resources involved with the factory when either it or the database are being shut down. <a id="h2568" class="documentlinktemplate" title="External Resolvers" href="/resolvers/resolverdbclass.html#o2560">External Resolvers</a> usually do not require any releasing of resources as they are managed externally and do not interact with the database resources.</p>
+
+<p class="indentcommandtext"> /**<br />
+ * Register this resolver upon database startup.<br />
+ *<br />
+ * @param resolverFactoryInitializer the database within which to find or<br />
+ * create the various XML Schema resources<br />
+ * @throws FactoryInitializerException if the XML Schema resources<br />
+ * can't be found or created<br />
+ */<br />
+ public static ResolverFactory newInstance(ResolverFactoryInitializer resolverFactoryInitializer)<br />
+ throws FactoryInitializerException {<br />
+<br />
+ return new HttpResolverFactory(resolverFactoryInitializer);<br />
+ }</p>
+
+<p class="indent">Factories should have private constructors and are instantiated and returned via an API call to the <code>newInstance(ResolverFactoryInitializer)</code> method. Configuration of the factory should occur in the constructor, but any pre-initialization can occur in this method.</p>
+
+<p class="indentcommandtext"> /**<br />
+ * Obtain an http resolver.<br />
+ *<br />
+ * @param resolverSession the session which this query is local to<br />
+ * @param canWrite {@inheritDoc}; ignored in this implementation<br />
+ *<br />
+ * @throws IllegalArgumentException if resolverSession is<br />
+ * null<br />
+ * @throws ResolverFactoryException {@inheritDoc}<br />
+ */<br />
+ public Resolver newResolver(boolean canWrite, ResolverSession resolverSession,<br />
+ Resolver systemResolver)<br />
+ throws ResolverFactoryException {<br />
+<br />
+ return new HttpResolver(resolverSession, systemResolver, contentHandlerList);<br />
+ }</p>
+
+<p class="indent">The purpose of a resolver factory is to create resolver objects and the <code>newResolver(boolean, ResolverSession, systemResolver)</code> method handles this process. It is the responsibility of the resolver to manage its setup and configuration using the parameters entered. The factory might also be responsible for creating a read-only, or read-write resolver, depending on the <code>allowWrites</code> parameter.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/resolverhttpmp3.html
===================================================================
--- trunk/docs/site/integration/resolverhttpmp3.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/resolverhttpmp3.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,93 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - HTTP Resolver and MP3 Content Handler Tutorial</title>
+ <meta name="keywords" content="HTTP, Resolver, MP3, Content, Handler, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/index.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/resolverpre.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">In This Section</p>
+<p class="relateditem"><a href="/integration/resolverhttpmp3.html#o3182"></a></p>
+<p class="relateditem"><a href="/integration/resolverpre.html">Prerequisites</a></p>
+<p class="relateditem"><a href="/integration/resolveprot.html">Developing Protocol Resolvers</a></p>
+<p class="relateditem"><a href="/integration/contenthandlersdev.html">Developing Content Handlers</a></p>
+<p class="relateditem"><a href="/integration/compiling.html">Compiling with Ant</a></p>
+<p class="relateditem"><a href="/integration/integrate.html">Integrating into Mulgara</a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/index.html">Integration Tutorials</a></p>
+<p class="relateditem"><a href="/integration/jena.html">Jena</a></p>
+<p class="relateditem"><a href="/integration/perl.html">Perl</a></p>
+<p class="relateditem"><a href="/integration/jsptutorial.html">JavaServer Pages Tag Library</a></p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
+
+ -->
+
+
+
+
+<h2>HTTP Resolver and MP3 Content Handler Tutorial</h2>
+
+<p><a id="h2568" class="documentlinktemplate" title="External Resolvers" href="/resolvers/resolverdbclass.html#o2560">External resolvers</a> are usually, but not always, related to parsing content from a file into data that is meaningful to Mulgara. To make it easier to resolve a file's URL (which can be of any protocol) the resolver architecture and construction of statements is split into two parts, the:</p>
+<ol><li>Protocol resolver
+<p class="listcontinue">Protocol resolvers are in charge of communicating with the database via the resolver SPI.</p>
+</li><li>Content handler
+<p class="listcontinue">Content handlers convert the data supplied into statements that can be used for resolving queries against.</p>
+</li></ol>
+<p>The purpose of this tutorial is to show you how to construct a protocol resolver and content handler, which can be used together to query an MP3 file across an http connection.</p>
+
+<p>The following example queries an MP3 file for the data contained within its id3 tags:</p>
+
+<p class="commandtext">select $subject $predicate $object<br />
+ from <http://mp3server.com/mysongs/U2/Vertigo.mp3><br />
+ where $subject $predicate $object;</p>
+
+<p>This query could return information like the following:</p>
+
+<p class="commandtext">$subject $predicate $object<br />
+node_2 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mulgara.org#ID3v1><br />
+node_2 <http://mulgara.org#comment> 'The latest hit from U2'<br />
+node_2 <http://mulgara.org#title> 'Vertigo'<br />
+node_2 <http://musicbrainz.org/mm/mm-2.1#sortName> 'U2'<br />
+node_2 <http://musicbrainz.org/mm/mm-2.1#trackNum> '1'<br />
+node_2 <http://mulgara.org#releaseYear> '2004'<br />
+node_2 <http://musicbrainz.org/mm/mm-2.1#trmid> '78'</p>
+
+<p>This general query is useful for finding out everything about a single MP3 file located on a server. However, using more complex queries, it is possible to query across several MP3 files to discover information such as:</p>
+<ul><li>All songs from a particular artist</li><li>Song from a particular year or period</li><li>The tracks from a particular album</li></ul>
+<div class="anchor"><a name="o3182"> </a></div>
+
+
+<p>An RDF schema file (<code>mp3.rdfs</code>) is provided with the tutorial source to allow you to know the available predicates and classes to be able to construct your queries. It is located in the <code>src/jar/content-mp3/rdfs/</code> directory of the your Mulgara installation.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/resolverpre.html
===================================================================
--- trunk/docs/site/integration/resolverpre.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/resolverpre.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,75 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Prerequisites</title>
+ <meta name="keywords" content="Prerequisites, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/resolverhttpmp3.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/resolveprot.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/resolverhttpmp3.html">HTTP Resolver and MP3 Content Handler Tutorial</a></p>
+<p class="relateditem"><a href="/integration/resolverhttpmp3.html#o3182"></a></p>
+<p class="relateditem"><a href="/integration/resolveprot.html">Developing Protocol Resolvers</a></p>
+<p class="relateditem"><a href="/integration/contenthandlersdev.html">Developing Content Handlers</a></p>
+<p class="relateditem"><a href="/integration/compiling.html">Compiling with Ant</a></p>
+<p class="relateditem"><a href="/integration/integrate.html">Integrating into Mulgara</a></p>
+
+-->
+
+
+
+
+<h3>Prerequisites</h3>
+
+<p>The following prerequisites should be met before this resolver tutorial can be compiled and run:</p>
+<ul><li>Java<sup>TM</sup> software, version 1.4 or higher. You can check the version you have installed by typing at a command line:
+<p class="listcontinuecommandtext">java -version</p>
+
+<p class="listcontinue">Something similar to the following should display:</p>
+
+<p class="listcontinuecommandtext">java version "1.4.2_04"<br />
+Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)<br />
+Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)</p>
+
+<p class="listcontinue">If the above does not display, add <code><JAVA_HOME>/bin</code>, where <code><JAVA_HOME></code> is the location where J2SE<sup>TM</sup> is installed, to your <code>PATH </code>(in the appropriate way for your shell).</p>
+
+<p class="listcontinue">For more information on installing and running Java software, read the <a class="jumptemplate" title="" href="http://java.sun.com/j2se/1.4.2/install.html">J2SE 1.4 Installation guide</a>.</p>
+</li><li>Apache Ant software, version 1.6 or higher. You can check the version you have installed by typing at a command line:
+<p class="listcontinuecommandtext">ant - version</p>
+
+<p class="listcontinue">Something similar to the following should display:</p>
+
+<p class="listcontinuecommandtext">Apache Ant version 1.6.2 compiled on July 16 2004</p>
+
+<p class="listcontinue">For more information on installing and running Ant software, read the <a class="internetlinktemplate" title="" href="http://ant.apache.org/manual/index.html">Apache Ant Manual</a>.</p>
+</li><li>A valid installation of Mulgara. See the relevant sections in the Mulgara documentation for more information.</li><li>Basic Java programming experience.</li></ul>
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/resolverwrapper.html
===================================================================
--- trunk/docs/site/integration/resolverwrapper.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/resolverwrapper.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,1023 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Content Wrappers</title>
+ <meta name="keywords" content="Content Wrappers, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+ <a href="/integration/resolverwrapper.html#o2700">Implementing the Interface</a>
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/resolverfactories.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/resolverwrite.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/resolveprot.html">Developing Protocol Resolvers</a></p>
+<p class="relateditem"><a href="/integration/resolverfactories.html">Factories</a></p>
+<p class="relateditem"><a href="/integration/resolverwrite.html">Resolvers</a></p>
+
+ -->
+
+
+
+
+<h4>Content Wrappers</h4>
+
+<p>Once the factory is created to handle the creation of resolver objects, an implementation of the <code>Content</code> interface should be written that can be sent to a <code>ContentHandler</code> object. This is used by the resolver to encapsulate the content of files being resolved under the specific protocol, providing a common format that the handler can read data from without worrying about the protocol. It also provides a URI to the original resource, if required, and a map of blank nodes to their respective values for usage across constraints on the same resource.</p>
+
+<p><code>Content</code> implementations do not require any knowledge about the file types that are to be used with the resolver. The two main considerations are converting the content object's URI source to an input stream and the management of blank node mappings.</p>
+
+
+<div class="anchor"><a name="o2700"> </a></div>
+<h5>Implementing the Interface</h5>
+
+<p><code>Content</code> implementations are compulsory for any protocol resolver. Without one the resolver has no way of allowing a handler access to the data that needs converting to <code>Statements</code>. Normally you can use the connection methods on the URL class to obtain an input stream from the source content, but you are also managing the https protocol, which is more advanced. To overcome this, the <code>HttpConnection</code> class of the apache commons <code>httpclient</code> is used to instantiate and maintain a connection to the content source. The implementation looks something like the following (extracted from <code>HttpContent.java</code>):</p>
+
+<p class="commandtext">package org.kowari.resolver.http;<br />
+
+<br />
+
+//Local packages<br />
+
+import org.kowari.content.Content;<br />
+
+<br />
+
+// Java 2 standard packages<br />
+
+import java.io.*;<br />
+
+import java.net.URI;<br />
+
+import java.net.URISyntaxException;<br />
+
+import java.net.URL;<br />
+
+import java.net.MalformedURLException;<br />
+
+import java.net.UnknownHostException;<br />
+
+import java.util.*;<br />
+
+<br />
+
+// Apache HTTP Client<br />
+
+import org.apache.commons.httpclient.*;<br />
+
+import org.apache.commons.httpclient.protocol.Protocol;<br />
+
+import org.apache.commons.httpclient.methods.*;<br />
+
+import org.apache.log4j.Logger;<br />
+
+<br />
+
+// Java 2 enterprise packages<br />
+
+import javax.activation.MimeType;<br />
+
+import javax.activation.MimeTypeParseException;<br />
+
+<br />
+
+//Third party packages<br />
+
+import org.apache.log4j.Logger;<br />
+
+<br />
+
+public class HttpContent implements Content {<br />
+
+<br />
+
+ /** Logger. */<br />
+
+ private final static Logger logger = Logger.getLogger(HttpContent.class<br />
+
+ .getName());<br />
+
+<br />
+
+ /** The URI version of the URL */<br />
+
+ private URI httpUri;<br />
+
+<br />
+
+ /**<br />
+
+ * A map containing any format-specific blank node mappings from previous<br />
+
+ * parses of this file.<br />
+
+ */<br />
+
+ private Map blankNodeMap = new HashMap();<br />
+
+<br />
+
+ /**<br />
+
+ * Connection host host<br />
+
+ */<br />
+
+ private String host;<br />
+
+<br />
+
+ /**<br />
+
+ * port to make connection to<br />
+
+ */<br />
+
+ private int port;<br />
+
+<br />
+
+ /**<br />
+
+ * Schema for connection schema<br />
+
+ */<br />
+
+ private String schema;<br />
+
+<br />
+
+ /**<br />
+
+ * A container for HTTP attributes that may persist from request to request<br />
+
+ */<br />
+
+ private HttpState state = new HttpState();<br />
+
+<br />
+
+ /**<br />
+
+ * Http connection<br />
+
+ */<br />
+
+ private HttpConnection connection = null;<br />
+
+<br />
+
+ /**<br />
+
+ * To obtain the http headers only<br />
+
+ */<br />
+
+ private static final int HEAD = 1;<br />
+
+<br />
+
+ /**<br />
+
+ * To obtain the response body<br />
+
+ */<br />
+
+ private static final int GET = 2;<br />
+
+<br />
+
+ /**<br />
+
+ * Max. number of redirects<br />
+
+ */<br />
+
+ private static final int MAX_NO_REDIRECTS = 10;<br />
+
+<br />
+
+ public HttpContent(URI uri) throws URISyntaxException, MalformedURLException {<br />
+
+ this(uri.toURL());<br />
+
+ }<br />
+
+<br />
+
+<br />
+
+ /**<br />
+
+ * Constructor.<br />
+
+ *<br />
+
+ * @param url The URL this object will be representing<br />
+
+ * the content of<br />
+
+ */<br />
+
+ public HttpContent(URL url) throws URISyntaxException {<br />
+
+<br />
+
+ // Validate "url" parameter<br />
+
+ if (url == null) {<br />
+
+<br />
+
+ throw new IllegalArgumentException("Null \"url\" parameter");<br />
+
+ }<br />
+
+<br />
+
+ initialiseSettings(url);<br />
+
+ }<br />
+
+<br />
+
+ /**<br />
+
+ * Initialise the basic settings for a connection<br />
+
+ *<br />
+
+ * @param url<br />
+
+ * location of source<br />
+
+ * @throws URISyntaxException<br />
+
+ * invalid URI<br />
+
+ */<br />
+
+ private void initialiseSettings(URL url) throws URISyntaxException {<br />
+
+<br />
+
+ // Convert the URL to a Uri<br />
+
+ httpUri = new URI(url.toExternalForm());<br />
+
+<br />
+
+ // obtain basic details for connections<br />
+
+ host = httpUri.getHost();<br />
+
+ port = httpUri.getPort();<br />
+
+ schema = httpUri.getScheme();<br />
+
+<br />
+
+ }<br />
+
+<br />
+
+ /**<br />
+
+ * Retrieves the node map used to ensure that blank nodes are consistent.<br />
+
+ *<br />
+
+ * @return The node map used to ensure that blank nodes are consistent<br />
+
+ */<br />
+
+ public Map getBlankNodeMap() {<br />
+
+<br />
+
+ return blankNodeMap;<br />
+
+ }<br />
+
+<br />
+
+ /**<br />
+
+ * Obtain the approrpriate connection method<br />
+
+ *<br />
+
+ * @param methodType<br />
+
+ * can be HEAD or GET<br />
+
+ * @return HttpMethodBase method<br />
+
+ */<br />
+
+ private HttpMethod getConnectionMethod(int methodType) {<br />
+
+<br />
+
+ if (methodType != GET && methodType != HEAD) {<br />
+
+ throw new IllegalArgumentException(<br />
+
+ "Invalid method base supplied for connection");<br />
+
+ }<br />
+
+<br />
+
+ Protocol protocol = Protocol.getProtocol(schema);<br />
+
+<br />
+
+ connection = new HttpConnection(host, port, protocol);<br />
+
+<br />
+
+ String proxyHost = System.getProperty("mulgara.httpcontent.proxyHost");<br />
+
+<br />
+
+ if (proxyHost != null && proxyHost.length() > 0) {<br />
+
+ connection.setProxyHost(proxyHost);<br />
+
+ }<br />
+
+<br />
+
+ String proxyPort = System.getProperty("mulgara.httpcontent.proxyPort");<br />
+
+ if (proxyPort != null && proxyPort.length() > 0) {<br />
+
+ connection.setProxyPort(Integer.parseInt(proxyPort));<br />
+
+ }<br />
+
+<br />
+
+ // default timeout to 30 seconds<br />
+
+ connection.setConnectionTimeout(Integer.parseInt(System.getProperty(<br />
+
+ "mulgara.httpcontent.timeout", "30000")));<br />
+
+<br />
+
+ String proxyUserName = System<br />
+
+ .getProperty("mulgara.httpcontent.proxyUserName");<br />
+
+ if (proxyUserName != null) {<br />
+
+ state.setCredentials(System.getProperty("mulgara.httpcontent.proxyRealm"),<br />
+
+ System.getProperty("mulgara.httpcontent.proxyRealmHost"),<br />
+
+ new UsernamePasswordCredentials(proxyUserName, System<br />
+
+ .getProperty("mulgara.httpcontent.proxyPassword")));<br />
+
+ }<br />
+
+<br />
+
+ HttpMethod method = null;<br />
+
+ if (methodType == HEAD) {<br />
+
+ method = new HeadMethod(httpUri.toString());<br />
+
+ }<br />
+
+ else {<br />
+
+ method = new GetMethod(httpUri.toString());<br />
+
+ }<br />
+
+<br />
+
+ if (connection.isProxied() && connection.isSecure()) {<br />
+
+ method = new ConnectMethod(method);<br />
+
+ }<br />
+
+<br />
+
+ // manually follow redirects due to the<br />
+
+ // strictness of http client implementation<br />
+
+<br />
+
+ method.setFollowRedirects(false);<br />
+
+<br />
+
+ return method;<br />
+
+ }<br />
+
+<br />
+
+ /**<br />
+
+ * Obtain a valid connection and follow redirects if neccessary<br />
+
+ *<br />
+
+ * @param methodType<br />
+
+ * request the headders (HEAD) or body (GET)<br />
+
+ * @return valid connection method. Can be null.<br />
+
+ * @throws IOException<br />
+
+ * @throws URISyntaxException<br />
+
+ */<br />
+
+ private HttpMethod establishConnection(int methodType) throws IOException {<br />
+
+<br />
+
+ HttpMethod method = this.getConnectionMethod(methodType);<br />
+
+ Header header = null;<br />
+
+<br />
+
+ if (method != null) {<br />
+
+ method.execute(state, connection);<br />
+
+ if (!isValidStatusCode(method.getStatusCode())) {<br />
+
+ throw new UnknownHostException("Unable to obtain connection to "<br />
+
+ + httpUri + ". Returned status code " + method.getStatusCode());<br />
+
+ }<br />
+
+ else {<br />
+
+ // has a redirection been issued<br />
+
+ int numberOfRedirection = 0;<br />
+
+ while (isRedirected(method.getStatusCode())<br />
+
+ && numberOfRedirection <= MAX_NO_REDIRECTS) {<br />
+
+<br />
+
+ // release the existing connection<br />
+
+ method.releaseConnection();<br />
+
+<br />
+
+ //attempt to follow the redirects<br />
+
+ numberOfRedirection++;<br />
+
+<br />
+
+ // obtain the new location<br />
+
+ header = method.getResponseHeader("location");<br />
+
+ if (header != null) {<br />
+
+ try {<br />
+
+ initialiseSettings(new URL(header.getValue()));<br />
+
+ if (logger.isInfoEnabled()) {<br />
+
+ logger.info("Redirecting to " + header.getValue());<br />
+
+ }<br />
+
+<br />
+
+ // attempt a new connection to this location<br />
+
+ method = this.getConnectionMethod(methodType);<br />
+
+ method.execute(state, connection);<br />
+
+ if (!isValidStatusCode(method.getStatusCode())) {<br />
+
+ throw new UnknownHostException(<br />
+
+ "Unable to obtain connection to " + " the redirected site "<br />
+
+ + httpUri + ". Returned status code "<br />
+
+ + method.getStatusCode());<br />
+
+ }<br />
+
+ }<br />
+
+ catch (URISyntaxException ex) {<br />
+
+ throw new IOException("Unable to follow redirection to "<br />
+
+ + header.getValue() + " Not a valid URI");<br />
+
+ }<br />
+
+ }<br />
+
+ else {<br />
+
+ throw new IOException("Unable to obtain redirecting detaild from "<br />
+
+ + httpUri);<br />
+
+ }<br />
+
+ }<br />
+
+ }<br />
+
+ }<br />
+
+ return method;<br />
+
+ }<br />
+
+<br />
+
+ /*<br />
+
+ * @see org.kowari.content.Content#getContentType()<br />
+
+ */<br />
+
+ public MimeType getContentType() {<br />
+
+<br />
+
+ MimeType mimeType = null;<br />
+
+ HeadMethod method = null;<br />
+
+ String contentType = null;<br />
+
+<br />
+
+ try {<br />
+
+<br />
+
+ // obtain connection and retrieve the headers<br />
+
+ method = (HeadMethod) establishConnection(HEAD);<br />
+
+ Header header = method.getResponseHeader("Content-Type");<br />
+
+ if (header != null) {<br />
+
+ contentType = header.getValue();<br />
+
+ mimeType = new MimeType(contentType);<br />
+
+ if (logger.isInfoEnabled()) {<br />
+
+ logger.info("Obtain content type " + mimeType + " from " + httpUri);<br />
+
+ }<br />
+
+ }<br />
+
+ }<br />
+
+ catch (MimeTypeParseException e) {<br />
+
+ logger.warn("Unable to parse " + contentType + " as a content type for "<br />
+
+ + httpUri);<br />
+
+ }<br />
+
+ catch (IOException e) {<br />
+
+ logger.info("Unable to obtain content type for " + httpUri);<br />
+
+ }<br />
+
+ catch (java.lang.IllegalStateException e) {<br />
+
+ logger.info("Unable to obtain content type for " + httpUri);<br />
+
+ }<br />
+
+ finally {<br />
+
+ if (method != null) {<br />
+
+ method.releaseConnection();<br />
+
+ }<br />
+
+ if (connection != null) {<br />
+
+ connection.close();<br />
+
+ }<br />
+
+ }<br />
+
+ return mimeType;<br />
+
+ }<br />
+
+<br />
+
+ /**<br />
+
+ * Retrieves the URI for the actual content.<br />
+
+ *<br />
+
+ * @return The URI for the actual content<br />
+
+ */<br />
+
+ public URI getURI() {<br />
+
+<br />
+
+ return httpUri;<br />
+
+ }<br />
+
+<br />
+
+ /**<br />
+
+ * Creates an input stream to the resource whose content we are representing.<br />
+
+ *<br />
+
+ * @return An input stream to the resource whose content we are representing<br />
+
+ * @throws IOException<br />
+
+ */<br />
+
+ public InputStream newInputStream() throws IOException {<br />
+
+<br />
+
+ // Create an input stream by opening the URL's input stream<br />
+
+ GetMethod method = null;<br />
+
+ InputStream inputStream = null;<br />
+
+<br />
+
+ // obtain connection and retrieve the headers<br />
+
+ method = (GetMethod) establishConnection(GET);<br />
+
+ inputStream = method.getResponseBodyAsStream();<br />
+
+ if (inputStream == null) {<br />
+
+ throw new IOException("Unable to obtain inputstream from " + httpUri);<br />
+
+ }<br />
+
+ return inputStream;<br />
+
+ }<br />
+
+<br />
+
+ private boolean isValidStatusCode(int status) {<br />
+
+ return (status == HttpStatus.SC_OK || isRedirected(status));<br />
+
+ }<br />
+
+<br />
+
+ private boolean isRedirected(int status) {<br />
+
+ return (status == HttpStatus.SC_TEMPORARY_REDIRECT<br />
+
+ || status == HttpStatus.SC_MOVED_TEMPORARILY<br />
+
+ || status == HttpStatus.SC_MOVED_PERMANENTLY || status == HttpStatus.SC_SEE_OTHER);<br />
+
+ }<br />
+
+<br />
+
+}</p>
+
+<p>An analysis of the class is as follows:</p>
+
+<p class="indentcommandtext">package org.kowari.resolver.http;<br />
+
+<br />
+
+//Local packages<br />
+
+import org.kowari.content.Content;<br />
+
+<br />
+
+// Java 2 standard packages<br />
+
+import java.io.*;<br />
+
+import java.net.URI;<br />
+
+import java.net.URISyntaxException;<br />
+
+import java.net.URL;<br />
+
+import java.net.MalformedURLException;<br />
+
+import java.net.UnknownHostException;<br />
+
+import java.util.*;<br />
+
+<br />
+
+// Apache HTTP Client<br />
+
+import org.apache.commons.httpclient.*;<br />
+
+import org.apache.commons.httpclient.protocol.Protocol;<br />
+
+import org.apache.commons.httpclient.methods.*;<br />
+
+import org.apache.log4j.Logger;<br />
+
+<br />
+
+// Java 2 enterprise packages<br />
+
+import javax.activation.MimeType;<br />
+
+import javax.activation.MimeTypeParseException;<br />
+
+<br />
+
+//Third party packages<br />
+
+import org.apache.log4j.Logger;</p>
+
+<p class="indent">The packaging for the content implementation is not required to be of any particular format. However, for the sake of neatness and ease of coding, it is recommended that the implementation be in the same package as your resolver implementation. The <code>org.kowari.content.Content</code> package requires importing to provide access to the <code>Content</code> interface, along with the packages <code>java.io.InputStream</code>, <code>java.io.IOException</code>, <code>java.util.Map</code>, <code>javax.activation.MimeType</code> and <code>java.net.URI</code>, which are used in the interface. Any other imports depend on your implementation of the interface.</p>
+
+<p class="indentcommandtext"> public class HttpContent implements Content {</p>
+
+<p class="indent">All <code>Content</code> implementation classes must implement the <code>Content</code> interface. It is possible that you are extending another content object, in which case the implementation is not necessary as long as the superclass handles the implementation.</p>
+
+<p class="indentcommandtext"> /**<br />
+
+ * Constructor.<br />
+
+ *<br />
+
+ * @param url The URL this object will be representing<br />
+
+ * the content of<br />
+
+ */<br />
+
+ public HttpContent(URL url) throws URISyntaxException {<br />
+
+<br />
+
+ // Validate "url" parameter<br />
+
+ if (url == null) {<br />
+
+<br />
+
+ throw new IllegalArgumentException("Null \"url\" parameter");<br />
+
+ }<br />
+
+<br />
+
+ initialiseSettings(url);<br />
+
+ }</p>
+
+<p class="indent">Constructors for <code>Content</code> implementations have no specific requirements as all instantiation is handled by the resolver. As long as the resolver knows how to create an instance, the format is not set. The main consideration for this method is what format your resource locations should be passed in as, since this determines how you create an input stream and transform the location into an URI. For http and https protocols, you can use URLs that are in a natural URI format. Since there is no exception handling on the <code>getURI()</code> method, we have to perform our URL to URI conversion during our constructor. We also initialize the blank node map object as a <code>HashMap</code> so that there will be a valid object when <code>getBlankNodeMap()</code> is called.</p>
+
+<p class="indentcommandtext"> /**<br />
+
+ * Retrieves the node map used to ensure that blank nodes are consistent.<br />
+
+ *<br />
+
+ * @return The node map used to ensure that blank nodes are consistent<br />
+
+ */<br />
+
+ public Map getBlankNodeMap() {<br />
+
+<br />
+
+ return blankNodeMap;<br />
+
+ }</p>
+
+<p class="indent">The <code>getBlankNodeMap()</code> method usually returns the variable containing our map object, unless some pre-processing is required. In the case of http content, you can get away with just returning the <code>HashMap</code> containing the mappings.</p>
+
+<p class="indentcommandtext"> /**<br />
+
+
+* Retrieves the URI for the actual content.<br />
+
+ *<br />
+
+ * @return The URI for the actual content<br />
+
+ */<br />
+
+ public URI getURI() {<br />
+
+<br />
+
+ return httpUri;<br />
+
+ }</p>
+
+<p class="indent"><code>Content</code> objects allow access to the original URI and should not throw any exceptions when the <code>getURI</code> method is called. If an exception does occur during the conversion of the resource's source object (for example, <code>java.net.URL</code>), then the URI creation should occur during the constructor and this method should return a global variable.</p>
+
+<p class="indentcommandtext">/*<br />
+
+ * @see org.kowari.content.Content#getContentType()<br />
+
+ */<br />
+
+ public MimeType getContentType() {<br />
+
+<br />
+
+ MimeType mimeType = null;<br />
+
+ HeadMethod method = null;<br />
+
+ String contentType = null;<br />
+
+<br />
+
+ try {<br />
+
+<br />
+
+ // obtain connection and retrieve the headers<br />
+
+ method = (HeadMethod) establishConnection(HEAD);<br />
+
+ Header header = method.getResponseHeader("Content-Type");<br />
+
+ if (header != null) {<br />
+
+ contentType = header.getValue();<br />
+
+ mimeType = new MimeType(contentType);<br />
+
+ if (logger.isInfoEnabled()) {<br />
+
+ logger.info("Obtain content type " + mimeType + " from " + httpUri);<br />
+
+ }<br />
+
+ }<br />
+
+ }<br />
+
+ catch (MimeTypeParseException e) {<br />
+
+ logger.warn("Unable to parse " + contentType + " as a content type for "<br />
+
+ + httpUri);<br />
+
+ }<br />
+
+ catch (IOException e) {<br />
+
+ logger.info("Unable to obtain content type for " + httpUri);<br />
+
+ }<br />
+
+ catch (java.lang.IllegalStateException e) {<br />
+
+ logger.info("Unable to obtain content type for " + httpUri);<br />
+
+ }<br />
+
+ finally {<br />
+
+ if (method != null) {<br />
+
+ method.releaseConnection();<br />
+
+ }<br />
+
+ if (connection != null) {<br />
+
+ connection.close();<br />
+
+ }<br />
+
+ }<br />
+
+ return mimeType;<br />
+
+ }</p>
+
+<p class="indent">Most content handlers are written to handle content of a certain type, which subsequently has a mime type associated with it. When the resolver receives a model to resolve, it cycles through the list of registered content handlers and when it finds one that can parse the data, it hands over the content object for parsing. To find out if a content object can be handled by the handler, the <code>getContentType()</code> method can be invoked to retrieve the file's mime type. For http resources, you can use the connection headers to determine the mime type.</p>
+
+<p class="indentcommandtext"> /**<br />
+
+ * Creates an input stream to the resource whose content we are representing.<br />
+
+ *<br />
+
+ * @return An input stream to the resource whose content we are representing<br />
+
+ * @throws IOException<br />
+
+ */<br />
+
+ public InputStream newInputStream() throws IOException {<br />
+
+<br />
+
+ // Create an input stream by opening the URL's input stream<br />
+
+ GetMethod method = null;<br />
+
+ InputStream inputStream = null;<br />
+
+<br />
+
+ // obtain connection and retrieve the headers<br />
+
+ method = (GetMethod) establishConnection(GET);<br />
+
+ inputStream = method.getResponseBodyAsStream();<br />
+
+ if (inputStream == null) {<br />
+
+ throw new IOException("Unable to obtain inputstream from " + httpUri);<br />
+
+ }<br />
+
+ return inputStream;<br />
+
+ }</p>
+
+<p class="indent"><code>ContentHandler</code> implementations require some way to access the actual content of a resource in order to convert it to RDF triples. This is done in the form of an <code>InputStream</code>. This means that the resource pointer the <code>Content</code> object is based around should be able to be create an <code>InputStream</code> in some way. As previously stated, you could normally use the <code>openStream()</code> method of the URL class to create an input stream from the resource, but the https support requires a more complex method. Using the <code>HttpConnection</code> class of the apache commons <code>httpclient</code> jar you are able to use a <code>GET</code> method call to the server to stream the data to the handler.</p>
+
+<p class="indent">The other methods in the class not outlined here are all unique to the http content object and irrelevant to other content types.</p>
+
+
+
+
+
+</td>
+</tr>
+<tr valign="bottom">
+<td>
+<br />
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/resolverwrite.html
===================================================================
--- trunk/docs/site/integration/resolverwrite.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/resolverwrite.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,288 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Resolvers</title>
+ <meta name="keywords" content="Resolvers, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+ <a href="/integration/resolverwrite.html#o2950">Writing a Resolver</a>
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/resolverwrapper.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/contenthandlersdev.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/resolveprot.html">Developing Protocol Resolvers</a></p>
+<p class="relateditem"><a href="/integration/resolverfactories.html">Factories</a></p>
+<p class="relateditem"><a href="/integration/resolverwrapper.html">Content Wrappers</a></p>
+
+ -->
+
+
+
+
+<h4>Resolvers</h4>
+
+<p>Once the <a id="h2947" class="documentlinktemplate" title="Factories" href="/integration/resolverfactories.html">factory</a> and <a id="h2948" class="documentlinktemplate" title="Content Wrappers" href="/integration/resolverwrapper.html">content wrapper</a> are written, the final step is to create the resolver. Resolver instances are created on an as required basis by the resolver factory and are responsible for taking a model URI and performing model creation, deletion, modification, or querying against constraints.</p>
+
+<p>Most often a resolver is written to resolve constraints against a file or store that is not naturally in RDF, with the protocol managed by a <code>Resolver</code> implementation, and the content to triples conversion managed by a <code>ContentHandler</code> implementation. For this reason, if a new mime type is to be resolved then a <code>ContentHandler</code> should be written instead of a <code>Resolver</code>, and vice versa for new protocols.</p>
+
+<p>Most of the design decisions should already have been made during the creation of the factory and content classes, leaving the process of actually resolving a query for the resolver. However, you do need to decide what operations are permitted on models of this protocol type. Since querying a model is compulsory (as it is the main purpose of a resolver) that leaves model creation, modification of data and removal of models. For the moment you want the protocol resolver to just read and resolve constraints against the triples without any model manipulation. If you are writing an <a id="h2564" class="documentlinktemplate" title="Internal Resolvers" href="/resolvers/resolverdbclass.html#o2559">internal resolver</a>, then it is important to implement these methods.</p>
+
+<div class="anchor"><a name="o2950"> </a></div>
+<h5>Writing a Resolver</h5>
+
+<p>A <code>Resolver</code> implementation requires two classes, the <code>Content</code> implementation for handling content under the resolver's protocol and the <code>Resolver</code> implementation itself. Instances of the class are created by the factory and are given constraints to resolve the query against which are used in conjunction with <code>Statements</code> found by the <code>ContentHandler</code>, which matches the mime type of the resource. In addition to query resolution, it should also handle model creation, deletion, or content modification if required.</p>
+
+<p>The following source is how the http protocol resolver is written (extracted from <code>HttpResolver.java</code>):</p>
+
+<p class="commandtext">package org.kowari.resolver.http;<br />
+<br />
+// Java 2 standard packages<br />
+import java.net.*;<br />
+import java.util.*;<br />
+<br />
+// Third party packages<br />
+import org.apache.log4j.Logger;<br />
+import org.jrdf.graph.Node;<br />
+import org.jrdf.graph.URIReference;<br />
+<br />
+// Locally written packages<br />
+import org.kowari.content.Content;<br />
+import org.kowari.content.ContentHandler;<br />
+import org.kowari.content.ContentHandlerManager;<br />
+import org.kowari.content.ContentHandlerException;<br />
+import org.kowari.content.ContentResolver;<br />
+import org.kowari.resolver.spi.*;<br />
+<br />
+public class HttpResolver extends ContentResolver {<br />
+ /**<br />
+ * Logger.<br />
+ */<br />
+ private static Logger logger = Logger.getLogger(HttpResolver.class.getName());<br />
+<br />
+ /**<br />
+ * Construct a resolver.<br />
+ *<br />
+ * @param resolverSession the session this resolver is associated with<br />
+ * @param contentHandlers the available {@link ContentHandler}s<br />
+ * @throws IllegalArgumentException if resolverSession is<br />
+ * null<br />
+ */<br />
+ HttpResolver(ResolverSession resolverSession,<br />
+ Resolver systemResolver,<br />
+ ContentHandlerManager contentHandlers) {<br />
+<br />
+ super(resolverSession, systemResolver, contentHandlers);<br />
+ }<br />
+<br />
+ //<br />
+ // Methods implementing ContentResolver<br />
+ //<br />
+<br />
+ /**<br />
+ * Convert a local node number representing a http: model into<br />
+ * {@link HttpContent}.<br />
+ *<br />
+ * @param model the local node number of a http: URL<br />
+ * @throws ResolverException if the model doesn't correspond to a<br />
+ * {@link URL} with the http: protocol.<br />
+ */<br />
+ protected Content toContent(long model) throws ResolverException {<br />
+<br />
+ // Container for our model's URI<br />
+ URI modelURI;<br />
+<br />
+ // Container for our globalised node<br />
+ Node globalModel = null;<br />
+<br />
+ try {<br />
+<br />
+ // Globalise the model<br />
+ globalModel = resolverSession.globalize(model);<br />
+ } catch (GlobalizeException e) {<br />
+<br />
+ throw new ResolverException("Couldn't globalize http model", e);<br />
+ }<br />
+<br />
+ if (!(globalModel instanceof URIReference)) {<br />
+<br />
+ // Check that our node is a URIReference<br />
+ throw new ResolverException(<br />
+ "Model parameter " + globalModel + " isn't a URI reference");<br />
+ }<br />
+<br />
+ // Get the URI from the globalised node<br />
+ modelURI = ((URIReference) globalModel).getURI();<br />
+<br />
+ assert modelURI != null;<br />
+<br />
+ // Validate the URI<br />
+ if (!modelURI.getScheme().toLowerCase().startsWith("http")) {<br />
+<br />
+ throw new ResolverException(modelURI + " doesn't use the http(s): scheme");<br />
+ }<br />
+<br />
+ // Container for our URL<br />
+ URL modelURL = null;<br />
+<br />
+ try {<br />
+<br />
+ // Convert the URI to a URL<br />
+ modelURL = modelURI.toURL();<br />
+ } catch (MalformedURLException malformedURLException) {<br />
+<br />
+ throw new ResolverException(<br />
+ "Failed to convert the model's URI to a valid URL [" +<br />
+ modelURI +"]", malformedURLException);<br />
+ }<br />
+<br />
+ try {<br />
+ return new HttpContent(modelURL);<br />
+ }<br />
+ catch (URISyntaxException e) {<br />
+ throw new ResolverException(<br />
+ "Couldn't create HttpContent from " + modelURL, e<br />
+ );<br />
+ }<br />
+ }<br />
+}</p>
+
+<p>An analysis of the class is as follows:</p>
+
+<p class="indentcommandtext">package org.kowari.resolver.http;<br />
+<br />
+// Java 2 standard packages<br />
+import java.net.*;<br />
+import java.util.*;<br />
+<br />
+// Third party packages<br />
+import org.apache.log4j.Logger;<br />
+import org.jrdf.graph.Node;<br />
+import org.jrdf.graph.URIReference;<br />
+<br />
+// Locally written packages<br />
+import org.kowari.content.Content;<br />
+import org.kowari.content.ContentHandler;<br />
+import org.kowari.content.ContentHandlerManager;<br />
+import org.kowari.content.ContentHandlerException;<br />
+import org.kowari.content.ContentResolver;<br />
+import org.kowari.resolver.spi.*;</p>
+
+<p class="indent">Due to the way resolvers are constructed, the packaging should be set up so that they are always in the same package as their factory. Resolvers also require access to the <code>Resolver</code> SPI and tuples packages. Extra imports depend on your specific implementation.</p>
+
+<p class="indentcommandtext"> public class HttpResolver implements ContentResolver {</p>
+
+<p class="indent">Most of the implementation for resolvers is already managed in the <code>ContentResolver</code> class, which should be extended for a protocol resolver or any other resolver involving <code>Content</code> implementations. If the resolver being written is not a protocol resolver, then a proper implementation of the <code>Resolver</code> interface should be written. This is not covered in this tutorial.</p>
+
+<p class="indentcommandtext"> /**<br />
+ * Construct a resolver.<br />
+ *<br />
+ * @param resolverSession the session this resolver is associated with<br />
+ * @param contentHandlers the available {@link ContentHandler}s<br />
+ * @throws IllegalArgumentException if resolverSession is<br />
+ * null<br />
+ */<br />
+ HttpResolver(ResolverSession resolverSession,<br />
+ Resolver systemResolver,<br />
+ ContentHandlerManager contentHandlers) {<br />
+<br />
+ super(resolverSession, systemResolver, contentHandlers);<br />
+ }</p>
+
+<p class="indent">Resolver constructors should be package specific as all creation and instantiation occurs within the factory and nowhere else. To comply with the super class, they require a <code>ResolverSession</code> to allow for globalization and localization of nodes, a link to the system resolver and the <code>ContentHandlerManager</code> object, which contains a list all the content handlers available in the database. Extra parameters can be used as long as the factory is set up to manage them. Usually a resolver only needs to call the super constructor, but if extra initialization needs to be carried out then it can also be done in the constructor.</p>
+
+<p class="indentcommandtext"> /**<br />
+ * Convert a local node number representing a http: model into<br />
+ * {@link HttpContent}.<br />
+ *<br />
+ * @param model the local node number of a http: URL<br />
+ * @throws ResolverException if the model doesn't correspond to a<br />
+ * {@link URL} with the http: protocol.<br />
+ */<br />
+ protected Content toContent(long model) throws ResolverException {<br />
+<br />
+ // Container for our model's URI<br />
+ URI modelURI;<br />
+<br />
+ // Container for our globalised node<br />
+ Node globalModel = null;<br />
+<br />
+ try {<br />
+<br />
+ // Globalise the model<br />
+ globalModel = resolverSession.globalize(model);<br />
+ } catch (GlobalizeException e) {<br />
+<br />
+ throw new ResolverException("Couldn't globalize http model", e);<br />
+ }<br />
+<br />
+ if (!(globalModel instanceof URIReference)) {<br />
+<br />
+ // Check that our node is a URIReference<br />
+ throw new ResolverException(<br />
+ "Model parameter " + globalModel + " isn't a URI reference");<br />
+ }<br />
+<br />
+ // Get the URI from the globalised node<br />
+ modelURI = ((URIReference) globalModel).getURI();<br />
+<br />
+ assert modelURI != null;<br />
+<br />
+ // Validate the URI<br />
+ if (!modelURI.getScheme().toLowerCase().startsWith("http")) {<br />
+<br />
+ throw new ResolverException(modelURI + " doesn't use the http(s): scheme");<br />
+ }<br />
+<br />
+ // Container for our URL<br />
+ URL modelURL = null;<br />
+<br />
+ try {<br />
+<br />
+ // Convert the URI to a URL<br />
+ modelURL = modelURI.toURL();<br />
+ } catch (MalformedURLException malformedURLException) {<br />
+<br />
+ throw new ResolverException(<br />
+ "Failed to convert the model's URI to a valid URL [" +<br />
+ modelURI +"]", malformedURLException);<br />
+ }<br />
+<br />
+ try {<br />
+ return new HttpContent(modelURL);<br />
+ }<br />
+ catch (URISyntaxException e) {<br />
+ throw new ResolverException(<br />
+ "Couldn't create HttpContent from " + modelURL, e<br />
+ );<br />
+ }<br />
+ }</p>
+
+<p class="indent">The only compulsory method for a resolver is the <code>toContent(long)</code> method, which is used by the super class to obtain a content object that is suitable for the desired protocol. It is responsible for taking the model node id passed in and creating a <code>Content</code> object that encapsulates the data represented by the model for resolving against the constraints. Since models are passed in as a node id, they should be globalized to obtain the proper URI that can then be verified and used in a <code>Content</code> object.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/searchgraph.html
===================================================================
--- trunk/docs/site/integration/searchgraph.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/searchgraph.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,110 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Searching the Graph</title>
+ <meta name="keywords" content="Search, Graph, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/jrdfaddtriples.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/jrdfreify.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/jrdftutorial.html">JRDF Tutorial</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html">Prerequisites</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2898">Obtaining a Session from a Mulgara Server</a></p>
+<p class="relateditem"><a href="/integration/jrdfprereq.html#o2899">Comparison of JRDF Graph Implementations</a></p>
+<p class="relateditem"><a href="/integration/jrdfcreategraph.html">Creating the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfcreatenodes.html">Creating Nodes and Triples</a></p>
+<p class="relateditem"><a href="/integration/jrdfaddtriples.html">Adding Triples to the Graph</a></p>
+<p class="relateditem"><a href="/integration/jrdfreify.html">Reify Triples</a></p>
+<p class="relateditem"><a href="/integration/jrdfremove.html">Removing Triples from the Graph</a></p>
+
+
+ -->
+
+
+
+
+<h3>Searching the Graph</h3>
+
+<p>You can search a graph using it's <code>find(Triple triple)</code> method. The nodes in the triple are used to match the nodes in the graph. Any null nodes in the triple are treated as wildcards and match to any node in the graph.</p>
+
+<p>Triples are returned in the form of a <code>ClosableIterator,</code> which extends <code>Iterator</code> and has a <code>close()</code> method that is used to free resources. Calling <code>next()</code> on a <code>ClosableIterator</code> returns a triple object. Triples are not guaranteed to be returned in any specific order.</p>
+
+<p>The following code examples demonstrate using the <code>find(Triple triple)</code> method to search a graph.</p>
+
+<p>To search for all triples:</p>
+
+<p class="commandtext">//get all Triples <br />
+Triple findAll = elementFactory.createTriple(null, null, null); <br />
+ClosableIterator allTriples = graph.find(findAll);</p>
+
+<p>This returns:</p>
+
+<p class="commandtext">http://example.org/staffid#85740 http://example.org/terms#address _blankNode123<br />
+_blankNode123 http://example.org/terms#street "1501 Grant Avenue"<br />
+_blankNode123 http://example.org/terms#city "Bedford"<br />
+_blankNode123 http://example.org/terms#state "Massachusetts"<br />
+_blankNode123 http://example.org/terms#postalCode "01730"</p>
+
+<p>To search for all addresses:</p>
+
+<p class="commandtext">//search for address (as a subject)<br />
+Triple findAddress = elementFactory.createTriple(address, null, null);<br />
+ClosableIterator addressSubject = graph.find(findAddress);</p>
+
+<p>This returns:</p>
+
+<p class="commandtext">_blankNode123 http://example.org/terms#street "1501 Grant Avenue"<br />
+_blankNode123 http://example.org/terms#city "Bedford"<br />
+_blankNode123 http://example.org/terms#state "Massachusetts"<br />
+_blankNode123 http://example.org/terms#postalCode "01730"</p>
+
+<p>To search for a city:</p>
+
+<p class="commandtext">//search for the city: "Bedford"<br />
+Triple findCity = elementFactory.createTriple(null, null, city);<br />
+ClosableIterator bedfordCity = graph.find(findCity);</p>
+
+<p>This returns:</p>
+
+<p class="commandtext">_blankNode123 http://example.org/terms#city "Bedford"</p>
+
+<p>To search for subjects with an address property:</p>
+
+<p class="commandtext">//search for any subject that has an address<br />
+Triple findAddresses = elementFactory.createTriple(null, hasAddress, null);<br />
+ClosableIterator addresses = graph.find(findAddresses);</p>
+
+<p>This returns:</p>
+
+<p class="commandtext">http://example.org/staffid#85740 http://example.org/terms#address _blankNode123</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/integration/statements.html
===================================================================
--- trunk/docs/site/integration/statements.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/integration/statements.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,1209 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Statements</title>
+ <meta name="keywords" content="Statements, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/integration/statements.html#o2952">Implementing the Interface</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/parsers.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/integration/compiling.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/integration/contenthandlersdev.html">Developing Content Handlers</a></p>
+<p class="relateditem"><a href="/integration/contenthandlers.html">Content Handlers</a></p>
+<p class="relateditem"><a href="/integration/parsers.html">Parsers</a></p>
+
+ -->
+
+
+
+
+<h4>Statements</h4>
+
+<p>Once the content handler and parser are written, the last step is to create the <code>Statements</code> implementation that navigates the results of the parser's work. <code>Statements</code> objects hold and navigate the triples generated by the parser and are an integral part of any resolver. They are the only component of the content handling side of resolvers that are passed back to the <code>Resolver</code> SPI to have constraints resolved against.</p>
+
+<p>With the <code>Statements</code> implementation you need to decide how it navigates the triples generated by the parsing classes. For the MP3 statements a JRDF <code>Graph</code> is available that has features to allow for the retrieval of an iterator that can be used to navigate the parsed content of the file. The <code>MP3Statements</code> object also handles the parsing of the file content into triples.</p>
+
+
+<div class="anchor"><a name="o2952"> </a></div>
+<h5>Implementing the Interface</h5>
+
+<p>After deciding on the best method of navigating the generated statements, it is relatively straightforward to implement the interface. The following code is the MP3 implementation using a JRDF <code>Graph</code> (see <code>MP3Statements.java</code>):</p>
+
+<p class="commandtext">package org.kowari.content.mp3;<br />
+<br />
+// Java 2 standard packages<br />
+import java.io.*;<br />
+import java.net.URI;<br />
+import java.net.URISyntaxException;<br />
+import java.net.URL;<br />
+import java.net.MalformedURLException;<br />
+import java.util.*;<br />
+import org.xml.sax.*;<br />
+<br />
+// Third party packages<br />
+import org.jrdf.graph.*;<br />
+import org.jrdf.graph.mem.*;<br />
+import org.apache.log4j.Logger; // Apache Log4J<br />
+import org.jrdf.graph.*; // JRDF<br />
+import org.jrdf.util.ClosableIterator; // JRDF<br />
+import org.jrdf.graph.*; // JRDF<br />
+import org.farng.mp3.MP3File;<br />
+import org.farng.mp3.TagException;<br />
+<br />
+// Locally written packages<br />
+import org.kowari.query.Constraint;<br />
+import org.kowari.query.QueryException;<br />
+import org.kowari.query.TuplesException;<br />
+import org.kowari.query.Variable;<br />
+import org.kowari.query.rdf.*;<br />
+import org.kowari.resolver.spi.LocalizeException;<br />
+import org.kowari.resolver.spi.Statements;<br />
+import org.kowari.resolver.spi.ResolverSession;<br />
+import org.kowari.store.StoreException;<br />
+import org.kowari.store.tuples.AbstractTuples;<br />
+import org.kowari.store.tuples.Tuples;<br />
+import org.kowari.content.Content;<br />
+import org.kowari.content.mp3.parser.*;<br />
+import org.kowari.content.mp3.parser.exception.*;<br />
+import org.kowari.content.mp3.parser.api.*;<br />
+<br />
+public class MP3Statements extends AbstractTuples implements Statements {<br />
+<br />
+ /** Logger. */<br />
+ private static Logger logger =<br />
+ Logger.getLogger(MP3Statements.class.getName());<br />
+<br />
+ /** Column index for subjects */<br />
+ public static final int SUBJECT = 0;<br />
+<br />
+ /** Column index for predicates */<br />
+ public static final int PREDICATE = 1;<br />
+<br />
+ /** Column index for predicates */<br />
+ public static final int OBJECT = 2;<br />
+<br />
+ /** The session used to globalize the RDF nodes from the stream. */<br />
+ private ResolverSession resolverSession;<br />
+<br />
+ /** The queue of triples generated by the ID3 parser. */<br />
+ private ArrayList triples;<br />
+<br />
+ /** The number of statements in the ID3 tag. */<br />
+ private long rowCount;<br />
+<br />
+ /** The current row. If the cursor is not on a row, this will be null */<br />
+ private Triple tripleStatement;<br />
+<br />
+ /** An interator into triples positioned at the next triple. */<br />
+ private ClosableIterator nextTriple;<br />
+<br />
+ /** The content representing the MP3 file */<br />
+ private Content content;<br />
+<br />
+ /** The model which will store the content of parsed mp3 files */<br />
+ private Graph model;<br />
+<br />
+ /**<br />
+ * Map ARP anonymous node IDs to {@link BlankNode}s.<br />
+ *<br />
+ * This is null if no parsing is in progress.<br />
+ */<br />
+ private Map blankNodeMap = null;<br />
+<br />
+ //<br />
+ // Constructors<br />
+ //<br />
+<br />
+ /**<br />
+ * Construct an RDF/XML stream parser.<br />
+ *<br />
+ * @param content the content object representing our MP3 file<br />
+ * @param resolverSession session against which to localize RDF nodes<br />
+ * @throws IllegalArgumentException if inputStream or<br />
+ * resolverSession are null<br />
+ * @throws TuplesException if the inputStream can't be parsed as<br />
+ * RDF/XML<br />
+ */<br />
+ MP3Statements(Content content, ResolverSession resolverSession) throws<br />
+ TuplesException {<br />
+<br />
+ // Validate "content" parameter<br />
+ if (content == null) {<br />
+ throw new IllegalArgumentException("Null \"content\" parameter");<br />
+ }<br />
+<br />
+ // Validate "resolverSession" parameter<br />
+ if (resolverSession == null) {<br />
+ throw new IllegalArgumentException("Null \"resolverSession\" parameter");<br />
+ }<br />
+<br />
+ // Initialize fields<br />
+ this.content = content;<br />
+ this.resolverSession = resolverSession;<br />
+ this.triples = new ArrayList();<br />
+<br />
+ // Fix the magical column names for RDF statements<br />
+ setVariables(new Variable[] {new Variable("subject"),<br />
+ new Variable("predicate"),<br />
+ new Variable("object")});<br />
+<br />
+ try {<br />
+<br />
+ // Initialise the parser factory<br />
+ ParserFactory.getInstance().initialiseFactory();<br />
+ } catch (FactoryException factoryException) {<br />
+<br />
+ throw new TuplesException("Unable to initialise factory for parsers.",<br />
+ factoryException);<br />
+ }<br />
+<br />
+ // Load in the RDF conversion of the given mp3 content<br />
+ loadURL();<br />
+ }<br />
+<br />
+ /**<br />
+ * Load in the RDF conversion from the content object.<br />
+ *<br />
+ * @throws TuplesException<br />
+ */<br />
+ private void loadURL() throws TuplesException {<br />
+<br />
+ // Discard any existing statements<br />
+ triples.clear();<br />
+<br />
+ try {<br />
+<br />
+ // Initialise the model to be a memory based graph<br />
+ model = new GraphImpl();<br />
+ } catch (GraphException graphException) {<br />
+<br />
+ throw new TuplesException("Unable to create a new graph object.",<br />
+ graphException);<br />
+ }<br />
+<br />
+ // Create a container for our file<br />
+ File contentFile = null;<br />
+<br />
+ if (!content.getURI().getScheme().equals("file")) {<br />
+<br />
+ // If we are dealing with anything other than a file then use the<br />
+ // caching process<br />
+<br />
+ try {<br />
+<br />
+ // Convert the URI into a file<br />
+ contentFile = getCachedFile(content.newInputStream(), content.getURI());<br />
+ } catch (IOException ioException) {<br />
+<br />
+ throw new TuplesException(<br />
+ "Unable to open a stream to the content file [" +<br />
+ content.getURI().toString() + "]", ioException);<br />
+ }<br />
+ } else {<br />
+<br />
+ // Files are local and do not need caching<br />
+ contentFile = new File(content.getURI());<br />
+ }<br />
+<br />
+ // Parse the content of the file/directory to the model<br />
+ parseFile(contentFile);<br />
+<br />
+ // Parse the stream into RDF statements<br />
+ blankNodeMap = new HashMap();<br />
+<br />
+ try {<br />
+<br />
+ // Initialize the metadata now that we know the statements<br />
+ rowCount = model.getNumberOfTriples();<br />
+ } catch (GraphException graphException) {<br />
+<br />
+ throw new TuplesException(<br />
+ "Unable to retrieve number of triples in graph.",<br />
+ graphException);<br />
+ }<br />
+<br />
+ if (logger.isDebugEnabled()) {<br />
+<br />
+ logger.debug("Parsed MP3: Found " + rowCount + " triples");<br />
+ }<br />
+ }<br />
+<br />
+ //<br />
+ // Methods implementing Statements<br />
+ //<br />
+<br />
+ /**<br />
+ * Retrieves the value contained in the subject column for the current triple.<br />
+ *<br />
+ * @return The subject value for the current triple<br />
+ *<br />
+ * @throws TuplesException<br />
+ */<br />
+ public long getSubject() throws TuplesException {<br />
+<br />
+ return getColumnValue(SUBJECT);<br />
+ }<br />
+<br />
+ /**<br />
+ * Retrieves the value contained in the predicate column for the current triple.<br />
+ *<br />
+ * @return The predicate value for the current triple<br />
+ *<br />
+ * @throws TuplesException<br />
+ */<br />
+ public long getPredicate() throws TuplesException {<br />
+<br />
+ return getColumnValue(PREDICATE);<br />
+ }<br />
+<br />
+ /**<br />
+ * Retrieves the value contained in the object column for the current triple.<br />
+ *<br />
+ * @return The object value for the current triple<br />
+ *<br />
+ * @throws TuplesException<br />
+ */<br />
+ public long getObject() throws TuplesException {<br />
+<br />
+ return getColumnValue(OBJECT);<br />
+ }<br />
+<br />
+ //<br />
+ // Methods implementing AbstractTuples<br />
+ //<br />
+<br />
+ /**<br />
+ * Resets the counter for triples to be the first.<br />
+ *<br />
+ * @param prefix The prefix to use<br />
+ * @param suffixTruncation The truncation of suffixes to use<br />
+ *<br />
+ * @throws TuplesException<br />
+ */<br />
+ public void beforeFirst(long[] prefix, int suffixTruncation) throws<br />
+ TuplesException {<br />
+<br />
+ try {<br />
+<br />
+ // Get the iterator for statements in the model<br />
+ nextTriple = model.find(null, null, null);<br />
+ } catch (GraphException graphException) {<br />
+<br />
+ throw new TuplesException("Unable to retrieve triple iterator for graph.",<br />
+ graphException);<br />
+ }<br />
+<br />
+ if (logger.isDebugEnabled()) {<br />
+<br />
+ try {<br />
+<br />
+ logger.debug("-- Getting the before first value from model " + model +<br />
+ " which has statements " + nextTriple.hasNext() + " from " +<br />
+ model.getNumberOfTriples() + " triples");<br />
+ } catch (GraphException graphException) {<br />
+<br />
+ // Since we are debugging, it is not important if this exception is<br />
+ // ignored<br />
+ }<br />
+ }<br />
+ }<br />
+<br />
+ public Object clone() {<br />
+<br />
+ MP3Statements cloned = (MP3Statements)super.clone();<br />
+<br />
+ // Copy immutable fields by reference<br />
+ cloned.resolverSession = resolverSession;<br />
+ cloned.rowCount = rowCount;<br />
+ cloned.tripleStatement = tripleStatement;<br />
+ cloned.content = content;<br />
+<br />
+ // Copy mutable fields by value<br />
+ cloned.triples = (ArrayList) triples.clone();<br />
+<br />
+ return cloned;<br />
+ }<br />
+<br />
+ /**<br />
+ * Close the RDF/XML formatted input stream.<br />
+ */<br />
+ public void close() throws TuplesException {<br />
+<br />
+ resolverSession = null;<br />
+ tripleStatement = null;<br />
+ triples = null;<br />
+ content = null;<br />
+ }<br />
+<br />
+ /**<br />
+ * @param column 0 for the subject, 1 for the predicate, 2 for the object<br />
+ */<br />
+ public long getColumnValue(int column) throws TuplesException {<br />
+<br />
+ // Pull the appropriate field from the current triple as a JRDF Node<br />
+ Node node = null;<br />
+<br />
+ switch (column) {<br />
+ case SUBJECT:<br />
+<br />
+ // Try creating the node with a URI reference<br />
+ node = tripleStatement.getSubject();<br />
+<br />
+ break;<br />
+ case PREDICATE:<br />
+<br />
+ // Try to create a URI reference node to represent the predicate<br />
+ node = tripleStatement.getPredicate();<br />
+<br />
+ break;<br />
+ case OBJECT:<br />
+<br />
+ // Create a literal node with the value for objects<br />
+ node = tripleStatement.getObject();<br />
+<br />
+ break;<br />
+ default:<br />
+<br />
+ throw new TuplesException("No such column " + column);<br />
+ }<br />
+ assert node != null;<br />
+<br />
+ // Localize the node<br />
+ try {<br />
+<br />
+ return resolverSession.localize(node);<br />
+ } catch (LocalizeException e) {<br />
+<br />
+ throw new TuplesException("Couldn't get column " + column + " value", e);<br />
+ }<br />
+ }<br />
+<br />
+ public List getOperands() {<br />
+<br />
+ return Collections.EMPTY_LIST;<br />
+ }<br />
+<br />
+ public long getRowCount() throws TuplesException {<br />
+<br />
+ return rowCount;<br />
+ }<br />
+<br />
+ public long getRowUpperBound() throws TuplesException {<br />
+<br />
+ return getRowCount();<br />
+ }<br />
+<br />
+ public boolean hasNoDuplicates() throws TuplesException {<br />
+<br />
+ return false;<br />
+ }<br />
+<br />
+ public boolean isColumnEverUnbound(int column) throws TuplesException {<br />
+<br />
+ switch (column) {<br />
+<br />
+ case 0:<br />
+<br />
+ case 1:<br />
+<br />
+ case 2:<br />
+<br />
+ return false;<br />
+ default:<br />
+<br />
+ throw new TuplesException("No such column " + column);<br />
+ }<br />
+ }<br />
+<br />
+ public boolean next() throws TuplesException {<br />
+<br />
+ if (nextTriple.hasNext()) {<br />
+<br />
+ // Get the next statement in the iterator<br />
+ tripleStatement = (Triple) nextTriple.next();<br />
+<br />
+ if (logger.isDebugEnabled()) {<br />
+<br />
+ logger.debug("-- Getting next statement: " + tripleStatement.toString());<br />
+ }<br />
+<br />
+ return true;<br />
+ } else {<br />
+<br />
+ tripleStatement = null;<br />
+<br />
+ return false;<br />
+ }<br />
+ }<br />
+<br />
+ /**<br />
+ * Checks whether the given file is a file or directory and then acts<br />
+ * accordingly. It should not be confused with the parseFile method which<br />
+ * does the actual conversion from an ID3 tag to RDF. This method is<br />
+ * recursive so subdirectories will be navigated.<br />
+ *<br />
+ * @param file The file or directory we are checking the content of<br />
+ *<br />
+ * @throws TuplesException<br />
+ */<br />
+ private void parseFile(File file) throws TuplesException {<br />
+<br />
+ if (file.getName().endsWith(".mp3")) {<br />
+<br />
+ // If the file is a valid mp3 file then parse the content into the model<br />
+<br />
+ // Container for our mp3 file<br />
+ MP3File mp3File = null;<br />
+<br />
+ try {<br />
+<br />
+ // Create a new MP3 file to represent our content<br />
+ mp3File = new MP3File(file);<br />
+ } catch (IOException ioException) {<br />
+<br />
+ throw new TuplesException("Unable to create mp3 file object for path: " +<br />
+ file.getAbsolutePath(), ioException);<br />
+ } catch (TagException tagException) {<br />
+<br />
+ throw new TuplesException("Unable to read ID3 tags for file: " +<br />
+ file.getAbsolutePath(), tagException);<br />
+ }<br />
+<br />
+ // Create a container for our file id<br />
+ String fileId = "";<br />
+<br />
+ // Try to use the file uri as the id<br />
+ fileId = file.toURI().toString();<br />
+<br />
+ // Create a new conversion object<br />
+ MP3Conversion conversion = new MP3Conversion(mp3File, model, fileId);<br />
+<br />
+ // Container for our parser object<br />
+ ID3Parser parser = null;<br />
+<br />
+ try {<br />
+<br />
+ // Get a parser instance<br />
+ parser = ParserFactory.getInstance().createID3Parser();<br />
+ } catch (FactoryException factoryException) {<br />
+<br />
+ throw new TuplesException(<br />
+ "Unable to create a new ID3Parser due to a factory error.",<br />
+ factoryException);<br />
+ }<br />
+<br />
+ try {<br />
+<br />
+ // Parse the mp3 into the model<br />
+ parser.parseTags(conversion);<br />
+ } catch (ParserException parserException) {<br />
+<br />
+ throw new TuplesException("Unable to parse tags for file: " +<br />
+ content.getURI().toString(), parserException);<br />
+ }<br />
+ } else {<br />
+<br />
+ throw new TuplesException("Content object did not contain a valid mime " +<br />
+ "type for parsing.");<br />
+ }<br />
+ }<br />
+<br />
+ /**<br />
+ * Creates a locally cached version of a file from an input stream. If the<br />
+ * file already exists then it will not download the file but instead use the<br />
+ * cached version.<br />
+ *<br />
+ * @param inputStream The stream of data we are caching<br />
+ * @param uri The uri of the data we are caching<br />
+ *<br />
+ * @return The file handle to the cached file<br />
+ *<br />
+ * @throws TuplesException<br />
+ */<br />
+ private File getCachedFile(InputStream inputStream, URI uri) throws<br />
+ TuplesException {<br />
+<br />
+ // Retrieve the path to the file on the remote host<br />
+ String remotePath = uri.getPath();<br />
+<br />
+ // Retrieve the actual name of the file<br />
+ String fileName = remotePath.substring(remotePath.lastIndexOf("/") + 1,<br />
+ remotePath.length());<br />
+<br />
+ if (logger.isDebugEnabled()) {<br />
+<br />
+ logger.debug("Transferring [" + uri + "] to cached file [" + fileName + "]");<br />
+ }<br />
+<br />
+ // Create a temporary cache directory handle<br />
+ File cache = new File(System.getProperty("java.io.tmpdir") + File.separator +<br />
+ "resolvercache");<br />
+<br />
+ if (!cache.exists()) {<br />
+<br />
+ // Check that the directory exists and if not then create it<br />
+ cache.mkdirs();<br />
+ }<br />
+<br />
+ if (!cache.isDirectory()) {<br />
+<br />
+ // If we can't use the directory name because a file has it, then just use<br />
+ // the temporary directory<br />
+ cache = new File(System.getProperty("java.io.tmpdir"));<br />
+ }<br />
+<br />
+ // Create a new file representing the cached file<br />
+ File file = new File(cache, fileName);<br />
+<br />
+ if (!file.exists()) {<br />
+<br />
+ // If the file does not exists in the cache already then download the file<br />
+<br />
+ // Container for our OutputStream to the file<br />
+ OutputStream outStream = null;<br />
+<br />
+ try {<br />
+<br />
+ // Attempt to create an output stream to the output file<br />
+ outStream = new FileOutputStream(file);<br />
+ } catch (FileNotFoundException fileNotFoundException) {<br />
+<br />
+ throw new TuplesException("Unable to locate output file for caching " +<br />
+ "of local version of: " + uri.toString(),<br />
+ fileNotFoundException);<br />
+ }<br />
+<br />
+ // Create an inputStream to read from<br />
+ InputStreamReader reader = new InputStreamReader(inputStream);<br />
+<br />
+ // Container for the bytes in our stream<br />
+ int nextByte = 0;<br />
+<br />
+ try {<br />
+<br />
+ // Get the first byte of the stream<br />
+ nextByte = reader.read();<br />
+<br />
+ while (nextByte != -1) {<br />
+<br />
+ // Write out the current byte<br />
+ outStream.write(nextByte);<br />
+<br />
+ // Read the next byte of the file<br />
+ nextByte = reader.read();<br />
+ }<br />
+ } catch (IOException ioException) {<br />
+<br />
+ throw new TuplesException("Failed to transfer bytes from source to " +<br />
+ "cache due to an I/O error.", ioException);<br />
+ } finally {<br />
+<br />
+ try {<br />
+<br />
+ // Attempt to shutdown the output stream<br />
+ outStream.flush();<br />
+ outStream.close();<br />
+ } catch (IOException ioException) {<br />
+<br />
+ throw new TuplesException("Failed to close output stream to cache",<br />
+ ioException);<br />
+ }<br />
+<br />
+ try {<br />
+<br />
+ // Attempt to close down the input stream reader<br />
+ reader.close();<br />
+ } catch (IOException ioException) {<br />
+<br />
+ throw new TuplesException("Failed to close input stream from " +<br />
+ uri.toString(), ioException);<br />
+ }<br />
+ }<br />
+ }<br />
+<br />
+ return file;<br />
+ }<br />
+}</p>
+
+<p>An analysis of the class is as follows:</p>
+
+<p class="indentcommandtext">package org.kowari.content.mp3;<br />
+<br />
+// Java 2 standard packages<br />
+import java.io.*;<br />
+import java.net.URI;<br />
+import java.net.URISyntaxException;<br />
+import java.net.URL;<br />
+import java.net.MalformedURLException;<br />
+import java.util.*;<br />
+import org.xml.sax.*;<br />
+<br />
+// Third party packages<br />
+import org.jrdf.graph.*;<br />
+import org.jrdf.graph.mem.*;<br />
+import org.apache.log4j.Logger; // Apache Log4J<br />
+import org.jrdf.graph.*; // JRDF<br />
+import org.jrdf.util.ClosableIterator; // JRDF<br />
+import org.jrdf.graph.*; // JRDF<br />
+import org.farng.mp3.MP3File;<br />
+import org.farng.mp3.TagException;<br />
+<br />
+// Locally written packages<br />
+import org.kowari.query.Constraint;<br />
+import org.kowari.query.QueryException;<br />
+import org.kowari.query.TuplesException;<br />
+import org.kowari.query.Variable;<br />
+import org.kowari.query.rdf.*;<br />
+import org.kowari.resolver.spi.LocalizeException;<br />
+import org.kowari.resolver.spi.Statements;<br />
+import org.kowari.resolver.spi.ResolverSession;<br />
+import org.kowari.store.StoreException;<br />
+import org.kowari.store.tuples.AbstractTuples;<br />
+import org.kowari.store.tuples.Tuples;<br />
+import org.kowari.content.Content;<br />
+import org.kowari.content.mp3.parser.*;<br />
+import org.kowari.content.mp3.parser.exception.*;<br />
+import org.kowari.content.mp3.parser.api.*;</p>
+
+<p class="indent">There are no specific requirements for the packaging of the <code>Statements</code> implementation but it is recommended that you keep it in the same package as your <code>ContentHandler</code> implementation. You must import the following classes:</p>
+<ul><li><code>org.kowari.store.tuples.AbstractTuples</code></li><li><code>org.kowari.resolver.spi.Statements</code></li><li><code>org.kowari.query.TuplesException</code></li><li><code>org.kowari.query.Variable</code></li></ul>
+<p class="indent">Any supporting classes can also be imported.</p>
+
+<p class="indentcommandtext">public class MP3Statements extends AbstractTuples implements Statements {</p>
+
+<p class="indent">All statements classes should implement <code>Statements</code> and extend <code>AbstractTuples</code>.</p>
+
+<p class="indentcommandtext"> /**<br />
+ * Construct an RDF/XML stream parser.<br />
+ *<br />
+ * @param content the content object representing our MP3 file<br />
+ * @param resolverSession session against which to localize RDF nodes<br />
+ * @throws IllegalArgumentException if inputStream or<br />
+ * resolverSession are null<br />
+ * @throws TuplesException if the inputStream can't be parsed as<br />
+ * RDF/XML<br />
+ */<br />
+ MP3Statements(Content content, ResolverSession resolverSession) throws<br />
+ TuplesException {<br />
+<br />
+ // Validate "content" parameter<br />
+ if (content == null) {<br />
+ throw new IllegalArgumentException("Null \"content\" parameter");<br />
+ }<br />
+<br />
+ // Validate "resolverSession" parameter<br />
+ if (resolverSession == null) {<br />
+ throw new IllegalArgumentException("Null \"resolverSession\" parameter");<br />
+ }<br />
+<br />
+ // Initialize fields<br />
+ this.content = content;<br />
+ this.resolverSession = resolverSession;<br />
+ this.triples = new ArrayList();<br />
+<br />
+ // Fix the magical column names for RDF statements<br />
+ setVariables(new Variable[] {new Variable("subject"),<br />
+ new Variable("predicate"),<br />
+ new Variable("object")});<br />
+<br />
+ try {<br />
+<br />
+ // Initialise the parser factory<br />
+ ParserFactory.getInstance().initialiseFactory();<br />
+ } catch (FactoryException factoryException) {<br />
+<br />
+ throw new TuplesException("Unable to initialise factory for parsers.",<br />
+ factoryException);<br />
+ }<br />
+<br />
+ // Load in the RDF conversion of the given mp3 content<br />
+ loadURL();<br />
+ }</p>
+
+<p class="indent">Since the statements object is closely linked to the content handler, constructors should be given package scope as only the handler uses it. However, if you have packaged your <code>Statements</code> implementation differently to your handler then you need to make it public. Generally the only parameter necessary is the resolver's session. If you are parsing the file as part of the <code>Statements</code> object then it is possible to also require the <code>Content</code> object to allow the parser to find the resource. Any configuration required for the parser should occur here, as well as the conversion of triples to a readable format by the interface.</p>
+
+<p class="indentcommandtext"> /**<br />
+ * Load in the RDF conversion from the content object.<br />
+ *<br />
+ * @throws TuplesException<br />
+ */<br />
+ private void loadURL() throws TuplesException {<br />
+<br />
+ // Discard any existing statements<br />
+ triples.clear();<br />
+<br />
+ try {<br />
+<br />
+ // Initialise the model to be a memory based graph<br />
+ model = new GraphImpl();<br />
+ } catch (GraphException graphException) {<br />
+<br />
+ throw new TuplesException("Unable to create a new graph object.",<br />
+ graphException);<br />
+ }<br />
+<br />
+ // Create a container for our file<br />
+ File contentFile = null;<br />
+<br />
+ if (!content.getURI().getScheme().equals("file")) {<br />
+<br />
+ // If we are dealing with anything other than a file then use the<br />
+ // caching process<br />
+<br />
+ try {<br />
+<br />
+ // Convert the URI into a file<br />
+ contentFile = getCachedFile(content.newInputStream(), content.getURI());<br />
+ } catch (IOException ioException) {<br />
+<br />
+ throw new TuplesException(<br />
+ "Unable to open a stream to the content file [" +<br />
+ content.getURI().toString() + "]", ioException);<br />
+ }<br />
+ } else {<br />
+<br />
+ // Files are local and do not need caching<br />
+ contentFile = new File(content.getURI());<br />
+ }<br />
+<br />
+ // Parse the content of the file/directory to the model<br />
+ parseFile(contentFile);<br />
+<br />
+ // Parse the stream into RDF statements<br />
+ blankNodeMap = new HashMap();<br />
+<br />
+ try {<br />
+<br />
+ // Initialize the metadata now that we know the statements<br />
+ rowCount = model.getNumberOfTriples();<br />
+ } catch (GraphException graphException) {<br />
+<br />
+ throw new TuplesException(<br />
+ "Unable to retrieve number of triples in graph.",<br />
+ graphException);<br />
+ }<br />
+<br />
+ if (logger.isDebugEnabled()) {<br />
+<br />
+ logger.debug("Parsed MP3: Found " + rowCount + " triples");<br />
+ }<br />
+ }<br />
+<br />
+ /**<br />
+ * Checks whether the given file is a file or directory and then acts<br />
+ * accordingly. It should not be confused with the parseFile method which<br />
+ * does the actual conversion from an ID3 tag to RDF. This method is<br />
+ * recursive so subdirectories will be navigated.<br />
+ *<br />
+ * @param file The file or directory we are checking the content of<br />
+ *<br />
+ * @throws TuplesException<br />
+ */<br />
+ private void parseFile(File file) throws TuplesException {<br />
+<br />
+ if (file.getName().endsWith(".mp3")) {<br />
+<br />
+ // If the file is a valid mp3 file then parse the content into the model<br />
+<br />
+ // Container for our mp3 file<br />
+ MP3File mp3File = null;<br />
+<br />
+ try {<br />
+<br />
+ // Create a new MP3 file to represent our content<br />
+ mp3File = new MP3File(file);<br />
+ } catch (IOException ioException) {<br />
+<br />
+ throw new TuplesException("Unable to create mp3 file object for path: " +<br />
+ file.getAbsolutePath(), ioException);<br />
+ } catch (TagException tagException) {<br />
+<br />
+ throw new TuplesException("Unable to read ID3 tags for file: " +<br />
+ file.getAbsolutePath(), tagException);<br />
+ }<br />
+<br />
+ // Create a container for our file id<br />
+ String fileId = "";<br />
+<br />
+ // Try to use the file uri as the id<br />
+ fileId = file.toURI().toString();<br />
+<br />
+ // Create a new conversion object<br />
+ MP3Conversion conversion = new MP3Conversion(mp3File, model, fileId);<br />
+<br />
+ // Container for our parser object<br />
+ ID3Parser parser = null;<br />
+<br />
+ try {<br />
+<br />
+ // Get a parser instance<br />
+ parser = ParserFactory.getInstance().createID3Parser();<br />
+ } catch (FactoryException factoryException) {<br />
+<br />
+ throw new TuplesException(<br />
+ "Unable to create a new ID3Parser due to a factory error.",<br />
+ factoryException);<br />
+ }<br />
+<br />
+ try {<br />
+<br />
+ // Parse the mp3 into the model<br />
+ parser.parseTags(conversion);<br />
+ } catch (ParserException parserException) {<br />
+<br />
+ throw new TuplesException("Unable to parse tags for file: " +<br />
+ content.getURI().toString(), parserException);<br />
+ }<br />
+ } else {<br />
+<br />
+ throw new TuplesException("Content object did not contain a valid mime " +<br />
+ "type for parsing.");<br />
+ }<br />
+ }<br />
+<br />
+ /**<br />
+ * Creates a locally cached version of a file from an input stream. If the<br />
+ * file already exists then it will not download the file but instead use the<br />
+ * cached version.<br />
+ *<br />
+ * @param inputStream The stream of data we are caching<br />
+ * @param uri The uri of the data we are caching<br />
+ *<br />
+ * @return The file handle to the cached file<br />
+ *<br />
+ * @throws TuplesException<br />
+ */<br />
+ private File getCachedFile(InputStream inputStream, URI uri) throws<br />
+ TuplesException {<br />
+<br />
+ // Retrieve the path to the file on the remote host<br />
+ String remotePath = uri.getPath();<br />
+<br />
+ // Retrieve the actual name of the file<br />
+ String fileName = remotePath.substring(remotePath.lastIndexOf("/") + 1,<br />
+ remotePath.length());<br />
+<br />
+ if (logger.isDebugEnabled()) {<br />
+<br />
+ logger.debug("Transferring [" + uri + "] to cached file [" + fileName + "]");<br />
+ }<br />
+<br />
+ // Create a temporary cache directory handle<br />
+ File cache = new File(System.getProperty("java.io.tmpdir") + File.separator +<br />
+ "resolvercache");<br />
+<br />
+ if (!cache.exists()) {<br />
+<br />
+ // Check that the directory exists and if not then create it<br />
+ cache.mkdirs();<br />
+ }<br />
+<br />
+ if (!cache.isDirectory()) {<br />
+<br />
+ // If we can't use the directory name because a file has it, then just use<br />
+ // the temporary directory<br />
+ cache = new File(System.getProperty("java.io.tmpdir"));<br />
+ }<br />
+<br />
+ // Create a new file representing the cached file<br />
+ File file = new File(cache, fileName);<br />
+<br />
+ if (!file.exists()) {<br />
+<br />
+ // If the file does not exists in the cache already then download the file<br />
+<br />
+ // Container for our OutputStream to the file<br />
+ OutputStream outStream = null;<br />
+<br />
+ try {<br />
+<br />
+ // Attempt to create an output stream to the output file<br />
+ outStream = new FileOutputStream(file);<br />
+ } catch (FileNotFoundException fileNotFoundException) {<br />
+<br />
+ throw new TuplesException("Unable to locate output file for caching " +<br />
+ "of local version of: " + uri.toString(),<br />
+ fileNotFoundException);<br />
+ }<br />
+<br />
+ // Create an inputStream to read from<br />
+ InputStreamReader reader = new InputStreamReader(inputStream);<br />
+<br />
+ // Container for the bytes in our stream<br />
+ int nextByte = 0;<br />
+<br />
+ try {<br />
+<br />
+ // Get the first byte of the stream<br />
+ nextByte = reader.read();<br />
+<br />
+ while (nextByte != -1) {<br />
+<br />
+ // Write out the current byte<br />
+ outStream.write(nextByte);<br />
+<br />
+ // Read the next byte of the file<br />
+ nextByte = reader.read();<br />
+ }<br />
+ } catch (IOException ioException) {<br />
+<br />
+ throw new TuplesException("Failed to transfer bytes from source to " +<br />
+ "cache due to an I/O error.", ioException);<br />
+ } finally {<br />
+<br />
+ try {<br />
+<br />
+ // Attempt to shutdown the output stream<br />
+ outStream.flush();<br />
+ outStream.close();<br />
+ } catch (IOException ioException) {<br />
+<br />
+ throw new TuplesException("Failed to close output stream to cache",<br />
+ ioException);<br />
+ }<br />
+<br />
+ try {<br />
+<br />
+ // Attempt to close down the input stream reader<br />
+ reader.close();<br />
+<br />
+ } catch (IOException ioException) {<br />
+<br />
+ throw new TuplesException("Failed to close input stream from " +<br />
+ uri.toString(), ioException);<br />
+ }<br />
+ }<br />
+ }<br />
+<br />
+ return file;<br />
+ }</p>
+
+<p class="indent">These three methods are not part of the <code>Statements</code> interface implementation but are responsible for loading in the triples from the input stream represented by the <code>Content</code> object using the parser. The <code>loadURL()</code> method is called from the constructor and sets up the content for parsing, however, the <code>Content</code> interface only allows us access by an input stream so we don't have to worry about protocol. This is a problem for the MP3 parser as it only handles local files. To overcome this, the <code>getCachedFile(InputStream, URI)</code> method exists to allow you to read a remote file into a local cache. Once a local file is created (if the resource wasn't already) you can then call <code>parseFile(File)</code> to generate the JRDF <code>Graph</code> object that you can navigate through to read triples from.</p>
+
+<p class="indentcommandtext"> /**<br />
+ * Retrieves the value contained in the subject column for the current triple.<br />
+ *<br />
+ * @return The subject value for the current triple<br />
+ *<br />
+ * @throws TuplesException<br />
+ */<br />
+ public long getSubject() throws TuplesException {<br />
+<br />
+ return getColumnValue(SUBJECT);<br />
+ }<br />
+<br />
+ /**<br />
+ * Retrieves the value contained in the predicate column for the current triple.<br />
+ *<br />
+ * @return The predicate value for the current triple<br />
+ *<br />
+ * @throws TuplesException<br />
+ */<br />
+ public long getPredicate() throws TuplesException {<br />
+<br />
+ return getColumnValue(PREDICATE);<br />
+ }<br />
+<br />
+ /**<br />
+ * Retrieves the value contained in the object column for the current triple.<br />
+ *<br />
+ * @return The object value for the current triple<br />
+ *<br />
+ * @throws TuplesException<br />
+ */<br />
+ public long getObject() throws TuplesException {<br />
+<br />
+ return getColumnValue(OBJECT);<br />
+ }<br />
+<br />
+ /**<br />
+ * @param column 0 for the subject, 1 for the predicate, 2 for the object<br />
+ */<br />
+ public long getColumnValue(int column) throws TuplesException {<br />
+<br />
+ // Pull the appropriate field from the current triple as a JRDF Node<br />
+ Node node = null;<br />
+<br />
+ switch (column) {<br />
+ case SUBJECT:<br />
+<br />
+ // Try creating the node with a URI reference<br />
+ node = tripleStatement.getSubject();<br />
+<br />
+ break;<br />
+ case PREDICATE:<br />
+<br />
+ // Try to create a URI reference node to represent the predicate<br />
+ node = tripleStatement.getPredicate();<br />
+<br />
+ break;<br />
+ case OBJECT:<br />
+<br />
+ // Create a literal node with the value for objects<br />
+ node = tripleStatement.getObject();<br />
+<br />
+ break;<br />
+ default:<br />
+<br />
+ throw new TuplesException("No such column " + column);<br />
+ }<br />
+ assert node != null;<br />
+<br />
+ // Localize the node<br />
+ try {<br />
+<br />
+ return resolverSession.localize(node);<br />
+ } catch (LocalizeException e) {<br />
+<br />
+ throw new TuplesException("Couldn't get column " + column + " value", e);<br />
+ }<br />
+ }</p>
+
+<p class="indent">The class maintains a list of the triples represented by the model URL as well as the current triple, which can have the values of each of its columns retrieved using the above methods. Nodes retrieved using these methods must be in their localised form.</p>
+
+<p class="indentcommandtext"> /**<br />
+ * Resets the counter for triples to be the first.<br />
+ *<br />
+ * @param prefix The prefix to use<br />
+ * @param suffixTruncation The truncation of suffixes to use<br />
+ *<br />
+ * @throws TuplesException<br />
+ */<br />
+ public void beforeFirst (long[] prefix, int suffixTruncation) throws<br />
+ TuplesException {<br />
+<br />
+ try {<br />
+<br />
+ // Get the iterator for statements in the model<br />
+ nextTriple = model.find(null, null, null);<br />
+ } catch (GraphException graphException) {<br />
+<br />
+ throw new TuplesException("Unable to retrieve triple iterator for graph.",<br />
+ graphException);<br />
+ }<br />
+<br />
+<br />
+ if (logger.isDebugEnabled()) {<br />
+<br />
+ try {<br />
+<br />
+ logger.debug("-- Getting the before first value from model " + model +<br />
+ " which has statements " + nextTriple.hasNext() + " from " +<br />
+ model.getNumberOfTriples() + " triples");<br />
+ } catch (GraphException graphException) {<br />
+<br />
+ // Since we are debugging, it is not important if this exception is<br />
+ // ignored<br />
+ }<br />
+ }<br />
+ }</p>
+
+<p class="indent">Since statements represent a navigable list of tuples they should also have a method for resetting the pointer. This is what the <code>beforeFirst(long[], int)</code> method does. In the case of the MP3 statement set, the iterator is reset to begin interation over the graph's triples.</p>
+
+<p class="indentcommandtext"> /**<br />
+ * Close the RDF/XML formatted input stream.<br />
+ */<br />
+ public void close () throws TuplesException {<br />
+<br />
+ resolverSession = null;<br />
+ tripleStatement = null;<br />
+ triples = null;<br />
+ url = null;<br />
+ }</p>
+
+<p class="indent">After statements are finished with, the <code>close()</code> method is called to free up any resources that are associated with them. Since the MP3 parser takes care of itself, only the objects used by the statement navigation need to be freed up.</p>
+
+<p class="indentcommandtext"> public List getOperands () {<br />
+<br />
+ return Collections.EMPTY_LIST;<br />
+ }<br />
+<br />
+ public long getRowCount () throws TuplesException {<br />
+<br />
+ return rowCount;<br />
+ }<br />
+<br />
+ public long getRowUpperBound () throws TuplesException {<br />
+<br />
+ return getRowCount();<br />
+ }<br />
+<br />
+ public boolean hasNoDuplicates () throws TuplesException {<br />
+<br />
+ return false;<br />
+ }<br />
+<br />
+ public boolean isColumnEverUnbound (int column) throws TuplesException {<br />
+<br />
+ switch (column) {<br />
+<br />
+ case 0:<br />
+<br />
+ case 1:<br />
+<br />
+ case 2:<br />
+<br />
+ return false;<br />
+ default:<br />
+<br />
+ throw new TuplesException("No such column " + column);<br />
+ }<br />
+ }</p>
+
+<p class="indent">The above methods find out information about the object, such as the number of rows, whether there are duplicates, if columns are unbound (that is, have no value) or what the operands on the tuples are.</p>
+
+<p class="indentcommandtext"> public boolean next () throws TuplesException {<br />
+<br />
+ if (nextTriple.hasNext()) {<br />
+<br />
+ // Get the next statement in the iterator<br />
+ tripleStatement = (Triple) nextTriple.next();<br />
+<br />
+ if (logger.isDebugEnabled()) {<br />
+<br />
+ logger.debug("-- Getting next statement: " + tripleStatement.toString());<br />
+ }<br />
+<br />
+ return true;<br />
+ } else {<br />
+<br />
+ tripleStatement = null;<br />
+<br />
+ return false;<br />
+ }<br />
+ }</p>
+
+<p class="indent">Statements iterate through the triples of the data store and use the <code>next()</code> method to advance the pointer. The actual triple is stored internally and its values are given out through the <code>getSubject()</code>, <code>getPredicate()</code>, and <code>getObject()</code> methods. If there are no more triples available then the method returns false. In the case of the <code>MP3Statements</code> object, the next value of the iterator is retrieved.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/alias.html
===================================================================
--- trunk/docs/site/itqlcommands/alias.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/alias.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,87 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - alias</title>
+ <meta name="keywords" content="alias, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+<!--
+<p><a href="/itqlcommands/index.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/backup.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+
+ -->
+
+
+
+<h2>alias</h2>
+
+<p>Creates an alias to a resource. This simplifies queries by using qualified names instead of element references within constraints.</p>
+
+<p>The general syntax is as follows:</p>
+
+<p class="commandtext">alias resource as namespace;</p>
+
+<p>Where <code>resource</code> is the URI prefix to abbreviate and <code>namespace</code> is an unquoted XML namespace prefix.</p>
+
+<p>For example:</p>
+
+<p class="commandtext">alias <http://purl.org/dc/elements/1.1/> as dcns;<br />
+alias <http://www.w3.org/1999/02/22-rdf-syntax-ns#> as rdfns;</p>
+
+<p class="note"><strong>Note -</strong> Alias substitution only occurs in the <code><a id="h1299" class="documentlinktemplate" title="where Clause" href="/itqlcommands/select.html#o197">where</a></code> clause of <code><a id="h1300" class="documentlinktemplate" title="select" href="/itqlcommands/select.html">select</a></code> commands.</p>
+
+<p>For example, the <code>where</code> clause in the following <code>select</code> command uses a complete URI.</p>
+
+<p class="commandtext">select $obj $pred from <http://purl.org/dc/elements/1.1/><br />
+ where <http://purl.org/dc/elements/1.1/title> $pred $obj;</p>
+
+<p>With the <code>alias</code> command, this can be simplified to:</p>
+
+<p class="commandtext">alias <http://purl.org/dc/elements/1.1/> as dc;<br />
+select $obj $pred from <http://purl.org/dc/elements/1.1/> where <dc:title> $pred $obj;</p>
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/backup.html
===================================================================
--- trunk/docs/site/itqlcommands/backup.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/backup.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,90 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - backup</title>
+ <meta name="keywords" content="backup, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+<!--
+<p><a href="/itqlcommands/alias.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/comment.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+ -->
+
+
+
+<h2>backup</h2>
+
+<p>Directs a Mulgara server to write out a backup file that can later be restored. The general syntax is as follows:</p>
+
+<p class="commandtext">backup server[#model] to [local|remote] file;</p>
+
+<p>Where:</p>
+<ul><li><code>server</code> is the URI of a complete Mulgara server to back up.</li><li><code>#model</code> is an individual model to back up (optional).</li><li><code>local</code> or <code>remote</code> specifies that the backup file is written locally on the client or remotely on server's filesystem, respectively. If not specified, the default is <code>remote</code>.</li><li><code>file</code> is the URI of the backup file.</li></ul>
+<p class="note"><strong>Note -</strong> Backups of individual models are written in RDF format while servers are written in a modified compressed (gzip) N3 format. This is because groups of models cannot be represented in RDF.</p>
+
+<p>For example:</p>
+
+<p class="indentcommandtext">backup <rmi://mysite.com/server1> to <file:/tmp/serverbackup.gz>;</p>
+
+<p class="indent">and</p>
+
+<p class="indentcommandtext">backup <rmi://mysite.com/server1> to remote <file:/tmp/serverbackup.gz>;</p>
+
+<p class="indent">are equivalent. Both commands write the server backup file remotely on the server's filesystem.</p>
+
+<p class="indentcommandtext">backup <rmi://mysite.com/server1#mymodel> to local <file:/tmp/modelbackup.rdf>;</p>
+
+<p class="indent">writes the model backup file locally on the client.</p>
+
+<p>Use the <code><a id="h1301" class="documentlinktemplate" title="restore" href="/itqlcommands/restore.html">restore</a></code> command to restore server backups and use the <code><a id="h1523" class="documentlinktemplate" title="create" href="/itqlcommands/create.html">create</a></code> and <code><a id="h1524" class="documentlinktemplate" title="load" href="/itqlcommands/load.html">load</a></code> commands to restore model backups.</p>
+
+<p>For example:</p>
+
+<p class="commandtext">create <rmi://mysite.com/server1#newmodel>;<br />
+load <file:/tmp/modelbackup.rdf> into <rmi://mysite.com/server1#newmodel>;</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/comment.html
===================================================================
--- trunk/docs/site/itqlcommands/comment.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/comment.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,69 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - comment (#)</title>
+ <meta name="keywords" content="comment, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/itqlcommands/backup.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/commit.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+
+ -->
+
+
+
+
+<h2>comment (#)</h2>
+
+<p>The comment character (#) signals to the interpreter that the text following is a comment and should not be processed. The comment character is only useful within iTQL<sup>TM</sup> scripts.</p>
+
+<p>For example, the following query is not executed:</p>
+
+<p class="commandtext"># select $subject $predicate from <rmi://mysite.com/foo> where $subject $predicate 'Booya';</p>
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/commit.html
===================================================================
--- trunk/docs/site/itqlcommands/commit.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/commit.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,68 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - commit</title>
+ <meta name="keywords" content="commit, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+<!--
+<p><a href="/itqlcommands/comment.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/create.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+ -->
+
+
+
+<h2>commit</h2>
+
+<p>Commits all modifications contained in a transaction commenced by a <code><a id="h208" class="documentlinktemplate" title="set" href="/itqlcommands/set.html">set autocommit off</a></code> command or a <code>commit</code> command. If the <code>autocommit</code> setting is on, then <code>commit</code> has no effect. The syntax is as follows:</p>
+
+<p class="commandtext">commit;</p>
+
+<p class="note"><strong>Note -</strong> The <code>commit</code> command does not change the <code>autocommit</code> setting.</p>
+
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/create.html
===================================================================
--- trunk/docs/site/itqlcommands/create.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/create.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,102 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - </title>
+ <meta name="keywords" content="create, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+<!--
+<p><a href="/itqlcommands/commit.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/delete.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+
+ -->
+
+
+
+<h2>create</h2>
+
+<p>Creates a new model on an existing Mulgara server. The corresponding command for removing models is <code><a id="h213" class="documentlinktemplate" title="drop" href="/itqlcommands/drop.html">drop</a></code>. The general syntax is as follows:</p>
+
+<p class="commandtext">create model [type];</p>
+
+<p>Where <code>model</code> is the URI of the model to create and <code>type</code> is an optional model type specification.</p>
+
+<p>Model URIs are formed by adding a fragment part to the URI of the server they reside on. The following example creates a model named <code>MyModel</code> on the server at <code>rmi://mysite.com/server1</code>.</p>
+
+<p class="commandtext">create <rmi://mysite.com/server1#MyModel>;</p>
+
+<p>The optional model types are:</p>
+<ul><li><code>http://mulgara.org/mulgara#Model</code>
+<p class="listcontinue">This is the default triple store model. Specifying this type is equivalent to omitting the type parameter.</p>
+</li><li><code>http://mulgara.org/mulgara#ViewModel</code>
+<p class="listcontinue">A view model that represents a combined set of models. See the <a id="h1497" class="documentlinktemplate" title="Views" href="/itqloperations/views.html">Views section</a> for more information.</p>
+</li><li><code>http://mulgara.org/mulgara#LuceneModel</code>
+<p class="listcontinue">A full-text string index model based on Lucene.</p>
+
+<p class="listcontinue">All statements placed into a full-text model must have a literal-valued object. Queries against a full-text model result in a match if the object in the query constraint is similar to any stored statements, rather than needing to be identical.</p>
+
+<p class="listcontinue">See the <a id="h731" class="documentlinktemplate" title="Full-Text Models" href="/itqloperations/fulltextmodels.html">Full-Text Models section</a> for more information.</p>
+</li><li><code>http://mulgara.org/mulgara#XMLSchemaModel</code>
+<p class="listcontinue">A datatyping model that represents the property of orderedness that literals like dates and numbers possess.</p>
+
+<p class="listcontinue">Datatyping models are used to constrain results to be above, below, or between specified dates or numbers.</p>
+
+<p class="listcontinue">See the <a id="h729" class="documentlinktemplate" title="Datatyping Models" href="/itqloperations/datatypingmodels.html">Datatyping Models section</a> for more information.</p>
+</li><li><code>http://mulgara.org/mulgara#TypeModel</code>
+<p class="listcontinue">A nodetyping model that represents the type the RDF nodes have in a graph.</p>
+
+<p class="listcontinue">Nodetyping models are used to constrain results to be literals or URI references.</p>
+
+<p class="listcontinue">See the <a id="h2784" class="documentlinktemplate" title="Nodetyping Models" href="/itqloperations/nodetyping.html">Nodetyping Models section</a> for more information.</p>
+</li><li><code>http://mulgara.org/mulgara#FileSystemModel</code>
+<p class="listcontinue">A filesystem model that can be queried to return information about files and directories on filesystems.</p>
+
+<p class="listcontinue">See the <a id="h3205" class="documentlinktemplate" title="Filesystem Models" href="/itqloperations/filesysmodel.html">Filesystem Model section</a> for more information.</p>
+</li></ul>
+<p>The Mulgara server must exist before you can create models on it. If you try to create a model on a nonexistent or unreachable server, the command fails with the message <code>Couldn't contact server</code>.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/delete.html
===================================================================
--- trunk/docs/site/itqlcommands/delete.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/delete.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,78 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - delete</title>
+ <meta name="keywords" content="delete, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+<!--
+<p><a href="/itqlcommands/create.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/drop.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+
+ -->
+
+
+
+
+<h2>delete</h2>
+
+<p>Deletes statements from a model. Specify the statements either explicitly or by using a <code><a id="h207" class="documentlinktemplate" title="select" href="/itqlcommands/select.html">select</a></code> command. The corresponding command for inserting statements is <code><a id="h212" class="documentlinktemplate" title="insert" href="/itqlcommands/insert.html">insert</a></code>.</p>
+
+<p>To remove a single statement, specify its subject, predicate and object after the <code>delete</code> command. For example:</p>
+
+<p class="commandtext">delete <ns:subject> <ns:predicate> 'object' from <rmi://mysite.com/server1#model1>;</p>
+
+<p>To remove a group of statements, include a <code><a id="h207_2" class="documentlinktemplate" title="select" href="/itqlcommands/select.html">select</a></code> command after the <code>delete</code> command. The query must select exactly three columns, corresponding to the subject, predicate and object (in that order) of the statements to be removed.</p>
+
+<p>The following example selects all the statements in <code>#model1</code> and uses the result within a <code>delete</code> command to remove all the statements found in <code>#model1</code> from another model, <code>#model2</code>.</p>
+
+<p class="commandtext">delete select $s $p $o from <rmi://mysite.com/server1#model1><br />
+ where $s $p $o from <rmi://mysite.com/server1#model2>;</p>
+
+<p class="note"><strong>Note -</strong> The select query must return valid RDF statements. That is, the subject and predicate must be resources, not literals.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/drop.html
===================================================================
--- trunk/docs/site/itqlcommands/drop.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/drop.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,70 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - drop</title>
+ <meta name="keywords" content="drop, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+<!--
+<p><a href="/itqlcommands/delete.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/execute.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+
+ -->
+
+
+
+<h2>drop</h2>
+
+<p>Removes an existing model from a Mulgara server. The corresponding command for creating models is <code><a id="h209" class="documentlinktemplate" title="create" href="/itqlcommands/create.html">create</a></code>. The general syntax is as follows:</p>
+
+<p class="commandtext">drop model;</p>
+
+<p>The following example removes the model <code>model1 </code>from the server <code>rmi://mysite.com/server1</code>.</p>
+
+<p class="commandtext">drop <rmi://mysite.com/server1#model1>;</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/execute.html
===================================================================
--- trunk/docs/site/itqlcommands/execute.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/execute.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,75 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - execute</title>
+ <meta name="keywords" content="execute, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+<!--
+<p><a href="/itqlcommands/drop.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/help.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+
+ -->
+
+
+
+
+<h2>execute</h2>
+
+<p>Executes a script of iTQL<sup>TM</sup> commands, displaying the results of each command after it is executed. The general syntax is as follows:</p>
+
+<p class="commandtext">execute <script url>;</p>
+
+<p>Where <code><script url></code> is the file containing the iTQL commands.</p>
+
+<p>For example:</p>
+
+<p class="commandtext">execute <file:test.itql>;<br />
+execute <file:/usr/local/tks/sample/itql/loaddc.itql>;<br />
+execute <http://www.foo.com/droptempmodel.itql>;</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/help.html
===================================================================
--- trunk/docs/site/itqlcommands/help.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/help.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,70 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - help</title>
+ <meta name="keywords" content="help, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+<!--
+<p><a href="/itqlcommands/execute.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/insert.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+ -->
+
+
+
+
+<h2>help</h2>
+
+<p>Displays basic command syntax. The general syntax is as follows:</p>
+
+<p class="commandtext">help [command];</p>
+
+<p><code>help</code> by itself displays the available commands. <code>help</code> followed by a command name displays help for that command. For example:</p>
+
+<p class="commandtext">help create;</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/includeTOC.inc
===================================================================
--- trunk/docs/site/itqlcommands/includeTOC.inc 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/includeTOC.inc 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,41 @@
+ <ul>
+ <li><a href="/itqlcommands/alias.html">alias</a></li>
+ <li><a href="/itqlcommands/backup.html">backup</a></li>
+ <li><a href="/itqlcommands/comment.html">comment (#)</a></li>
+ <li><a href="/itqlcommands/commit.html">commit</a></li>
+ <li><a href="/itqlcommands/create.html">create</a></li>
+ <li><a href="/itqlcommands/delete.html">delete</a></li>
+ <li><a href="/itqlcommands/drop.html">drop</a></li>
+ <li><a href="/itqlcommands/execute.html">execute</a></li>
+ <li><a href="/itqlcommands/help.html">help</a></li>
+ <li><a href="/itqlcommands/insert.html">insert</a></li>
+ <li><a href="/itqlcommands/load.html">load</a></li>
+ <li><a href="/itqlcommands/quit.html">quit</a></li>
+ <li><a href="/itqlcommands/restore.html">restore</a></li>
+ <li><a href="/itqlcommands/rollback.html">rollback</a></li>
+ <li><a href="/itqlcommands/select.html">select</a></li>
+ <ul class="toc">
+ <li><a href="/itqlcommands/select.html#o188">select Clause</a></li>
+ <li><a href="/itqlcommands/select.html#o189">from Clause</a></li>
+ <li><a href="/itqlcommands/select.html#o197">where Clause</a></li>
+ <ul class="toc">
+ <li><a href="/itqlcommands/select.html#o1530">in Specifier</a></li>
+ <li><a href="/itqlcommands/select.html#o1531">Assigning a Value to a Variable (mulgara:is)</a></li>
+ <li><a href="/itqlcommands/select.html#o1532">Traversing a Graph (walk Function)</a></li>
+ <li><a href="/itqlcommands/select.html#o1535">Transitive Closure (trans Function)</a></li>
+ <li><a href="/itqlcommands/select.html#o2768">exclude Function</a></li>
+ <ul class="toc">
+ <li><a href="/itqlcommands/select.html#o2769">Standard Queries</a></li>
+ <li><a href="/itqlcommands/select.html#o2770">exclude($s $p $o)</a></li>
+ <li><a href="/itqlcommands/select.html#o2771">Subqueries</a></li>
+ </ul>
+ </ul>
+ <li><a href="/itqlcommands/select.html#o190">order by Clause</a></li>
+ <li><a href="/itqlcommands/select.html#o191">limit Clause</a></li>
+ <li><a href="/itqlcommands/select.html#o192">offset Clause</a></li>
+ <li><a href="/itqlcommands/select.html#o193">subquery Function</a></li>
+ <li><a href="/itqlcommands/select.html#o194">count Function</a></li>
+ <li><a href="/itqlcommands/select.html#o2776">having Clause</a></li>
+ </ul>
+ <li><a href="/itqlcommands/set.html">set</a></li>
+ </ul>
Added: trunk/docs/site/itqlcommands/index.html
===================================================================
--- trunk/docs/site/itqlcommands/index.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/index.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,63 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - iTQL Commands</title>
+ <meta name="keywords" content="iTQL Commands, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/integration/jrdfremove.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/alias.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+ -->
+
+
+<h1>iTQL Commands</h1>
+
+<p>iTQL<sup>TM</sup> commands are used to query and update Mulgara databases. All commands are terminated with a semicolon. Where URIs occur as command parameters, they are always absolute and enclosed within angle brackets (< and >). For example, <code><rdf:type></code> and <code><http://site.domain.net/index.html></code>.</p>
+
+<p class="relatedheading">In This Section</p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/insert.html
===================================================================
--- trunk/docs/site/itqlcommands/insert.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/insert.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,93 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - insert</title>
+ <meta name="keywords" content="insert, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/itqlcommands/help.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/load.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+
+ -->
+
+
+
+
+<h2>insert</h2>
+
+<p>Inserts statements into a model. Specify the statements either explicitly or by using a <code><a id="h207" class="documentlinktemplate" title="select" href="/itqlcommands/select.html">select</a></code> command. The corresponding command for deleting statements is <code><a id="h214" class="documentlinktemplate" title="delete" href="/itqlcommands/delete.html">delete</a></code>.</p>
+
+<p>To insert a single statement, specify its subject, predicate and object after the <code>insert</code> command. For example:</p>
+
+<p class="commandtext">insert <ns:subject> <ns:predicate> 'object' into <rmi://mysite.com/server1#model>;</p>
+
+<p>To insert multiple statements, repeat the statements one after the other. For example:</p>
+
+<p class="commandtext">insert <ns:subject> <ns:predicate> 'object' <br />
+ <ns:subject2> <ns:predicate2> 'object2' into <rmi://mysite.com/server1#model>;</p>
+
+<p class="note"><strong>Note -</strong> Inserting multiple statements using a single <code>insert</code> command provides optimal performance when working over a network.</p>
+
+<p>Blank (anonymous) nodes are inserted using unbound variables. For example:</p>
+
+<p class="commandtext">insert <ns:subject> <ns:predicate> $node <br />
+ $node <ns:predicate2> 'object2' into <rmi://mysite.com/server1#model> ;</p>
+
+<p>Where <code>$node</code> becomes an anonymous node at execution time.</p>
+
+<p>An alternative way to insert a group of statements is to include a <code>select</code> command after the <code>insert</code> command. The query must select exactly three columns, corresponding to the subject, predicate and object (in that order) of the statements to be added.</p>
+
+<p>The following example selects all the statements in <code>#model1</code> and uses the result within an <code>insert</code> command to copy all the statements in <code>#model1</code><em> </em>to another model, <code>#model2</code>.</p>
+
+<p class="commandtext">insert select $s $p $o from <rmi://mysite.com/server1#model1><br />
+ where $s $p $o into <rmi://mysite.com/server1#model2>;</p>
+
+<p class="note"><strong>Note -</strong> The query must return valid RDF statements. That is, the subject and predicate must be resources, not literals.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/load.html
===================================================================
--- trunk/docs/site/itqlcommands/load.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/load.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,93 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - load</title>
+ <meta name="keywords" content="load, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/itqlcommands/insert.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/quit.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+
+
+ -->
+
+
+
+
+<h2>load</h2>
+
+<p>Reads <a class="internetlinktemplate" title="XML/RDF" href="http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#rdfxml">RDF/XML</a> or <a class="internetlinktemplate" title="" href="http://www.w3.org/2001/sw/RDFCore/ntriples/">N-Triple</a> statements from a file and and loads them into a model. The URL for the file to load must be absolute. The general syntax is as follows:</p>
+
+<p class="commandtext">load [local | remote] file into model;</p>
+
+<p>For example:</p>
+
+<p class="commandtext">load <http://mysite.com/tmp/mydata.rdf> into <rmi://mysite.com/Server1#Model1>;<br />
+load <file:/tmp/ntriple.n3 into <rmi://mysite.com/Server1#Model1>;</p>
+
+<p>By default, the <code>load</code> command expects an RDF/XML file. To load an N-Triple file, the file must have one of the following file extensions: <code>.n3</code>, <code>.nt</code>, <code>.n3.gz</code>, <code>.nt.gz</code>, <code>.n3.zip</code> or <code>.nt.zip</code>.<code> </code>The <code>load</code> command also accepts zip and GNUzip (gzip) compressed file formats.</p>
+
+<p>For documents with a protocol of <code>file:</code>, two optional parameters specify whether the document resides on the server or the client:</p>
+<ul><li><code>remote</code> (the default) specifies that the document resides on the server</li><li><code>local</code> specifies that the document resides on the client, and is streamed to the server first before loading into the model</li></ul>
+<p>For example:</p>
+
+<p class="indentcommandtext">load <file:/tmp/mydata.rdf> into <rmi://mysite.com/Server1#Model1>;</p>
+
+<p class="indent">and</p>
+
+<p class="indentcommandtext">load remote <file:/tmp/mydata.rdf> into <rmi://mysite.com/Server1#Model1>;</p>
+
+<p class="indent">are equivalent. The file resides on the server and is loaded into the model.</p>
+
+<p class="indentcommandtext">load local <file:/tmp/mydata.rdf> into <rmi://mysite.com/Server1#Model1>;</p>
+
+<p class="indent">streams the file from the client to the server first, then loads it into the model.</p>
+
+<p class="note"><strong>Note -</strong> For systems running a Windows<sup>®</sup> operating system, the file specification would look something like <code><file:/C:/temp/mydata.rdf></code>.</p>
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/quit.html
===================================================================
--- trunk/docs/site/itqlcommands/quit.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/quit.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,68 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - quit</title>
+ <meta name="keywords" content="quit, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/itqlcommands/load.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/restore.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+
+ -->
+
+
+
+
+<h2>quit</h2>
+
+<p>Ends the iTQL<sup>TM</sup> session. It only stops the iTQL client from executing and has no effect on any Mulgara server. The general syntax is as follows:</p>
+
+<p class="commandtext">quit;</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/restore.html
===================================================================
--- trunk/docs/site/itqlcommands/restore.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/restore.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,86 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - restore</title>
+ <meta name="keywords" content="restore, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/itqlcommands/quit.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/rollback.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+ -->
+
+
+
+
+<h2>restore</h2>
+
+<p>Reads in a server backup file previously created using the <code><a id="h215" class="documentlinktemplate" title="backup" href="/itqlcommands/backup.html">backup</a></code> command. The general syntax is as follows:</p>
+
+<p class="commandtext">restore server from [local|remote] file;</p>
+
+<p>Where:</p>
+<ul><li><code>server</code> is the URI of the Mulgara server to restore.</li><li><code>local</code> or <code>remote</code> specifies whether the backup file is read locally from the client or remotely from the server's filesystem, respectively. If not specified, the default is <code>remote</code>.</li><li><code>file</code> is the URI of the backup file.</li></ul>
+<p>For example:</p>
+
+<p class="indentcommandtext">restore <rmi://mysite.com/server1> from <file:/tmp/serverbackup.gz>;</p>
+
+<p class="indent">and</p>
+
+<p class="indentcommandtext">restore <rmi://mysite.com/server1> from remote <file:/tmp/serverbackup.gz>;</p>
+
+<p class="indent">are equivalent. They both restore the backup file remotely from the server's filesystem.</p>
+
+<p class="indentcommandtext">restore <rmi://mysite.com/server1> from local <file:/tmp/serverbackup.gz>;</p>
+
+<p class="indent">restores the backup file locally from the client.</p>
+
+<p class="note"><strong>Note -</strong> To restore an individual model backup, use the <code><a id="h1527" class="documentlinktemplate" title="create" href="/itqlcommands/create.html">create</a></code> and <code><a id="h1528" class="documentlinktemplate" title="load" href="/itqlcommands/load.html">load</a></code> commands.</p>
+
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/rollback.html
===================================================================
--- trunk/docs/site/itqlcommands/rollback.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/rollback.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,70 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - rollback</title>
+ <meta name="keywords" content="rollback, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/itqlcommands/restore.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/select.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+ -->
+
+
+
+
+<h2>rollback</h2>
+
+<p>Discards all modifications contained in a transaction commenced by a <code><a id="h208" class="documentlinktemplate" title="set" href="/itqlcommands/set.html">set autocommit off</a></code> command or a <code>commit</code> command. If the <code>autocommit</code> setting is on, then <code>rollback</code> has no effect. The general syntax is as follows:</p>
+
+<p class="commandtext">rollback;</p>
+
+<p class="note"><strong>Note -</strong> The <code>rollback</code> command does not change the <code>autocommit</code> setting.</p>
+
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/select.html
===================================================================
--- trunk/docs/site/itqlcommands/select.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/select.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,694 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - select</title>
+ <meta name="keywords" content="select, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/itqlcommands/select.html#o188">select</a> |
+ <a href="/itqlcommands/select.html#o189">from</a> |
+ <a href="/itqlcommands/select.html#o197">where</a> |
+ <a href="/itqlcommands/select.html#o190">order by</a> |
+ <a href="/itqlcommands/select.html#o191">limit</a> |
+ <a href="/itqlcommands/select.html#o192">offset</a> |
+ <a href="/itqlcommands/select.html#o193">subquery</a> |
+ <a href="/itqlcommands/select.html#o194">count</a> |
+ <a href="/itqlcommands/select.html#o2776">having</a>
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/itqlcommands/rollback.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqlcommands/set.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/set.html">set</a></p>
+
+ -->
+
+
+
+
+<h2>select</h2>
+
+<p>Issues queries to Mulgara servers and displays the corresponding results. The command consists of a sequence of <code><a id="h217" class="documentlinktemplate" title="select Clause" href="/itqlcommands/select.html#o188">select</a></code>, <code><a id="h218" class="documentlinktemplate" title="from Clause" href="/itqlcommands/select.html#o189">from</a></code>, and <code><a id="h206" class="documentlinktemplate" title="where Clause" href="/itqlcommands/select.html#o197">where</a></code> clauses; and may optionally include <code><a id="h219" class="documentlinktemplate" title="order by Clause" href="/itqlcommands/select.html#o190">order by</a></code>, <code><a id="h220" class="documentlinktemplate" title="offset Clause" href="/itqlcommands/select.html#o192">offset</a></code> and <code><a id="h221" class="documentlinktemplate" title="limit Clause" href="/itqlcommands/select.html#o191">limit</a></code> clauses. With all clauses present, the general syntax is as follows:</p>
+
+<p class="commandtext">select columns from models where constraints order by variables limit count offset count;</p>
+
+<p>The purpose of the <code>select</code> command is to find values for some set of variables that satisfy the specified constraints. All variable names start with a dollar sign (<code>$)</code>, for example <code>$x</code> or <code>$title</code>.</p>
+
+
+<div class="anchor"><a name="o188"> </a></div>
+<h3>select Clause</h3>
+
+<p>Specifies the variables to solve for and their order in the result. For example:</p>
+
+<p class="commandtext">select $title $author $date ...</p>
+
+<p>Constant resource or literal values may be part of a <code>select</code> clause. In these cases, dummy variable names (<code>$k0</code>, <code>$k1</code>, <code>$k2</code>,
<code>$kn</code>) are created for the constant values.</p>
+
+<p>The following example returns three columns: <code>$k0</code>, <code>$x</code> and <code>$k1</code> where the values of <code>$k0</code> and <code>$k1</code> for every solution are the literal value <code>foo</code> and the resource value <code>http://www.site.domain.net</code> respectively.</p>
+
+<p class="commandtext">select 'foo' $x <http://www.site.domain.net> ...</p>
+<div class="anchor"><a name="o189"> </a></div>
+<h3>from Clause</h3>
+
+<p>Specifies the model to query. For example:</p>
+
+<p class="commandtext">... from <rmi://mysite.com/server1#model1> ...</p>
+
+<p>Because models are sets of statements, it is logical to compose them using set operations. The <code>from </code>clause permits set union using the <code>or</code> operator and set intersection using the <code>and</code> operator, with parentheses used to control association.</p>
+<div class="anchor"><a name="o3149"> </a></div>
+
+
+<p>The following example queries only the statements appearing in all three models. </p>
+
+<p class="commandtext">... from <rmi://mysite.com/server1#model1> and <rmi://mysite.com/server1#model2><br />
+ and <rmi://mysite.com/server1#model3> ...</p>
+<div class="anchor"><a name="o197"> </a></div>
+<h3>where Clause</h3>
+
+<p>The <code>where</code> clause is usually the largest and most detailed clause of the <code><a id="h207" class="documentlinktemplate" title="select" href="/itqlcommands/select.html">select</a></code> command. It specifies the constraints that must be satisfied by the variable values in each solution. A constraint is a sequence of subject, predicate and object that represents an RDF statement. Each of the three positions is either a constant value (a resource or a literal) or a variable. The Mulgara server finds values for any variables such that the resulting statement is present in the model that was specified in the preceding <code><a id="h1326" class="documentlinktemplate" title="from Clause" href="/itqlcommands/select.html#o189">from</a></code> clause.</p>
+
+<p>For example, the following <code>where</code> clause constrains that in all solutions, the value of <code>$title</code> is the title of the resource referred to in <code>$document</code>.</p>
+
+<p class="commandtext">... where $document <dc:title> $title ...</p>
+
+<p>Constraints may be composed using <code>and</code> and <code>or</code> operations, with parentheses to control association.</p>
+
+<p>The following example returns every document with a title, an author and a subject of either botany or zoology. Documents without a known title or author are not returned.</p>
+
+<p class="commandtext">... where $document <dc:title> $title and $document <dc:creator> $author <br />
+ and ($document <dc:subject> 'botany' or $document <dc:subject> 'zoology') ...</p>
+<div class="anchor"><a name="o1530"> </a></div>
+<h4>in Specifier</h4>
+
+<p>Constraints may optionally contain an <code>in</code> specifier to resolve the constraint against the statements in a specified model, rather than the one specified in the <code><a id="h1303" class="documentlinktemplate" title="from Clause" href="/itqlcommands/select.html#o189">from</a></code> clause.</p>
+
+<p>The following example constrains the result by titles in the <code>#books</code> model rather than the one specified in the <code>from</code> clause.</p>
+
+<p class="commandtext">... where $document <dc:title> $title in <rmi://mysite.com/server1#books> ...</p>
+<div class="anchor"><a name="o1531"> </a></div>
+<h4>Assigning a Value to a Variable (mulgara:is)</h4>
+
+<p>Constraints may also assign a value to a variable rather then querying for it. The special property <code>http://mulgara.org/mulgara#is </code>(or the aliased form <code><mulgara:is></code>) can be used with a variable as its subject and a non-variable value as its object. This assigns the non-variable value to the variable.</p>
+
+<p>The following example results in every document authored by Mendel about genetics, or by Mendeleev about chemistry.</p>
+
+<p class="commandtext">... where $document <dc:title> $title and $document <dc:creator> $author <br />
+ and $document <dc:subject> $subject <br />
+ and (($author <mulgara:is> 'Mendel' and $subject <mulgara:is> 'genetics' ) <br />
+ or ($author <mulgara:is> 'Mendeleev' and $subject <mulgara:is> 'chemistry')) ...</p>
+<div class="anchor"><a name="o1532"> </a></div>
+<h4>Traversing a Graph (walk Function)</h4>
+
+<p>Traversing a graph allows a query to return values, based on a predicate, by following up or down a hierarchy of statements. In a schema language such as RDFS, these hierarchies are expressed as a sub-class or sub-property predicate. Traversing a graph is performed with the <code>walk</code> function within a <code><a id="h1321" class="documentlinktemplate" title="where Clause" href="/itqlcommands/select.html#o197">where</a></code> clause.</p>
+
+<p>The syntax of the <code>walk</code> function is either:</p>
+
+<p class="listcontinuecommandtext">walk ($subject_variable <predicate_URI> <object_URI> and<br />
+$subject_variable <predicate_URI> $object_variable)</p>
+
+<p class="listcontinue">or</p>
+
+<p class="listcontinuecommandtext">walk (<subject_URI> <predicate_URI> $object_variable and<br />
+$subject_variable <predicate_URI> $object_variable)</p>
+
+<p>The <code>walk</code> function must be bound to a <code><a id="h1298" class="documentlinktemplate" title="select Clause" href="/itqlcommands/select.html#o188">select</a></code> clause using the same triple pattern that matches the second parameter. For example:</p>
+
+<p class="commandtext">select $subject <predicate_URI> $object<br />
+...<br />
+where walk ($subject <predicate_URI> <object_URI> and<br />
+$subject <predicate_URI> $object);</p>
+
+<p>An example of <code>walk</code> is demonstrated using the following statements:</p>
+
+<p class="commandtext">[ ( <kangroos>, <rdfs:subClassOf>, <marsupials> )<br />
+ ( <marsupials>, <rdfs:subClassOf>, <mammals> )<br />
+ ( <placental-mammals>, <rdfs:subClassOf>, <mammals> )<br />
+ ( <mammals>, <rdfs:subClassOf>, <vertebrates> ) ]</p>
+
+<p>To query a set of statements in the hierarchy ending with <code><vertebrates></code> as an object:</p>
+
+<p class="commandtext">select $subject <rdfs:subClassOf> $object<br />
+...<br />
+where walk($subject <rdfs:subClassOf> <vertebrates><br />
+and $subject <rdfs:subClassOf> $object);</p>
+
+<p>Working from the bottom up, the system:</p>
+<ul><li>Matches <code>( <mammals>, <rdfs:subClassOf>, <vertebrates> )</code> and then substitutes <code><mammals></code> for <code><vertebrates></code> in the constraints.</li><li>Attempts to match for the triples <code>( *, <rdfs:subClassOf>, <mammals> )</code>.</li><li>Then matches for <code>( <marsupials>, <rdfs:subClassOf>, <mammals> )</code> and <code>( <placental-mammals>, <rdfs:subClassOf>, <mammals> )</code>.</li><li>Then matches for <code>( *, <rdfs:subClassOf>, <marsupials> )</code> and (<code> *, <rdfs:subClassOf>, <placental-mammals> )</code> and so on.</li></ul>
+<p>The result of the query is:</p>
+
+<p class="commandtext">[ ( <mammals>, <rdfs:subClassOf>, <vertebrates> )<br />
+ ( <placental-mammals>, <rdfs:subClassOf>, <mammals> )<br />
+ ( <marsupials>, <rdfs:subClassOf>, <mammals> )<br />
+ ( <kangaroos>, <rdfs:subClassOf>, <marsupials> ) ]</p>
+
+<p>You can also traverse down the graph following the hierarchy. For example:</p>
+
+<p class="commandtext">select $subject <rdfs:subClassOf> $object<br />
+...<br />
+where walk(<kangaroos> <rdfs:subClassOf> $object<br />
+and $subject <rdfs:subClassOf> $object);</p>
+
+<p>This returns:</p>
+
+<p class="commandtext">[ ( <kangaroos>, <rdfs:subClassOf>, <marsupials> )<br />
+ ( <marsupials>, <rdfs:subClassOf>, <mammals> )<br />
+ ( <mammals>, <rdfs:subClassOf>, <vertebrates> ) ]</p>
+<div class="anchor"><a name="o1535"> </a></div>
+<h4>Transitive Closure (trans Function)</h4>
+
+<p>Transitive closure provides the ability to express a function that generates new statements. Normally, transitive closure produces both existing and new statements. The <code>trans</code> function in iTQL<sup>TM</sup> only produces new statements, statements that did not exist in the model before it was executed. The <code>trans</code> function can be further constrained by limiting which statements are inferred and by giving it a starting or termination point.</p>
+
+<p>The simplest form of the <code>trans</code> function defines a predicate to operate on:</p>
+
+<p class="commandtext">select $subject <rdfs:subClassOf> $object<br />
+...<br />
+where trans($subject <rdfs:subClassOf> $object);</p>
+
+<p>This generates a new statement, <code>$x <rdfs:subClassOf> $z</code>, when it finds two statements that match the pattern <code>$x <rdfs:subClassOf> $y</code> and <code>$y <rdfs:subClassOf> $z</code>.</p>
+
+<p>For example, consider the following set of statements:</p>
+
+<p class="commandtext">[ (<mammals>, <rdfs:subClassOf>, <vertebrates>)<br />
+ (<eats-leaves>, <rdfs:subPropertyOf>, <herbivore>)<br />
+ (<marsupials>, <rdfs:subClassOf>, <mammals>)<br />
+ (<placental-mammals>, <rdfs:subClassOf>, <mammals>)<br />
+ (<elephants>, <rdfs:subClassOf>, <placental-mammals>)<br />
+ (<kangaroos>, <rdfs:subClassOf>, <marsupials>)<br />
+ (<red-kangaroos>, <rdfs:subClassOf>, <kangaroos>) ]</p>
+
+<p>As a tree it looks as follows:</p>
+
+<p><img src="/img/select1536.gif" alt="Transitive Closure" height="273" width="252" vspace="0" hspace="0" align="bottom" border="0" /></p>
+
+<p>Based on the constraint in the query, the first and third statements match the pattern <code>(<marsupials>, <rdfs:subClassOf>, <mammals>) and (<mammals>, <rdfs:subClassOf>, <vertebrates>)</code>. Therefore, the function generates the statement <code>(<marsupials>, <rdfs:subClassOf>, <vertebrates>)</code>.</p>
+
+<p>Using the query across the existing set of statements produces the following new set of statements:</p>
+
+<p class="commandtext">[ (<code><marsupials>, <rdfs:subClassOf>, <vertebrates></code>)<br />
+ (<kangaroos>, <rdfs:subClassOf>, <<code>vertebrates</code>>)<br />
+ (<red-kangaroos>, <rdfs:subClassOf>, <<code>vertebrates</code>>)<br />
+ (<placental-mammals>, <rdfs:subClassOf>, <<code>vertebrates></code>)<br />
+ (<elephants>, <rdfs:subClassOf>, <<code>vertebrates</code>>)<br />
+ (<kangaroos>, <rdfs:subClassOf>, <mammals>)<br />
+ (<red-kangaroos>, <rdfs:subClassOf>, <mammals>)<br />
+ (<elephants>, <rdfs:subClassOf>, <mammals>)<br />
+ (<red-kangaroos>, <rdfs:subClassOf>, <marsupials>) ]</p>
+
+<p>To provide the results expected from a transitive closure function you would union together these newly generated statements with the original base set of statements, using the following query:</p>
+
+<p class="commandtext">select $subject <rdfs:subClassOf> $object<br />
+...<br />
+where trans($subject <rdfs:subClassOf> $object)<br />
+or $subject <rdfs:subClassOf> $object;</p>
+
+<p>You can further restrict the <code>trans</code> function to a sub-set of statements, as shown in the following example.</p>
+
+<p class="commandtext">select $subject <rdfs:subClassOf> $object<br />
+...<br />
+where trans($subject <rdfs:subClassOf> <mammals><br />
+and $subject <rdfs:subClassOf> $object);</p>
+
+<p>This produces new statements where the object in the inheritance tree begins with <code><mammals></code>, eliminating the statements derived from <code><vertebrates></code>. It produces the following:</p>
+
+<p class="commandtext">[ (<kangaroos>, <rdfs:subClassOf>, <mammals>)<br />
+ (<red-kangaroos>, <rdfs:subClassOf>, <mammals>)<br />
+ (<elephants>, <rdfs:subClassOf>, <mammals>)<br />
+ (<red-kangroos>, <rdfs:subClassOf>, <marsupials>) ]</p>
+
+<p>To get the full transitive closure, the newly inferred statements are unioned with the base statements. To only return the sub-graph from <code><mammals></code> we can add the results from a <code><a id="h1537" class="documentlinktemplate" title="Traversing a Graph (walk Function)" href="/itqlcommands/select.html#o1532">walk</a></code> function:</p>
+
+<p class="commandtext">select $subject <rdfs:subClassOf> $object<br />
+...<br />
+where trans($xxx <rdfs:subClassOf> <mammals><br />
+and $subject <rdfs:subClassOf> $object) or<br />
+walk($subject <rdfs:subClassOf> <mammals><br />
+and $subject <rdfs:subClassOf> $object);</p>
+
+<p>To generate the statements to <code><marsupials></code> you can constrain the subject in the function instead:</p>
+
+<p class="commandtext">select $subject <rdfs:subClassOf> $object<br />
+...<br />
+where trans(<marsupials> <rdfs:subClassOf> $object<br />
+and $subject <rdfs:subClassOf> $object) ;</p>
+
+<p>This produces:</p>
+
+<p class="commandtext">[ <marsupials>, <rdfs:subClassOf>, <vertebrates>) ]</p>
+
+<p>The <code>trans</code> function also allows you to limit what is inferred by dropping the second constraint within the <code>trans</code> definition. For example, to infer only direct statements from <code><vertebrates></code>:</p>
+
+<p class="commandtext">select $subject <rdfs:subClassOf> <<code>vertebrates</code>><br />
+...<br />
+where trans($subject <rdfs:subClassOf> <<code>vertebrates</code>>)</p>
+
+<p>Which produces:</p>
+
+<p class="commandtext">[ (<marsupials>, <rdfs:subClassOf>, <<code>vertebrates</code>>)<br />
+ (<kangaroos>, <rdfs:subClassOf>, <<code>vertebrates</code>>)<br />
+ (<red-kangaroos>, <rdfs:subClassOf>, <<code>vertebrates</code>>)<br />
+ (<placental-mammals>, <rdfs:subClassOf>, <<code>vertebrates</code>>)<br />
+ (<elephants>, <rdfs:subClassOf>, <<code>vertebrates</code>>) ]</p>
+
+<p>Likewise, you can also make the subject in the <code>trans</code> constraint a constant and the object a variable.</p>
+<div class="anchor"><a name="o2768"> </a></div>
+<h4>exclude Function</h4>
+
+<p>The <code>exclude</code> function allows you to select all statements whose properties are the inverse of a given constraint. Normal constraints match against the graph with the constraints you provide. Constraints enclosed in an <code>exclude</code> function return the values in the graph that are not the constraints provided. This allows you to build queries to ask questions such as: "find me all the known plants stored, with leaves that are not green" or "find me all the American states stored that are not Alabama".</p>
+
+<p>Using the following statements as an example:</p>
+
+<p class="commandtext">[ (<maple>, <leaves>, 'green')<br />
+ (<redMaple>, <leaves>, 'red')<br />
+ (<oak>, <leaves>, 'green')<br />
+ (<cactus>, <prickles>, 'yellow') ]</p>
+
+<p>You wish to find all plants that do not have leaves. The following query:</p>
+
+<p class="commandtext">select $s $p $o<br />
+...<br />
+where exclude($s <leaves> $o) <br />
+and ($s $p $o);</p>
+
+<p>Returns:</p>
+
+<p class="commandtext">[ (<cactus>, <prickles>, 'yellow') ]</p>
+
+<p>Unless your model is very small, the <code>exclude</code> function by itself is rarely useful. For example, the following query:</p>
+
+<p class="commandtext">select $s $p $o<br />
+...<br />
+where exclude($s <leaves> 'green')<br />
+and $s $p $o;</p>
+
+<p>Returns:</p>
+
+<p class="commandtext">[ (<cactus>, <prickles>, 'yellow')<br />
+ (<redMaple), <leaves>, 'red' ]</p>
+
+<p>As this returns all statements that do not have the predicate <code><leaves></code> and the object value 'green', if a statement exists where <em>either</em> of these columns do not match, it is returned. If you want to find all the things that have leaves that are not green you need to perform the following query:</p>
+
+<p class="commandtext">select $s<br />
+...<br />
+where $s <urn:leaves> $o <br />
+and exclude($s $p 'green');</p>
+
+<p>To understand what this query is doing, examine each constraint individually:</p>
+<ol><li><code>$s <urn:leaves> $o</code> returns all statements with the predicate <code><leaves></code>:
+<p class="listcontinuecommandtext">$s $o<br />
+<maple> 'green'<br />
+<redMaple> 'red'<br />
+<oak> 'green'</p>
+</li><li><code>exclude($s $p 'green')</code> returns all statements that do not have the object value 'green':
+<p class="listcontinuecommandtext">$s $p<br />
+<redMaple> <leaves><br />
+<cactus> <prickles></p>
+</li></ol>
+<p>Combining these two results (using <code>and</code>), only one statement satisfies all constraints and the query returns the variable (<code>$s</code>) in the <code><a id="h217_2" class="documentlinktemplate" title="select Clause" href="/itqlcommands/select.html#o188">select</a></code> clause:</p>
+
+<p class="commandtext">[ (<redMaple>) ]</p>
+
+<p>Rarely do graphs contain just one easily defined set of statement. Extending the base set of statements with overlapping predicates for our example:</p>
+
+<p class="commandtext">[ (<maple>, <type>, <plant>)<br />
+ (<redMaple>, <type>, <plant>)<br />
+ (<oak>, <type>, <plant>)<br />
+ (<cactus>, <type>, <plant>)<br />
+ (<maple>, <leaves>, 'green')<br />
+ (<redMaple>, <leaves>, 'red')<br />
+ (<oak>, <leaves>, 'green')<br />
+ (<cactus>, <prickles>, 'yellow') <br />
+ (<binderRefill>, <leaves>, '50') ]</p>
+
+<p>Using the previous query:</p>
+
+<p class="commandtext">select $s<br />
+...<br />
+where $s <urn:leaves> $o <br />
+and exclude($s $p 'green');</p>
+
+<p>Returns:</p>
+
+<p class="commandtext">[ (<maple>)<br />
+ (<redMaple>)<br />
+ (<oak>)<br />
+ (<binderRefill>) ]</p>
+
+<p>Examining each constraint individually again:</p>
+<ol><li><code>$s <urn:leaves> $o</code> returns all statements with the predicate <code><leaves></code>:
+<p class="listcontinuecommandtext">$s $o<br />
+<maple> 'green'<br />
+<redMaple> 'red'<br />
+<oak> 'green'<br />
+<binderRefill> '50'</p>
+</li><li><code>exclude($s $p 'green')</code> returns all statements that do not have the object value 'green':
+<p class="listcontinuecommandtext">$s $p<br />
+<maple> <type><br />
+<redMaple> <type><br />
+<oak> <type><br />
+<cactus> <type><br />
+<redMaple> <leaves><br />
+<cactus> <prickles><br />
+<binderRefill> <leaves></p>
+</li></ol>
+<p>Combining the <code>$s</code> column from each result of the constraints, leads to the result.</p>
+
+<p>You usually need to restrict the <code>exclude</code> constraint. In the previous examples, you only want to query things that are plants and not the entire graph. It is also preferable that the results from these constraints exist as real statements in a graph. To restrict the constraints so they only return things in the graph, the variables must be bound to the relevant positions.</p>
+
+<p>For example, the following query:</p>
+
+<p class="commandtext"><code>select $s $p $o<br />
+...<br />
+where $s <urn:leaves> $o <br />
+and exclude($s $p 'green') <br />
+and $s $p $o;</code></p>
+
+<p>Returns:</p>
+
+<p class="commandtext"><code>[ (<redMaple>, <leaves>, 'red')<br />
+ (<binderRefill>, <leaves>, '50') ]</code></p>
+
+<p>Note that the query still has not restricted the type of the object. To only query plants, the following query:</p>
+
+<p class="commandtext"><code>select $s $p $o<br />
+...<br />
+where $s <urn:leaves> $o <br />
+and exclude($s $p 'green') <br />
+and $s $p $o<br />
+and $s <type> <plant> ;</code></p>
+
+<p>Returns:</p>
+
+<p class="commandtext"><code>[ (<redMaple>, <leaves>, 'red') ]</code></p>
+<div class="anchor"><a name="o2769"> </a></div>
+<h5>Standard Queries</h5>
+
+<p>The variable names used in the <code>exclude</code> function are not bound by other constraints, including the <code><a id="h2772" class="documentlinktemplate" title="Assigning a Value to a Variable (mulgara:is)" href="/itqlcommands/select.html#o1531"><mulgara:is></a></code> operation. All other operations match statements in the graph. So it is not the same thing as replacing positively matching values from the graph and assigning these values to the <code>exclude</code> function. The variable names used in the <code>exclude</code> function and other operations are only used to join the column values from the results of each constraint.</p>
+
+<p>For example, the query:</p>
+
+<p class="commandtext"><code>select $s $p $o<br />
+...<br />
+where exclude($s $p 'green')<br />
+and $p <mulgara:is> <leaves><br />
+and $s $p $o;</code></p>
+
+<p>Results in all the statements that do not have the object value 'green', combined with all the statements with the predicate <code><leaves></code>:</p>
+
+<p class="commandtext"><code>[ (<redMaple>, <leaves>, 'red')<br />
+ (<binderRefill>, <leaves>, '50') ]</code></p>
+
+<p>Note that this is not the same as:</p>
+
+<p class="commandtext"><code>select $s $p $o<br />
+...<br />
+where exclude ($s <urn:leaves> 'green')<br />
+and $p <mulgara:is> <leaves><br />
+and $s $p $o;</code></p>
+
+<p>Which returns:</p>
+
+<p class="commandtext"><code>[ (<maple>, <leaves>, 'green')<br />
+ (<oak>, <leaves>, 'green') ]</code></p>
+<div class="anchor"><a name="o2770"> </a></div>
+<h5>exclude($s $p $o)</h5>
+
+<p><code>exclude</code> functions that only contain variables usually return no result. If joined to other constraints with <code>and</code>, it will return no result. As stated above, this cannot be changed by using <code><a id="h2772_2" class="documentlinktemplate" title="Assigning a Value to a Variable (mulgara:is)" href="/itqlcommands/select.html#o1531"><mulgara:is></a></code> or other constraints. The only exception to this is when the <code>exclude</code> function is used in a subquery or aggregate function. See the next section on subqueries for more details.</p>
+
+<p>For example, the following query returns no result.</p>
+
+<p class="commandtext"><code>select $s $p $o<br />
+...<br />
+where exclude ($s $p $o)<br />
+and $o <mulgara:is> 'green'<br />
+and $s $p $o;</code></p>
+<div class="anchor"><a name="o2771"> </a></div>
+<h5>Subqueries</h5>
+
+<p>Subqueries allow the results from one query to be used in another. That is, the values of the outer queries bind to the variables with the same name in the inner query. So a constraint such as <code>exclude($s $p $o)</code>, which normally returns no result, could return results if used in a <code><a id="h211" class="documentlinktemplate" title="subquery Function" href="/itqlcommands/select.html#o193">subquery</a></code> or <code><a id="h733" class="documentlinktemplate" title="count Function" href="/itqlcommands/select.html#o194">count</a></code> function when any of the variables <code>$s</code>, <code>$p</code> or <code>$o</code> are bound by the outer query.</p>
+
+<p>For example, the following query binds the <code>$s</code> and <code>$o</code> values of the internal query:</p>
+
+<p class="commandtext"><code>select $s $o subquery(<br />
+ select $s2 $p2 $o2 <br />
+ ...<br />
+ where exclude($s $p2 $o) <br />
+ and $s $p2 $o2 <br />
+ and $s2 $p2 $o)<br />
+...<br />
+where $s <urn:type> $o ;</code></p>
+
+<p>The first result passes values to the internal <code>subquery</code> where <code>$s</code> is <code><maple></code> and <code>$o</code> is <code><plant></code>. This causes the inner query to look like:</p>
+
+<p class="commandtext"><code>select $s2 $p2 $o2 <br />
+...<br />
+where exclude(<maple> $p2 <plant>)<br />
+and <maple> $p2 $o2 <br />
+and $s2 $p2 <plant></code></p>
+<div class="anchor"><a name="o190"> </a></div>
+<h3>order by Clause</h3>
+
+<p>Optionally sorts the results of a <code><a id="h207_2" class="documentlinktemplate" title="select" href="/itqlcommands/select.html">select</a></code> command according to the variables specified.</p>
+
+<p>The following example sorts the results numerically by rating (assuming ratings can be parsed as numbers), then alphabetically by author for documents of equal rating.</p>
+
+<p class="commandtext">... order by $rating $title;</p>
+
+<p>The suffixes <code>asc</code> and <code>desc</code> may be used to override the default sort ordering for a variable.</p>
+
+<p>The following example sorts the results such that low ratings display first, and then alphabetically by author for documents of equal rating.</p>
+
+<p class="commandtext">... order by $rating asc $author;</p>
+<div class="anchor"><a name="o191"> </a></div>
+<h3>limit Clause</h3>
+
+<p>Optionally limits the query result to a specified non-negative number of rows.</p>
+
+<p>When using <code>limit</code>, it is advisable to use the <code><a id="h219_2" class="documentlinktemplate" title="order by Clause" href="/itqlcommands/select.html#o190">order by</a></code> clause to constrain the result rows into a unique order. Otherwise you do not know which rows are returned. For example, if you limit a result to 10 rows without specifying an order, you do not know which 10 rows are returned.</p>
+<div class="anchor"><a name="o192"> </a></div>
+<h3>offset Clause</h3>
+
+<p>Optionally skips a non-negative number of rows at the beginning of a query result. The use of <code>offset</code> usually accompanies a <code><a id="h221_2" class="documentlinktemplate" title="limit Clause" href="/itqlcommands/select.html#o191">limit</a></code> clause, making it possible to page through results.</p>
+
+<p>As with <code>limit</code>, it is advisable to use the <code><a id="h219_3" class="documentlinktemplate" title="order by Clause" href="/itqlcommands/select.html#o190">order by</a></code> clause to constrain the result rows into a unique order.</p>
+
+<p>For examples and explanations of complete queries, see the <a id="h666" class="documentlinktemplate" title="Basic iTQL Operations" href="/overview/itqlbasics.html">Issuing iTQL Commands section</a>.</p>
+<div class="anchor"><a name="o193"> </a></div>
+<h3>subquery Function</h3>
+
+<p>Used to nest <code><a id="h207_3" class="documentlinktemplate" title="select" href="/itqlcommands/select.html">select</a></code> commands. Subqueries nest inside <code>select</code> by binding variables in the subquery <code><a id="h1321_2" class="documentlinktemplate" title="where Clause" href="/itqlcommands/select.html#o197">where</a></code> clause to the outer <code><a id="h1298_2" class="documentlinktemplate" title="select Clause" href="/itqlcommands/select.html#o188">select</a></code> clause.</p>
+
+<p>In the following example the value of <code>$vcard</code> is bound to the inner query. The outer result set contains nested result sets for each subquery.</p>
+
+<p class="commandtext">select $vcard $fn <br />
+ subquery( select $title <br />
+ from <rmi://mysite.com/server1#vcard> <br />
+ where $vcard <http://www.w3.org/2001/vcard-rdf/3.0#TITLE> $title<br />
+ order by $title )<br />
+ from <rmi://mysite.com/server1#vcard> <br />
+ where $vcard <http://www.w3.org/2001/vcard-rdf/3.0#FN> $fn <br />
+ order by $fn;</p>
+
+<p>The above example produces the following XML output from a SOAP call:</p>
+
+<p class="commandtext"><?xml version="1.0"?><br />
+<answer xmlns="http://mulgara.org/tql#"><br />
+ <query><br />
+ <variables><br />
+ <vcard/><br />
+ <fn/><br />
+ <k0/><br />
+ </variables><br />
+ <solution><br />
+ <vcard resource="http://qqq.com/staff/superman"/><br />
+ <fn>Superman</fn><br />
+ <k0><br />
+ <variables><br />
+ <title/><br />
+ </variables><br />
+ </k0><br />
+ </solution><br />
+ <solution><br />
+ <vcard resource="http://qqq.com/staff/spiderman"/><br />
+ <fn>Peter Parker</fn><br />
+ <k0><br />
+ <variables><br />
+ <title/><br />
+ </variables><br />
+ <solution><br />
+ <title>Super Hero</title><br />
+ </solution><br />
+ <solution><br />
+ <title>PO2</title><br />
+ </solution><br />
+ </k0><br />
+ </solution><br />
+ <solution><br />
+ <vcard resource="http://qqq.com/staff/corky"/><br />
+ <fn>Corky Crystal</fn><br />
+ <k0><br />
+ <variables><br />
+ <title/><br />
+ </variables><br />
+ <solution><br />
+ <title>Computer Officer Class 3</title><br />
+ </solution><br />
+ </k0><br />
+ </solution><br />
+ </query><br />
+</answer></p>
+<div class="anchor"><a name="o194"> </a></div>
+<h3>count Function</h3>
+
+<p>Similar to <code><a id="h211_2" class="documentlinktemplate" title="subquery Function" href="/itqlcommands/select.html#o193">subquery</a></code> except that it only returns a dummy variable with value of the total row count of the inner query. See the <code><a id="h1320" class="documentlinktemplate" title="select Clause" href="/itqlcommands/select.html#o188">select</a></code><a id="h1320_2" class="documentlinktemplate" title="select Clause" href="/itqlcommands/select.html#o188"> clause section</a> for a description of dummy variables. For example:</p>
+
+<p class="commandtext">select $vcard $fn <br />
+ count( select $title from <rmi://mysite.com/server1#vcard> <br />
+ where $vcard <http://www.w3.org/2001/vcard-rdf/3.0#TITLE> $title )<br />
+ from <rmi://mysite.com/server1#vcard> <br />
+ where $vcard <http://www.w3.org/2001/vcard-rdf/3.0#FN> $fn ;</p>
+
+<p>The above example returns the following:</p>
+
+<p class="commandtext">vcard=http://qqq.com/staff/corky fn="Corky Crystal" k0="1"<br />
+vcard=http://qqq.com/staff/spiderman fn="Peter Parker" k0="2"<br />
+vcard=http://qqq.com/staff/superman fn="Superman" k0="0"</p>
+<div class="anchor"><a name="o2776"> </a></div>
+<h3>having Clause</h3>
+
+<p>The <code>having</code> clause applies a constraint to a dummy variable that results from a <code><a id="h1323" class="documentlinktemplate" title="subquery Function" href="/itqlcommands/select.html#o193">subquery</a></code> in a <code><a id="h1320_3" class="documentlinktemplate" title="select Clause" href="/itqlcommands/select.html#o188">select</a></code><a id="h1320_4" class="documentlinktemplate" title="select Clause" href="/itqlcommands/select.html#o188"> clause</a> of a query. These variables are of the form <code>$k0</code>, <code>$k1</code>, <code>$k2</code>,
<code>$kn</code> and only hold numerical values. See the <code><a id="h1320_5" class="documentlinktemplate" title="select Clause" href="/itqlcommands/select.html#o188">select</a></code><a id="h1320_6" class="documentlinktemplate" title="select Clause" href="/itqlcommands/select.html#o188"> clause section</a> for a description of dummy variables.</p>
+
+<p>There are four special predicates that can be used to perform arithmetic comparisons in the <code>having</code> clause, as outlined in the following table.</p>
+<table width="450" cellpadding="2" cellspacing="0" border="0" style="border-collapse:collapse">
+<tr align="left" valign="top">
+<td width="294">
+<p class="tableheading">Predicate</p>
+</td>
+<td width="156">
+<p class="tableheading">Arithmetic Operation</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="294">
+<p><code>http://mulgara.org/mulgara#occurs</code></p>
+</td>
+<td width="156">
+<p>=</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="294">
+<p><code>http://mulgara.org/mulgara#occursMoreThan</code></p>
+</td>
+<td width="156">
+<p>></p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="294">
+<p><code>http://mulgara.org/mulgara#occursLessThan</code></p>
+</td>
+<td width="156">
+<p><</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="294">
+<p><code>http://mulgara.org/mulgara#notOccurs</code></p>
+</td>
+<td width="156">
+<p>?</p>
+</td>
+</tr>
+
+</table>
+
+<p>Expanding on the example shown in the <code><a id="h1323_2" class="documentlinktemplate" title="subquery Function" href="/itqlcommands/select.html#o193">subquery</a></code> and <code><a id="h733_2" class="documentlinktemplate" title="count Function" href="/itqlcommands/select.html#o194">count</a></code> sections, the following query restricts the result to those with a count of 1:</p>
+
+<p class="commandtext">select $vcard $fn <br />
+ count( select $title from <rmi://mysite.com/server1#vcard> <br />
+ where $vcard <http://www.w3.org/2001/vcard-rdf/3.0#TITLE> $title )<br />
+ from <rmi://mysite.com/server1#vcard> <br />
+ where $vcard <http://www.w3.org/2001/vcard-rdf/3.0#FN> $fn <br />
+ having $k0 <http://mulgara.org/mulgara#occurs><br />
+ '1.0'^^<http://www.w3.org/2001/XMLSchema#double> ;</p>
+
+<p>The above example returns:</p>
+
+<p class="commandtext">vcard=http://qqq.com/staff/corky fn="Corky Crystal" k0="1"</p>
+
+<p>Similarly, to restrict the result to those with a count greater than 0 would be: </p>
+
+<p class="commandtext">select $vcard $fn <br />
+ count( select $title from <rmi://mysite.com/server1#vcard> <br />
+ where $vcard <http://www.w3.org/2001/vcard-rdf/3.0#TITLE> $title )<br />
+ from <rmi://mysite.com/server1#vcard> <br />
+ where $vcard <http://www.w3.org/2001/vcard-rdf/3.0#FN> $fn <br />
+ having $k0 <http://mulgara.org/mulgara#occursMoreThan><br />
+ '0.0'^^<http://www.w3.org/2001/XMLSchema#double> ;</p>
+
+<p>The above example returns:</p>
+
+<p class="commandtext">vcard=http://qqq.com/staff/corky fn="Corky Crystal" k0="1"<br />
+vcard=http://qqq.com/staff/spiderman fn="Peter Parker" k0="2"</p>
+
+<p>The form of the constraint for the <code>having</code> clause must be:</p>
+
+<p class="commandtext">$kx predicate value^^<http://www.w3.org/2001/XMLSchema#double></p>
+
+<p>Where p<code>redicate</code> is one of the predicates from the above table.</p>
+
+<p>Note that compound constraints for the <code>having</code> clause are not allowed. For example, the following query is <em>not</em> legal:</p>
+
+<p class="commandtext">select $vcard $fn <br />
+ count( select $title from <rmi://mysite.com/server1#vcard> <br />
+ where $vcard <http://www.w3.org/2001/vcard-rdf/3.0#TITLE> $title )<br />
+ from <rmi://mysite.com/server1#vcard> <br />
+ where $vcard <http://www.w3.org/2001/vcard-rdf/3.0#FN> $fn <br />
+ having $k0 <http://mulgara.org/mulgara#occurs><br />
+ '0.0'^^<http://www.w3.org/2001/XMLSchema#double> <br />
+ or $k0 <http://mulgara.org/mulgara#occurs> <br />
+ '2.0'^^<http://www.w3.org/2001/XMLSchema#double> ;</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqlcommands/set.html
===================================================================
--- trunk/docs/site/itqlcommands/set.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqlcommands/set.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,92 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - set</title>
+ <meta name="keywords" content="set, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/itqlcommands/select.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="254.htm"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="/itqlcommands/index.html">iTQL Commands</a></p>
+<p class="relateditem"><a href="/itqlcommands/alias.html">alias</a></p>
+<p class="relateditem"><a href="/itqlcommands/backup.html">backup</a></p>
+<p class="relateditem"><a href="/itqlcommands/comment.html">comment (#)</a></p>
+<p class="relateditem"><a href="/itqlcommands/commit.html">commit</a></p>
+<p class="relateditem"><a href="/itqlcommands/create.html">create</a></p>
+<p class="relateditem"><a href="/itqlcommands/delete.html">delete</a></p>
+<p class="relateditem"><a href="/itqlcommands/drop.html">drop</a></p>
+<p class="relateditem"><a href="/itqlcommands/execute.html">execute</a></p>
+<p class="relateditem"><a href="/itqlcommands/help.html">help</a></p>
+<p class="relateditem"><a href="/itqlcommands/insert.html">insert</a></p>
+<p class="relateditem"><a href="/itqlcommands/load.html">load</a></p>
+<p class="relateditem"><a href="/itqlcommands/quit.html">quit</a></p>
+<p class="relateditem"><a href="/itqlcommands/restore.html">restore</a></p>
+<p class="relateditem"><a href="/itqlcommands/rollback.html">rollback</a></p>
+<p class="relateditem"><a href="/itqlcommands/select.html">select</a></p>
+
+
+ -->
+
+
+
+
+<h2>set</h2>
+
+<p>Sets a property in the interpreter. The general syntax is:</p>
+
+<p class="commandtext">set option [on | off];</p>
+
+<p>Where <code>option</code> is one of the following:</p>
+<ul><li><code>time</code>
+<p class="listcontinue">Prints the time a command takes to execute (in seconds). For example:</p>
+
+<p class="listcontinuecommandtext">set time on ;<br />
+Command timing on<br />
+Command execution time - 0.019 seconds<br />
+alias <http://www.w3.org/1999/02/22-rdf-syntax-ns#> as rdfns ;<br />
+Successfully aliased http://www.w3.org/1999/02/22-rdf-syntax-ns# as rdfns<br />
+Command execution time - 0.0050 seconds<br />
+set time off ;<br />
+Command timing off<br />
+alias <http://www.w3.org/1999/02/22-rdf-syntax-ns#> as rdfns ;<br />
+Successfully aliased http://www.w3.org/1999/02/22-rdf-syntax-ns# as rdfns</p>
+</li><li><code>autocommit</code>
+<p class="listcontinue">The default setting is <code>on</code>. Setting this option off specifies that all subsequent iTQL<sup>TM</sup> commands that modify the database are isolated in a logical unit of work. That is, modifications are not visible to other iTQL sessions until either <code>autocommit</code> is set back on or a <code>commit</code> command is performed. For example:</p>
+
+<p class="listcontinuecommandtext">set autocommit off ;<br />
+insert <ns:subject> <ns:predicate1> 'object' into <rmi://mysite.com/server1#model> ;<br />
+insert <ns:subject> <ns:predicate2> 'object2' into <rmi://mysite.com/server1#model> ; <br />
+set autocommit on ;</p>
+</li></ul>
+<p>If a session with <code>autocommit</code> set <code>off</code> is idle for a period greater than three minutes, and a second session attempts a write, then a rollback of the first session's uncommitted transactions occurs. The first session's next iTQL command then reports an error indicating that the transactions were lost.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqloperations/datatypingmodels.html
===================================================================
--- trunk/docs/site/itqloperations/datatypingmodels.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqloperations/datatypingmodels.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,527 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Datatyping Models</title>
+ <meta name="keywords" content="Datatyping Models, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/itqloperations/datatypingmodels.html#o263">Creating</a> |
+ <a href="/itqloperations/datatypingmodels.html#o264">Loading</a> |
+ <a href="/itqloperations/datatypingmodels.html#o265">Querying</a> |
+ <a href="/itqloperations/datatypingmodels.html#o266">Limitations</a>
+
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/itqloperations/fulltextmodels.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqloperations/nodetyping.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="254.htm">Advanced iTQL Operations</a></p>
+<p class="relateditem"><a href="/itqloperations/views.html">Views</a></p>
+<p class="relateditem"><a href="/itqloperations/fulltextmodels.html">Full-Text Models</a></p>
+<p class="relateditem"><a href="/itqloperations/nodetyping.html">Nodetyping Models</a></p>
+<p class="relateditem"><a href="/itqloperations/filesysmodel.html">Filesystem Models</a></p>
+
+ -->
+
+
+
+
+<h2>Datatyping Models</h2>
+
+<p>Datatyping models represent the property of orderedness that literals like dates and numbers possess. They are used to constrain results to be above, below, or between specified dates or numbers.</p>
+
+<p>Datatyping models are generally read-only. You do not insert statements into them as you do with standard or full-text models. Conceptually, they contain every true statement about their datatype, such as 1 is less than 2 and Christmas Day is after Christmas Eve.</p>
+<div class="anchor"><a name="o263"> </a></div>
+<h3>Creating Datatyping Models</h3>
+
+<p>Use the <code><a id="h209" class="documentlinktemplate" title="create" href="/itqlcommands/create.html">create</a></code> command with an optional type argument of <code><http://mulgara.org/mulgara#XMLSchemaModel></code> in addition to the model name.</p>
+
+<p>For example, to create the datatyping model <code>#xsd</code>:</p>
+
+<p class="commandtext">create <rmi://mysite.com/server1#xsd> <http://mulgara.org/mulgara#XMLSchemaModel>;</p>
+
+<p class="note"><strong>Note -</strong> Generally, there is no need to create more than one datatyping model per Mulgara server.</p>
+<div class="anchor"><a name="o264"> </a></div>
+<h3>Loading Datatyping Models</h3>
+
+<p>As well as having a value, typed literals (such as the number 7.5, as opposed to the untyped text "7.5") also have a datatype, which is identified by a URI.</p>
+
+<p>The primitive datatypes supported by Mulgara are listed in the following table.</p>
+<table width="546" cellpadding="2" cellspacing="0" border="0" style="border-collapse:collapse">
+<tr align="left" valign="top">
+<th width="144">
+<p class="tableheading">Datatype</p>
+</th>
+<th width="402">
+<p class="tableheading">Description</p>
+</th>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>string</code></p>
+</td>
+<td width="402">
+<p>Character strings. For example, John</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>boolean</code></p>
+</td>
+<td width="402">
+<p>The mathematical concept of binary-valued logic. For example, true or false</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>decimal</code></p>
+</td>
+<td width="402">
+<p>Arbitrary precision decimal numbers. For example, 1.23</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>float</code></p>
+</td>
+<td width="402">
+<p>Single precision floating point numbers. For example, 1.23E4</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>double</code></p>
+</td>
+<td width="402">
+<p>Double precision floating point numbers. For example, 1.23E4</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>dateTime</code></p>
+</td>
+<td width="402">
+<p>A point in time specified to one second accuracy. For example, 2004-12-24T23:59:59 (one second to Christmas Day 2004, UTC)</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>date</code></p>
+</td>
+<td width="402">
+<p>A point in time specified to one day accuracy. For example, 2004-12-24 (Christmas Eve 2004)</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>gYearMonth</code></p>
+</td>
+<td width="402">
+<p>A specific gregorian month in a specific gregorian year. For example, 2004-12 (December 2004)</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>gYear</code></p>
+</td>
+<td width="402">
+<p>A gregorian calendar year. For example, 2004</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>gMonthDay</code></p>
+</td>
+<td width="402">
+<p>A day of the year. For example, 12-25 (Christmas Day)</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>gDay</code></p>
+</td>
+<td width="402">
+<p>A day of the month. For example, 25 (25th day of the month)</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>gMonth</code></p>
+</td>
+<td width="402">
+<p>A month of the year. For example, 12 (12th month of the year)</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>hexBinary</code></p>
+</td>
+<td width="402">
+<p>Arbitrary hex-encoded binary data</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>base64Binary</code></p>
+</td>
+<td width="402">
+<p>Arbitrary Base64-encoded binary data</p>
+</td>
+</tr>
+
+</table>
+
+<p>The primitive datatypes currently <em>not supported</em> by Mulgara are listed the following table.</p>
+<table width="546" cellpadding="2" cellspacing="0" border="0" style="border-collapse:collapse">
+<tr align="left" valign="top">
+<th width="144">
+<p class="tableheading">Datatype</p>
+</th>
+<th width="402">
+<p class="tableheading">Description</p>
+</th>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>duration</code></p>
+</td>
+<td width="402">
+<p>A duration of time</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>anyURI</code></p>
+</td>
+<td width="402">
+<p>A Uniform Resource Identifier Reference (URI)</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>QName</code></p>
+</td>
+<td width="402">
+<p>Qualified XML names</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>NOTATION</code></p>
+</td>
+<td width="402">
+<p>The NOTATION attribute type</p>
+</td>
+</tr>
+
+</table>
+
+<p>The derived datatypes currently supported by Mulgara are listed the following table.</p>
+<table width="546" cellpadding="2" cellspacing="0" border="0" style="border-collapse:collapse">
+<tr align="left" valign="top">
+<th width="144">
+<p class="tableheading">Datatype</p>
+</th>
+<th width="402">
+<p class="tableheading">Description</p>
+</th>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>integer</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>decimal</code> with no fractional digits</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>nonPositiveInteger</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>integer</code> with a maximum value of 0</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>negativeInteger</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>nonPositiveInteger</code> with a maximum value of -1</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>long</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>integer</code> with a maximum value of 9223372036854775807 and a minimum value of -9223372036854775807</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>int</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>long</code> with a maximum value of 2147483647 and a minimum value of -2147483648</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>short</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>int</code> with a maximum value of 32767 and a minimum value of -32767</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>byte</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>short</code> with a maximum value of 127 and a minimum value of -128</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>nonNegativeInteger</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>integer</code> with a minimum value of 0</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>unsignedLong</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>nonNegativeInteger</code> with a maximum value of 18446744073709551615</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>unsignedInt</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>unsignedLong </code>with a maximum value of 4294967295</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>unsignedShort</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>unsignedInt </code>with a maximum value of 65535</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>unsignedByte</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>unsignedShort </code>with a maximum value of 255</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>positiveInteger</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>nonNegativeInteger</code> with a minimum value of 1</p>
+</td>
+</tr>
+
+</table>
+
+<p>The derived datatypes currently <em>not supported</em> by Mulgara are listed the following table.</p>
+<table width="546" cellpadding="2" cellspacing="0" border="0" style="border-collapse:collapse">
+<tr align="left" valign="top">
+<th width="144">
+<p class="tableheading">Datatype</p>
+</th>
+<th width="402">
+<p class="tableheading">Description</p>
+</th>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>normalizedString</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>string</code> without carriage return, line feed or tab characters</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>token</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>normalizedString</code> without leading or trailing spaces and no internal sequences of two or more spaces</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>language</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>token</code> and is the set of all valid language identifiers</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>NMTOKEN</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>token</code> and represents the NMTOKEN attribute type</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>NMTOKENS</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>NMTOKEN</code> and represents the NMTOKENS attribute type</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>Name</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>token</code> and represents XML Names</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>NCName</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>Name</code> and represents XML non-colonized Names</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>ID</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>NCName</code> and represents the ID attribute type</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>IDREF</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>ID</code> and represents the IDREF attribute type</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>IDREFS</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>IDREF</code> and represents the IDREFS attribute type</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>ENTITY</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>NCName</code> and represents the ENTITY attribute type</p>
+</td>
+</tr>
+<tr align="left" valign="top">
+<td width="144">
+<p><code>ENTITIES</code></p>
+</td>
+<td width="402">
+<p>Derived from <code>ENTITY</code> and represents the ENTITIES attribute type</p>
+</td>
+</tr>
+
+</table>
+
+<p class="note"><strong>Note -</strong> The URI prefix for all of the datatypes listed above is <code>http://www.w3.org/2001/XMLSchema#</code>. For example <code>http://www.w3.org/2001/XMLSchema#string</code>. More information about these datatypes is in the W3C document <a class="internetlinktemplate" title="" href="http://www.w3.org/TR/xmlschema-2/">XML Schema Part 2: Datatypes</a>.</p>
+
+<p>The syntax to express a typed literal is to separate a literal value and its type with a double-caret (<code>^^</code>).</p>
+
+<p>For example, consider the statement that a text file was created on Christmas Eve 2004. This could be inserted into a model as follows:</p>
+
+<p class="commandtext">insert <file:/nice.txt> <dc:date> '2004-12-24'^^<<code>http://www.w3.org/2001/XMLSchema#date</code>><br />
+ into <rmi://mysite.com/server1#model>;</p>
+
+<p>Remember that the command <code>alias <http://www.w3.org/2001/XMLSchema#> as xsd;</code> allows you to write the insert command as follows:</p>
+
+<p class="commandtext">insert <file:/nice.txt> <dc:date> '2004-12-24'^^<<code>xsd:date</code>><br />
+ into <rmi://mysite.com/server1#model>;</p>
+
+<p>Alternatively, the following could be loaded from an RDF/XML file:</p>
+
+<p class="commandtext"><rdf:RDF xmlns:dc = "http://purl.org/dc/elements/1.1/"<br />
+ xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"<br />
+ xmlns:xsd = "http://www.w3.org/2001/XMLSchema#"><br />
+<rdf:Description rdf:about="file:/nice.txt"><br />
+ <dc:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date"> 2004-12-24 </dc:date><br />
+</rdf:Description><br />
+</rdf:RDF></p>
+
+<p class="note"><strong>Note -</strong> Datatyped statements are loaded into normal models, not datatyping models. Datatyping models cannot be written to, as this would be like trying to redefine the fixed nature of numbers or dates.</p>
+<div class="anchor"><a name="o265"> </a></div>
+<h3>Querying Datatyping Models</h3>
+
+<p>Querying datatyping models is much the same as for normal Mulgara models. Datatyping models contain all statements with the following properties that happen to be true for the relevant datatype:</p>
+<ul><li><code><mulgara:lt></code>
+<p class="listcontinue">The subject is numerically less than the object, where both have a numeric datatype.</p>
+</li><li><code><mulgara:gt></code>
+<p class="listcontinue">The subject is numerically greater than the object, where both have a numeric datatype.</p>
+</li><li><code><mulgara:after></code>
+<p class="listcontinue">The subject occurs after the object, where both have a date datatype. That is, <code>xsd:date</code>, <code>xsd:dateTime</code>, <code>xsd:gYear</code> and <code>xsd:gYearMonth</code></p>
+</li><li><code><mulgara:before></code>
+<p class="listcontinue">The subject occurs before the object, where both have a date datatype. That is, <code>xsd:date</code>, <code>xsd:dateTime</code>, <code>xsd:gYear</code> and <code>xsd:gYearMonth</code></p>
+</li></ul>
+<p class="note"><strong>Note -</strong> The datatypes listed above assume a prior <code>alias <http://www.w3.org/2001/XMLSchema#> as xsd;</code> command was performed.</p>
+
+<p>See the <a id="h2996" class="documentlinktemplate" title="Loading Datatyping Models" href="/itqloperations/datatypingmodels.html#o264">Loading Datatyping Models section</a> for more information on the datatypes supported by Mulgara.</p>
+
+<p>To use a datatyping model in a query, compose a constraint with one of the above properties and direct it at the XML Schema model with the <code><a id="h206" class="documentlinktemplate" title="where Clause" href="/itqlcommands/select.html#o197">in</a></code> clause. For example, the following query lists all resources from the 19th century:</p>
+
+<p class="commandtext">select $doc from <rmi://mysite.com/server1#model><br />
+ where $doc <dc:date> $date<br />
+ and $date <mulgara:before> '2000-01-01' in <rmi://mysite.com/server1#xsd><br />
+ and $date <mulgara:after> '1899-12-31' in <rmi://mysite.com/server1#xsd>;</p>
+<div class="anchor"><a name="o266"> </a></div>
+<h3>Limitations of Datatyping Models</h3>
+
+<p>Datatyping models have the following limitations:</p>
+<ul><li>Mulgara treats values with the <code>xsd:date</code> datatype as midnight of the corresponding day.</li><li>For <code>xsd:dateTime</code>, Mulgara does not parse time zones.</li><li>Constraints containing variables for both the subject and object may not work when applied to a datatyping model.</li><li><code>xsd:decimal</code> and its derived types are currently only implemented as a 64-bit long and are not arbitrary-precision.</li></ul>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqloperations/filesysmodel.html
===================================================================
--- trunk/docs/site/itqloperations/filesysmodel.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqloperations/filesysmodel.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,240 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Filesystem Models</title>
+ <meta name="keywords" content="Filesystem Models, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/itqloperations/filesysmodel.html#o3202">Creating</a> |
+ <a href="/itqloperations/filesysmodel.html#o3204">Updating</a> |
+ <a href="/itqloperations/filesysmodel.html#o3203">Querying</a>
+
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/itqloperations/nodetyping.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/overview/links.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="254.htm">Advanced iTQL Operations</a></p>
+<p class="relateditem"><a href="/itqloperations/views.html">Views</a></p>
+<p class="relateditem"><a href="/itqloperations/fulltextmodels.html">Full-Text Models</a></p>
+<p class="relateditem"><a href="/itqloperations/datatypingmodels.html">Datatyping Models</a></p>
+<p class="relateditem"><a href="/itqloperations/nodetyping.html">Nodetyping Models</a></p>
+
+ -->
+
+
+
+
+<h2>Filesystem Models</h2>
+
+<p>Filesystem models are special instances of external resolvers that work in conjunction with the internal system model. In this way they are similar to views except that they gather information about files on a local drive instead of models. See the <a id="h1497" class="documentlinktemplate" title="Views" href="/itqloperations/views.html">Views section</a> for more information about views.</p>
+
+<p>The capabilities of filesystem models include the ability to:</p>
+<ul><li>Specify the files and directories to include or exclude.</li><li>Query against filesystems to retrieve file metadata.</li></ul>
+
+<div class="anchor"><a name="o3202"> </a></div>
+<h3>Creating Filesystem Models</h3>
+
+<p>You can create filesystem models by:</p>
+<ol><li>Using the iTQL <a id="h1523" class="documentlinktemplate" title="create" href="/itqlcommands/create.html">create</a> command, creating a model of type <code>http://mulgara.org/mulgara#FileSystemModel</code>. This creates a filesystem model, plus a filesystem definition model.</li><li>Loading RDF that represents the directories and files to include or exclude into the filesystem definition model.</li></ol>
+<p>Use the <code><a id="h213" class="documentlinktemplate" title="drop" href="/itqlcommands/drop.html">drop</a></code> command to remove a filesystem model.</p>
+
+<p class="note"><strong>Note -</strong> Ensure that you drop the filesystem model and not the filesystem definition model. Dropping the filesystem model automatically drops the filesystem definition model as well. Dropping the filesystem definition model leaves the filesystem model behind.</p>
+<div class="anchor"><a name="o3204"> </a></div>
+<h3>Updating Filesystem Models</h3>
+
+<p>Filesystem models are designed to query for filesystem information. Rather than the entire file system, you might only be interested in specific subsections of the filesystem, and within those subsections, there might be files and directories you want to exclude because they contain irrelevant data.</p>
+
+<p>This include and exclude functionality is provided by the filesystem definition model. Statements specifying the files and directories to include or exclude are loaded into the filesystem definition model using the <a id="h1325" class="documentlinktemplate" title="insert" href="/itqlcommands/insert.html">insert</a> command.</p>
+
+<p>The following example shows how to include a specific directory for your filesystem model (assuming that you have already created a filesystem model called <code>cDrive</code>):</p>
+
+<p class="commandtext">insert $x <http://mulgara.org/mulgara/filesystem#Include> <file:///C:/myDocuments><br />
+ into <rmi://mysite.com/server1?def#cDrive>;</p>
+
+<p class="note"><strong>Note -</strong> Include and exclude statements are inserted into the filesystem definition model. Statements inserted into the main filesystem model are ignored when a query is performed.</p>
+
+<p>The following example shows how to exclude a directory in your filesystem model (assuming that you have already created a filesystem model called <code>cDrive</code>):</p>
+
+<p class="commandtext">insert $x <http://mulgara.org/mulgara/filesystem#Exclude> <file:///C:/myDocuments/spreadsheets><br />
+ into <rmi://mysite.com/server1?def#cDrive>;</p>
+
+<p>Note the following points about the include and exclude statements in the filesystem definition model:</p>
+<ul><li>The subject of an inclusion or exclusion statement is not important. This is why blank nodes are used.</li><li>Statements in the definition model that are not of the form shown in the above examples are ignored when you query the filesystem model.</li><li>The URIs that specify the files and directories to include or exclude must be of the <code>file</code> protocol. Anything else is reported as an invalid filesystem as part of the result of a filesystem model query.</li><li>Use the <a id="h214" class="documentlinktemplate" title="delete" href="/itqlcommands/delete.html">delete</a> command to remove statements from filesystem definition models.</li></ul>
+<div class="anchor"><a name="o3203"> </a></div>
+<h3>Querying Filesystem Models</h3>
+
+<p>Once the inclusions and exclusions are set up, you can query the filesystem model using the <code><a id="h1311" class="documentlinktemplate" title="select" href="/itqlcommands/select.html">select</a></code> command, as you would any other model, to generate statements about the files and directories.</p>
+
+<p>The following schema is used for filesystem models:</p>
+
+<p class="commandtext"><?xml version="1.0" encoding="UTF-8"?><br />
+<br />
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"<br />
+ xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"<br />
+ xmlns:dc="http://purl.org/dc/elements/1.1/"<br />
+ xml:base="http://mulgara.org/mulgara"<br />
+ xml:lang="en"><br />
+<br />
+ <rdfs:Class rdf:ID="File"<br />
+ rdfs:label="file"<br />
+ rdfs:comment="A file on an operating system"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ </rdfs:Class><br />
+<br />
+ <rdfs:Class rdf:ID="Directory"<br />
+ rdfs:label="directory"<br />
+ rdfs:comment="A directory on an operating system"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ </rdfs:Class><br />
+<br />
+ <rdfs:Class rdf:ID="Hidden"<br />
+ rdfs:label="hidden file"<br />
+ rdfs:comment="A hidden file on an operating system"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ <rdfs:subClassOf rdf:resource="#File"/><br />
+ </rdfs:Class><br />
+<br />
+ <rdfs:Class rdf:ID="ReadOnly"<br />
+ rdfs:label="read only file"<br />
+ rdfs:comment="A read only file on an operating system"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ <rdfs:subClassOf rdf:resource="#File"/><br />
+ </rdfs:Class><br />
+<br />
+ <rdf:Property rdf:ID="filename"<br />
+ rdfs:label="filename"<br />
+ rdfs:comment="Specifies the name of a file"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ <rdfs:domain rdf:resource="#File"/><br />
+ <rdfs:domain rdf:resource="#Directory"/><br />
+ <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/><br />
+ </rdf:Property><br />
+<br />
+ <rdf:Property rdf:ID="extension"<br />
+ rdfs:label="extension"<br />
+ rdfs:comment="Specifies the extension of a file"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ <rdfs:domain rdf:resource="#File"/><br />
+ <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/><br />
+ </rdf:Property><br />
+<br />
+ <rdf:Property rdf:ID="path"<br />
+ rdfs:label="path"<br />
+ rdfs:comment="Specifies the path of a file (as an URI)"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ <rdfs:domain rdf:resource="#File"/><br />
+ <rdfs:domain rdf:resource="#Directory"/><br />
+ <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/><br />
+ </rdf:Property><br />
+<br />
+ <rdf:Property rdf:ID="created"<br />
+ rdfs:label="created"<br />
+ rdfs:comment="Specifies the creation date of a file"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ <rdfs:domain rdf:resource="#File"/><br />
+ <rdfs:domain rdf:resource="#Directory"/><br />
+ <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#dateTime"/><br />
+ </rdf:Property><br />
+<br />
+ <rdf:Property rdf:ID="accessed"<br />
+ rdfs:label="accessed"<br />
+ rdfs:comment="Specifies the last accessed date of the file"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ <rdfs:domain rdf:resource="#File"/><br />
+ <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#dateTime"/><br />
+ </rdf:Property><br />
+<br />
+ <rdf:Property rdf:ID="modified"<br />
+ rdfs:label="modified"<br />
+ rdfs:comment="Specifies the last modified date of a file"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ <rdfs:domain rdf:resource="#File"/><br />
+ <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#dateTime"/><br />
+ </rdf:Property><br />
+<br />
+ <rdf:Property rdf:ID="parent"<br />
+ rdfs:label="parent"<br />
+ rdfs:comment="Specifies the parent directory"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ <rdfs:domain rdf:resource="#File"/><br />
+ <rdfs:domain rdf:resource="#Directory"/><br />
+ <rdfs:range rdf:resource="http://mulgara.org/mulgara#Directory"/><br />
+ </rdf:Property><br />
+<br />
+ <rdf:Property rdf:ID="size"<br />
+ rdfs:label="size"<br />
+ rdfs:comment="Specifies the size in bytes of a file"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ <rdfs:domain rdf:resource="#File"/><br />
+ <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#integer"/><br />
+ </rdf:Property><br />
+<br />
+ <rdf:Property rdf:ID="owner"<br />
+ rdfs:label="owner"<br />
+ rdfs:comment="Specifies the owner of a file"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ <rdfs:domain rdf:resource="#File"/><br />
+ <rdfs:domain rdf:resource="#Directory"/><br />
+ <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#string"/><br />
+ </rdf:Property><br />
+<br />
+ <rdf:Property rdf:ID="canRead"<br />
+ rdfs:label="can read"<br />
+ rdfs:comment="Specifies if the file can be read (by the current user)"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ <rdfs:domain rdf:resource="#File"/><br />
+ <rdfs:domain rdf:resource="#Directory"/><br />
+ <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/><br />
+ </rdf:Property><br />
+<br />
+ <rdf:Property rdf:ID="canWrite"<br />
+ rdfs:label="can write"<br />
+ rdfs:comment="Specifies if the file can be written to (by the current user)"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ <rdfs:domain rdf:resource="#File"/><br />
+ <rdfs:domain rdf:resource="#Directory"/><br />
+ <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/><br />
+ </rdf:Property><br />
+<br />
+ <rdf:Property rdf:ID="canExecute"<br />
+ rdfs:label="can execute"<br />
+ rdfs:comment="Specifies if the file can be executed (by the current user)"><br />
+ <rdfs:isDefinedBy rdf:resource="http://mulgara.org/mulgara"/><br />
+ <rdfs:domain rdf:resource="#File"/><br />
+ <rdfs:domain rdf:resource="#Directory"/><br />
+ <rdfs:range rdf:resource="http://www.w3.org/2001/XMLSchema#boolean"/><br />
+ </rdf:Property><br />
+</rdf:RDF><br />
+ </p>
+
+<p class="note"><strong>Note -</strong> Querying the filesystem definition model only returns the inclusion and exclusion statements, not the filesystem information.</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqloperations/fulltextmodels.html
===================================================================
--- trunk/docs/site/itqloperations/fulltextmodels.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqloperations/fulltextmodels.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,135 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Full-Text Models</title>
+ <meta name="keywords" content="Full-Text Models, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/itqloperations/fulltextmodels.html#o258">Creating</a> |
+ <a href="/itqloperations/fulltextmodels.html#o259">Modifying</a> |
+ <a href="/itqloperations/fulltextmodels.html#o260">Querying</a> |
+ <a href="/itqloperations/fulltextmodels.html#o261">Limitations</a>
+
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/itqloperations/views.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqloperations/datatypingmodels.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="254.htm">Advanced iTQL Operations</a></p>
+<p class="relateditem"><a href="/itqloperations/views.html">Views</a></p>
+<p class="relateditem"><a href="/itqloperations/datatypingmodels.html">Datatyping Models</a></p>
+<p class="relateditem"><a href="/itqloperations/nodetyping.html">Nodetyping Models</a></p>
+<p class="relateditem"><a href="/itqloperations/filesysmodel.html">Filesystem Models</a></p>
+
+ -->
+
+
+
+
+<h2>Full-Text Models</h2>
+
+<p>Normally in Mulgara, searches for literal values in models only succeed when there is an exact match.</p>
+
+<p><a class="internetlinktemplate" title="Jakarta Project's Lucene" href="http://jakarta.apache.org/lucene/docs/index.html">Lucene</a> is a full-text search engine integrated into Mulgara by treating the Lucene index as a model. With full-text models, searches for literal values in models succeed when there is a partial match.</p>
+
+<p>The following sections outline how to create, modify, query full-text models, plus the limitations of full-text models.</p>
+
+<p>Visit the <a class="internetlinktemplate" title="" href="http://jakarta.apache.org/lucene/docs/systemproperties.html">Lucene System Properties</a> Web site for information on the performance and operational properties you can set.</p>
+
+
+<div class="anchor"><a name="o258"> </a></div>
+<h3>Creating Full-Text Models</h3>
+
+<p>Use the <code><a id="h209" class="documentlinktemplate" title="create" href="/itqlcommands/create.html">create</a></code> command with an optional type argument of <code><http://mulgara.org/mulgara#LuceneModel></code> in addition to the model name.</p>
+
+<p>For example, to create the full-text model <code>#foo</code>:</p>
+
+<p class="commandtext">create <rmi://mysite.com/server1#foo> <http://mulgara.org/mulgara#LuceneModel>;</p>
+
+<p class="note"><strong>Note -</strong> Specifying no type at all creates a normal Mulgara model.</p>
+
+<p>Full-text models are removed in exactly the same way as normal models. For example:</p>
+
+<p class="commandtext">drop <rmi://mysite.com/server1#foo>;</p>
+<div class="anchor"><a name="o259"> </a></div>
+<h3>Modifying Full-Text Models</h3>
+
+<p>As with normal models, use the <code><a id="h212" class="documentlinktemplate" title="insert" href="/itqlcommands/insert.html">insert</a></code> command to insert statements into a full-text model.</p>
+
+<p>When inserting statements into a full-text model, the object is the text that is specially indexed for partial matching. If the object is a literal, the text of the literal is indexed. Indexing literals into a model uses the same as for any other model. For example:</p>
+
+<p class="commandtext">insert <http://www.mysite.com/somedoc.txt><br />
+ <http://mulgara.org/mulgara/Document#title> 'Document title'<br />
+ into <rmi://mysite.com/server1#foo>;</p>
+
+<p>If the object is a resource, the resource is converted into a URL, the URL is accessed by the server, and the content of the URL is indexed. The resource must have either a <code>http:</code> or <code>file:</code> protocol, or the <code>insert</code> fails, sometimes without generating an error. For example:</p>
+
+<p class="commandtext">insert <http://www.mysite.com/somedoc.txt><br />
+ <http://mulgara.org/mulgara/Document#abstract><br />
+ <http://www.mysite.com/abstract.txt><br />
+ into <rmi://mysite.com/server1#foo>;</p>
+
+<p>To perform full-text searching on literals stored in a normal model, the contents of the normal model must be copied into a full-text model. The following example shows how the document titles stored in the normal model <code>#data</code> are copied into the full-text model <code>#foo</code>.</p>
+
+<p class="commandtext">insert select $url <http://mulgara.org/mulgara/Document#title> $title<br />
+ from <rmi://mysite.com/server1#data><br />
+ where $url <http://mulgara.org/mulgara/Document#title> $title <br />
+ into <rmi://mysite.com/server1#foo>;</p>
+
+<p>If a statement is inserted into a full-text model and the server determines that the MIME type of the document is text/html, then the HTML tags are filtered out before indexing.</p>
+
+<p class="note"><strong>Note -</strong> The ability of Mulgara to correctly identify HTML input is limited, and only works when fetching a resource via HTTP from a web server that accurately reports the content type.</p>
+
+<p>Use the <code><a id="h214" class="documentlinktemplate" title="delete" href="/itqlcommands/delete.html">delete</a></code> command to delete text from full-text models.</p>
+<div class="anchor"><a name="o260"> </a></div>
+<h3>Querying Full-Text Models</h3>
+
+<p>Queries on full-text models work differently on normal models, as follows:</p>
+<ul><li>The <code><a id="h1335" class="documentlinktemplate" title="where Clause" href="/itqlcommands/select.html#o197">where</a></code> clause must have a literal-valued object.</li><li>The object portion of the <code>where</code> clause is passed to the underlying search engine as a pattern. The following types of pattern searches are possible:<ul><li>Wildcards</li><li>Fuzzy</li><li>Word proximity</li><li>Boosting a term</li><li>Boolean operators (and, or, not, +, -)
+<p class="listcontinue">For more information on Lucene searching, see the <a class="internetlinktemplate" title="Lucene query syntax" href="http://jakarta.apache.org/lucene/docs/queryparsersyntax.html">Lucene query syntax</a>.</p>
+</li></ul></li><li>If the <code>$score</code> variable is specified in the <code><a id="h1298" class="documentlinktemplate" title="select Clause" href="/itqlcommands/select.html#o188">select</a></code> clause, it is assigned a number from 0 to 1 indicating how close the match was. The <code>$score</code> variable must be part of the <code>select</code> clause in order to see it in the result.</li></ul>
+<p>Given the full-text model <code>#foo</code> populated in the previous section, the following query returns titles with the words "duty" and "care" in the title, as well as an indication of the quality of the match:</p>
+
+<p class="commandtext">select $url $title $score<br />
+ from <rmi://mysite.com/server1#data><br />
+ where $url <http://mulgara.org/mulgara/Document#title> $title<br />
+ and $url <http://mulgara.org/mulgara/Document#title> '+duty +care'<br />
+ in <rmi://mysite.com/server1#foo>;</p>
+
+<p class="note"><strong>Note -</strong> In the example above, the join is performed across the <code>$url</code> column, and the second <code>where</code> constraint is only executed against the full-text model <code>#foo.</code></p>
+
+<p>The index files for full-text models are stored in the <code>server1/fulltext</code><em> </em>directory.</p>
+<div class="anchor"><a name="o261"> </a></div>
+<h3>Limitations of Full-Text Models</h3>
+
+<p>Full-text models are an attempt to make a text index act like a Mulgara model, allowing both exact and partial matching to be mixed within queries. Full-text models have the following limitations:</p>
+<ul><li>Lucene is not transactional, so neither are the full-text models. If an operation fails, full-text models do not roll back along with the normal models.</li><li>The <code><a id="h215" class="documentlinktemplate" title="backup" href="/itqlcommands/backup.html">backup</a></code> and <code><a id="h222" class="documentlinktemplate" title="restore" href="/itqlcommands/restore.html">restore</a></code> commands do not include the content of full-text models.</li></ul>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqloperations/includeTOC.inc
===================================================================
--- trunk/docs/site/itqloperations/includeTOC.inc 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqloperations/includeTOC.inc 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,33 @@
+ <ul>
+ <li><a href="/itqloperations/views.html">Views</a></li>
+ <ul class="toc">
+ <li><a href="/itqloperations/views.html#o3012">Creating Views</a></li>
+ <li><a href="/itqloperations/views.html#o3013">Querying View Definitions</a></li>
+ <li><a href="/itqloperations/views.html#o256">Limitations of Views</a></li>
+ </ul>
+ <li><a href="/itqloperations/fulltextmodels.html">Full-Text Models</a></li>
+ <ul class="toc">
+ <li><a href="/itqloperations/fulltextmodels.html#o258">Creating Full-Text Models</a></li>
+ <li><a href="/itqloperations/fulltextmodels.html#o259">Modifying Full-Text Models</a></li>
+ <li><a href="/itqloperations/fulltextmodels.html#o260">Querying Full-Text Models</a></li>
+ <li><a href="/itqloperations/fulltextmodels.html#o261">Limitations of Full-Text Models</a></li>
+ </ul>
+ <li><a href="/itqloperations/datatypingmodels.html">Datatyping Models</a></li>
+ <ul class="toc">
+ <li><a href="/itqloperations/datatypingmodels.html#o263">Creating Datatyping Models</a></li>
+ <li><a href="/itqloperations/datatypingmodels.html#o264">Loading Datatyping Models</a></li>
+ <li><a href="/itqloperations/datatypingmodels.html#o265">Querying Datatyping Models</a></li>
+ <li><a href="/itqloperations/datatypingmodels.html#o266">Limitations of Datatyping Models</a></li>
+ </ul>
+ <li><a href="/itqloperations/nodetyping.html">Nodetyping Models</a></li>
+ <ul class="toc">
+ <li><a href="/itqloperations/nodetyping.html#o2780">Creating Nodetyping Models</a></li>
+ <li><a href="/itqloperations/nodetyping.html#o2781">Querying Nodetyping Models</a></li>
+ </ul>
+ <li><a href="/itqloperations/filesysmodel.html">Filesystem Models</a></li>
+ <ul class="toc">
+ <li><a href="/itqloperations/filesysmodel.html#o3202">Creating Filesystem Models</a></li>
+ <li><a href="/itqloperations/filesysmodel.html#o3204">Updating Filesystem Models</a></li>
+ <li><a href="/itqloperations/filesysmodel.html#o3203">Querying Filesystem Models</a></li>
+ </ul>
+ </ul>
Added: trunk/docs/site/itqloperations/index.html
===================================================================
--- trunk/docs/site/itqloperations/index.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqloperations/index.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,55 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Advanced iTQL Operations</title>
+ <meta name="keywords" content="Advanced iTQL Operations, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="/itqlcommands/set.html"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqloperations/views.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+ -->
+
+
+<h1>Advanced iTQL Operations</h1>
+
+<p>iTQL<sup>TM</sup> offers the following advanced features to assist with application development:</p>
+<ul><li>Views. Models with nested models and views</li><li>Full-text models. Models with full-text searching capabilities</li><li>Datatyping models. Models with special knowledge about numbers and dates</li><li>Nodetyping models. Models that represent the type that RDF nodes have in a graph</li></ul>
+<p>The following sections describe these features in detail.</p>
+
+
+<p class="relatedheading">In This Section</p>
+<p class="relateditem"><a href="/itqloperations/views.html">Views</a></p>
+<p class="relateditem"><a href="/itqloperations/fulltextmodels.html">Full-Text Models</a></p>
+<p class="relateditem"><a href="/itqloperations/datatypingmodels.html">Datatyping Models</a></p>
+<p class="relateditem"><a href="/itqloperations/nodetyping.html">Nodetyping Models</a></p>
+<p class="relateditem"><a href="/itqloperations/filesysmodel.html">Filesystem Models</a></p>
+
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqloperations/nodetyping.html
===================================================================
--- trunk/docs/site/itqloperations/nodetyping.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqloperations/nodetyping.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,166 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - Nodetyping Models </title>
+ <meta name="keywords" content="Nodetyping Models, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/itqloperations/nodetyping.html#o2780">Creating</a> |
+ <a href="/itqloperations/nodetyping.html#o2781">Querying</a>
+
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="262.htm"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="3201.htm"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="254.htm">Advanced iTQL Operations</a></p>
+<p class="relateditem"><a href="255.htm">Views</a></p>
+<p class="relateditem"><a href="257.htm">Full-Text Models</a></p>
+<p class="relateditem"><a href="262.htm">Datatyping Models</a></p>
+<p class="relateditem"><a href="3201.htm">Filesystem Models</a></p>
+
+ -->
+
+
+
+
+<h2>Nodetyping Models</h2>
+
+<p>Nodetyping models represent the type that RDF nodes have in a graph. RDF nodes can be typed either as a <em>Literal</em>, or as a <em>URI Reference</em>. Nodes without a type are <em>Blank Nodes</em>.</p>
+
+<p>Nodetyping models are used to constrain results to be literals or URI references. These types have the URIs of <code>http://www.w3.org/2000/01/rdf-schema#Literal</code> and <code>http://mulgara.org/mulgara#uriReference</code>. Generally, the standard set of aliases should be in place, and these URIs and can be referred to in the aliased forms: <code>rdfs:Literal</code> and <code>mulgara:uriReference</code>.</p>
+
+<p>The standard set of aliases is defined by the <code><a id="h1334" class="documentlinktemplate" title="alias" href="170.htm">alias</a></code> command:</p>
+
+<p class="commandtext">alias <http://mulgara.org/mulgara#> as mulgara;<br />
+alias <http://www.w3.org/1999/02/22-rdf-syntax-ns#> as rdf;<br />
+alias <http://www.w3.org/2000/01/rdf-schema#> as rdfs;</p>
+
+<p>Like datatyping models, nodetyping models are generally read-only. You do not insert statements into them as you do with standard or full-text models. Conceptually, they contain statements about the datatypes of nodes, such as:</p>
+
+<p class="commandtext">[ <http://namespace/ns#value> <rdf:type> <mulgara:uriReference> ]</p>
+
+<p>Nodetyping models also contain statements describing the type for all literals. While statements about literals are not strictly legal RDF, the statements do not exist in any RDF model, and are only used to constrain variables. An example of this kind of statement is:</p>
+
+<p class="commandtext">[ 'This is a string' <rdf:type> <rdfs:Literal> ]</p>
+
+<div class="anchor"><a name="o2780"> </a></div>
+<h3>Creating Nodetyping Models</h3>
+
+<p>Use the <code><a id="h1523" class="documentlinktemplate" title="create" href="176.htm">create</a></code> command with the optional type argument of <code>http://mulgara.org/mulgara#TypeModel</code> in addition to the model name. There should never be a need to create more than one nodetyping model per server.</p>
+
+<p>For example, to create the nodetyping model <code>#type</code>:</p>
+
+<p class="commandtext">create <rmi://mysite.com/server1#type> <http://mulgara.org/mulgara#TypeModel>;</p>
+
+<p>The <code>http://mulgara.org/mulgara#TypeModel</code> URI can be referred to in the aliased form <code><mulgara:TypeModel></code>, when the <code>mulgara</code> alias is active:</p>
+
+<p class="commandtext">alias <http://mulgara.org/mulgara#> as mulgara;</p>
+<div class="anchor"><a name="o2781"> </a></div>
+<h3>Querying Nodetyping Models</h3>
+
+<p>Querying nodetyping models is much the same as for normal Mulgara models. Nodetyping models contain type statements for all URI reference and literal nodes on the server (not just for a single model).</p>
+
+<p>To use a nodetyping model in a query, make sure you have a node type model available. See the <a id="h2782" class="documentlinktemplate" title="Creating Nodetyping Models" href="/itqloperations/nodetyping.html#o2780">Creating Nodetyping Models section</a> for more information. Then compose a constraint with the <code><rdf:type></code> property, and direct it at the node type model with an <code><a id="h2783" class="" title="in Specifier" href="187.htm#o1530">in</a></code> specifier.</p>
+
+<p>The example queries shown assume that the standard aliases are in place, as follows:</p>
+
+<p class="commandtext">alias <http://mulgara.org/mulgara#> as mulgara;<br />
+alias <http://www.w3.org/1999/02/22-rdf-syntax-ns#> as rdf;<br />
+alias <http://www.w3.org/2000/01/rdf-schema#> as rdfs;</p>
+
+<p>The first example uses the nodetyping model <code>rmi://mysite.com/server1#type</code> to return all subjects with the type URI Reference.</p>
+
+<p class="commandtext">select $subject from <rmi://mysite.com/server1#data><br />
+ where $subject $predicate $object<br />
+ and $subject <rdf:type> <mulgara:uriReference> in <rmi://mysite.com/server1#type>;</p>
+
+<p>This returns:</p>
+
+<p class="commandtext">[ http://qqq.com/staff/corky ]<br />
+[ http://qqq.com/staff/ppan ]<br />
+[ http://qqq.com/staff/spiderman ]<br />
+[ http://qqq.com/staff/superman ]</p>
+
+<p>The next example finds all predicates which are not used to refer to blank nodes. That is, the object node is either a literal or a URI reference.</p>
+
+<p class="commandtext">select $predicate from <rmi://mysite.com/server1#data><br />
+ where $subject $predicate $object<br />
+ and ($object <rdf:type> <mulgara:uriReference> in <rmi://mysite.com/server1#type><br />
+ or $object <rdf:type> <rdfs:Literal> in <rmi://mysite.com/server1#type>);</p>
+
+<p>This returns:</p>
+
+<p class="commandtext">[ http://www.w3.org/1999/02/22-rdf-syntax-ns#value ]<br />
+[ http://www.w3.org/2001/vcard-rdf/3.0#FN ]<br />
+[ http://www.w3.org/2001/vcard-rdf/3.0#Family ]<br />
+[ http://www.w3.org/2001/vcard-rdf/3.0#Given ]<br />
+[ http://www.w3.org/2001/vcard-rdf/3.0#Other ]<br />
+[ http://www.w3.org/2001/vcard-rdf/3.0#Prefix ]<br />
+[ http://www.w3.org/2001/vcard-rdf/3.0#BDAY ]<br />
+[ http://www.w3.org/2001/vcard-rdf/3.0#TITLE ]<br />
+[ http://www.w3.org/2001/vcard-rdf/3.0#ROLE ]<br />
+[ http://www.w3.org/2001/vcard-rdf/3.0#Street ]<br />
+[ http://www.w3.org/2001/vcard-rdf/3.0#Locality ]<br />
+[ http://www.w3.org/2001/vcard-rdf/3.0#Pcode ]<br />
+[ http://www.w3.org/2001/vcard-rdf/3.0#Country ]<br />
+[ http://www.w3.org/2001/vcard-rdf/3.0#NOTE ]</p>
+
+<p>The next example does not return any data as it looks for all statements that have a literal as the subject. This is not valid RDF so no data matches the constraints.</p>
+
+<p class="commandtext">select $subject from <rmi://mysite.com/server1#data><br />
+ where $subject $predicate $object<br />
+ and $subject <rdf:type> <rdfs:Literal> in <rmi://mysite.com/server1#type>);</p>
+
+<p>The next example finds a list of all literals in the system. Note that the model in the <code>from</code> clause is overridden and not used in the query.</p>
+
+<p class="commandtext">select $l from <rmi://mysite.com/server1#data><br />
+ where $l <rdf:type> <rdfs:Literal> in <rmi://mysite.com/server1#type>;</p>
+
+<p>The final example lists the literals found in a single model. It is only necessary to join the variable to the object position in the constraint, as literals can only appear in this position in RDF.</p>
+
+<p class="commandtext">select $object from <rmi://mysite.com/server1#data><br />
+ where $subject $predicate $object<br />
+ and $object <rdf:type> <rdfs:Literal> in <rmi://mysite.com/server1#type>;</p>
+
+<p>The first 10 lines of this 48 line result are:</p>
+
+<p class="commandtext">[ Corky Crystal ]<br />
+[ Crystal ]<br />
+[ Corky ]<br />
+[ Jacky ]<br />
+[ Dr ]<br />
+[ 1980-01-01 ]<br />
+[ Computer Officer Class 3 ]<br />
+[ Programmer ]<br />
+[ +61 7 555 5555 ]<br />
+[ corky at qqq.com ]</p>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/itqloperations/views.html
===================================================================
--- trunk/docs/site/itqloperations/views.html 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/itqloperations/views.html 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,145 @@
+<!--#include virtual='/includeTop.inc' -->
+
+ <title>Mulgara | Semantic Store - views</title>
+ <meta name="keywords" content="views, mulgara project, metadata, metastore, metadatabase, datastore, database, scaleable, scalable, transaction, java, open source, rdf, resource description framework" />
+
+<!--#include virtual='/includeMiddle.inc' -->
+
+ <div id="pageNaviBack"></div>
+ <div id="pageNavi">
+<!-- INNER PAGE NAVIGATION STARTS HERE -->
+
+ <a href="/itqloperations/views.html#o3012">Creating</a> |
+ <a href="/itqloperations/views.html#o3013">Querying View Definitions</a> |
+ <a href="/itqloperations/views.html#o256">Limitations</a>
+
+
+
+<!-- INNER PAGE NAVIGATION ENDS HERE -->
+ </div>
+
+
+ <div id="mainBack"></div>
+ <div id="main">
+<!-- PAGE CONTENT STARTS HERE -->
+
+
+
+
+
+<!--
+<p><a href="254.htm"><img src="previous.gif" alt="Previous Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+
+<p><a href="/itqloperations/fulltextmodels.html"><img src="next.gif" alt="Next Topic" height="25px" width="23px" vspace="2" hspace="2" align="bottom" border="0" /></a></p>
+<p class="relatedheading">See Also</p>
+<p class="relateditem"><a href="254.htm">Advanced iTQL Operations</a></p>
+<p class="relateditem"><a href="/itqloperations/fulltextmodels.html">Full-Text Models</a></p>
+<p class="relateditem"><a href="/itqloperations/datatypingmodels.html">Datatyping Models</a></p>
+<p class="relateditem"><a href="/itqloperations/nodetyping.html">Nodetyping Models</a></p>
+<p class="relateditem"><a href="/itqloperations/filesysmodel.html">Filesystem Models</a></p>
+ -->
+
+
+
+
+<h2>Views</h2>
+
+<p>Views are special models made up of one or more models or views. The advantages of views include:</p>
+<ul><li>Security permissions are defined and maintained at the nested model and view level.</li><li>Statements can be grouped within logical models for re-use and maintenance. For example, schemas can be maintained in a single model and shared with multiple views.</li><li>You can define model hierarchies. For example, views can support nested views.</li><li>There is an abstraction layer for the end-user application. That is, the application layer may only be concerned about a single view.</li><li>Views are defined in RDF and can be extended to support application specific requirements.</li></ul>
+
+<div class="anchor"><a name="o3012"> </a></div>
+<h3>Creating Views</h3>
+
+<p>You can create views by:</p>
+<ol><li>Using the iTQL <code><a id="h1523" class="documentlinktemplate" title="create" href="/itqlcommands/create.html">create</a></code> command, creating a model of type <code>http://mulgara.org/mulgara#ViewModel</code>. This creates the view, plus a view definition model.</li><li>Loading RDF that represents the set of models for the view, into the view definition model. For example, <code>rmi://mysite.com/server1?def#view1</code>.</li></ol>
+<p>Views are a symbolic model expression equivalent to an iTQL<sup>TM</sup> <code><a id="h218" class="documentlinktemplate" title="from Clause" href="/itqlcommands/select.html#o189">from</a></code> clause. Querying a view queries all of the models to which the view refers. When the URI of a view occurs in the <code>from</code> clause of a <code><a id="h207" class="documentlinktemplate" title="select" href="/itqlcommands/select.html">select</a></code> command, the view's model expression is substituted in place of the view URI when the query is processed.</p>
+
+<p>Any modifications applied to the view (by using <code><a id="h212" class="documentlinktemplate" title="insert" href="/itqlcommands/insert.html">insert</a></code>, <code><a id="h214" class="documentlinktemplate" title="delete" href="/itqlcommands/delete.html">delete</a></code> or <code><a id="h249" class="documentlinktemplate" title="load" href="/itqlcommands/load.html">load</a></code> commands, for example) only affect the view's definition and have no effect on the models to which the view refers.</p>
+
+<p>Since a view is a symbolic representation of a combination of models, any modifications to models to which the view refers are visible immediately via the view.</p>
+
+<p>Here is an RDF example, that when loaded into the view definition model, defines the set of models for a view:</p>
+
+<p class="commandtext"><?xml version="1.0"?><br />
+<!DOCTYPE rdf:RDF [<br />
+ <!ENTITY rdf 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'><br />
+ <!ENTITY mulgarav 'http://mulgara.org/mulgara/view#'><br />
+ <!ENTITY server 'rmi://mysite.com/server1'><br />
+]><br />
+<rdf:RDF xml:lang="en"<br />
+ xmlns:rdf="&rdf;"<br />
+ xmlns:mulgarav="&mulgarav;"><br />
+ <mulgarav:Union rdf:about="http://mulgara.org/mulgara/view"<br />
+ mulgarav:enabled="true"><br />
+ <mulgarav:model rdf:resource="&server;#model1"/><br />
+ <mulgarav:expr><br />
+ <mulgarav:Intersection><br />
+ <mulgarav:model rdf:resource="&server;#model2"/><br />
+ <mulgarav:model rdf:resource="&server;#model3"/><br />
+ </mulgarav:Intersection><br />
+ </mulgarav:expr><br />
+ <mulgarav:expr><br />
+ <mulgarav:Intersection><br />
+ <mulgarav:model rdf:resource="&server;#model4"/><br />
+ <mulgarav:model rdf:resource="&server;#model5"/><br />
+ </mulgarav:Intersection><br />
+ </mulgarav:expr><br />
+ </mulgarav:Union><br />
+</rdf:RDF></p>
+
+<p>Which generates the following triples:</p>
+
+<p class="commandtext">http://mulgara.org/mulgara/view http://mulgara.org/mulgara/view#enabled 'true'<br />
+http://mulgara.org/mulgara/view http://mulgara.org/mulgara/view#expr rmi://mysite.com/server1#node32<br />
+http://mulgara.org/mulgara/view http://mulgara.org/mulgara/view#expr rmi://mysite.com/server1#node35<br />
+http://mulgara.org/mulgara/view http://mulgara.org/mulgara/view#model rmi://mysite.com/server1#model1<br />
+http://mulgara.org/mulgara/view http://www.w3.org/1999/02/22-rdf-syntax-ns#type<br />
+ http://mulgara.org/mulgara/view#Union<br />
+rmi://mysite.com/server1#node32 http://mulgara.org/mulgara/view#model rmi://mysite.com/server1#model2<br />
+rmi://mysite.com/server1#node32 http://mulgara.org/mulgara/view#model rmi://mysite.com/server1#model3<br />
+rmi://mysite.com/server1#node32 http://www.w3.org/1999/02/22-rdf-syntax-ns#type<br />
+ http://mulgara.org/mulgara/view#Intersection<br />
+rmi://mysite.com/server1#node35 http://mulgara.org/mulgara/view#model rmi://mysite.com/server1#model4<br />
+rmi://mysite.com/server1#node35 http://mulgara.org/mulgara/view#model rmi://mysite.com/server1#model5<br />
+rmi://mysite.com/server1#node35 http://www.w3.org/1999/02/22-rdf-syntax-ns#type<br />
+ http://mulgara.org/mulgara/view#Intersection</p>
+
+<p>The RDF is equivalent to the following <code>from</code> clause:</p>
+
+<p class="commandtext">... from <rmi://mysite.com/server1#model1> or<br />
+ (<rmi://mysite.com/server1#model2> and<br />
+ <rmi://mysite.com/server1#model3>) or<br />
+ (<rmi://mysite.com/server1#model4> and<br />
+ <rmi://somewhere.com/server1#model5>) ...</p>
+
+<p>If the above RDF is loaded into the view definition model, <code>rmi://mysite.com/server1?def#view1</code>, then the following <code>from</code> clause is equivalent to the preceding one:</p>
+
+<p class="commandtext">... from <rmi://mysite.com/server1#view1> ...</p>
+<div class="anchor"><a name="o3013"> </a></div>
+<h3>Querying View Definitions</h3>
+
+<p>You can query the definition of a view by adding <code>?def</code> to the view name. For example:</p>
+
+<p class="commandtext">select $s $p $o <br />
+ from <rmi://mysite.com/server1?def#view1><br />
+ where $s $p $o;</p>
+
+<p>The <code>?def</code> query string can be used in the model URIs that are referenced by a view definition. That is, views can reference other views.</p>
+
+<p class="note"><strong>Note -</strong> Since views can reference other views, make sure you don't define views that reference each other.</p>
+<div class="anchor"><a name="o256"> </a></div>
+<h3>Limitations of Views</h3>
+
+<p>The current limitations of views are as follows:</p>
+<ul><li>Views may not be used for the <code>in</code> clause within a <code><a id="h1297" class="documentlinktemplate" title="where Clause" href="/itqlcommands/select.html#o197">where</a></code> clause of a <code><a id="h1298" class="documentlinktemplate" title="select Clause" href="/itqlcommands/select.html#o188">select</a></code> command.</li><li>Mutually referential views and reference loops are not detected.</li></ul>
+
+
+
+
+
+
+
+
+<!--#include virtual='/includeBottom.inc' -->
+
+
Added: trunk/docs/site/legal/fdl.txt
===================================================================
--- trunk/docs/site/legal/fdl.txt 2006-12-07 23:53:20 UTC (rev 144)
+++ trunk/docs/site/legal/fdl.txt 2006-12-08 00:02:42 UTC (rev 145)
@@ -0,0 +1,397 @@
+GNU Free Documentation License
+Version 1.2, November 2002
+
+
+Copyright (C) 2000,2001,2002 Free Software Foundation, Inc.
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+
+0. PREAMBLE
+
+The purpose of this License is to make a manual, textbook, or other
+functional and useful document "free" in the sense of freedom: to
+assure everyone the effective freedom to copy and redistribute it,
+with or without modifying it, either commercially or noncommercially.
+Secondarily, this License preserves for the author and publisher a way
+to get credit for their work, while not being considered responsible
+for modifications made by others.
+
+This License is a kind of "copyleft", which means that derivative
+works of the document must themselves be free in the same sense. It
+complements the GNU General Public License, which is a copyleft
+license designed for free software.
+
+We have designed this License in order to use it for manuals for free
+software, because free software needs free documentation: a free
+program should come with manuals providing the same freedoms that the
+software does. But this License is not limited to software manuals;
+it can be used for any textual work, regardless of subject matter or
+whether it is published as a printed book. We recommend this License
+principally for works whose purpose is instruction or reference.
+
+
+1. APPLICABILITY AND DEFINITIONS
+
+This License applies to any manual or other work, in any medium, that
+contains a notice placed by the copyright holder saying it can be
+distributed under the terms of this License. Such a notice grants a
+world-wide, royalty-free license, unlimited in duration, to use that
+work under the conditions stated herein. The "Document", below,
+refers to any such manual or work. Any member of the public is a
+licensee, and is addressed as "you". You accept the license if you
+copy, modify or distribute the work in a way requiring permission
+under copyright law.
+
+A "Modified Version" of the Document means any work containing the
+Document or a portion of it, either copied verbatim, or with
+modifications and/or translated into another language.
+
+A "Secondary Section" is a named appendix or a front-matter section of
+the Document that deals exclusively with the relationship of the
+publishers or authors of the Document to the Document's overall subject
+(or to related matters) and contains nothing that could fall directly
+within that overall subject. (Thus, if the Document is in part a
+textbook of mathematics, a Secondary Section may not explain any
+mathematics.) The relationship could be a matter of historical
+connection with the subject or with related matters, or of legal,
+commercial, philosophical, ethical or political position regarding
+them.
+
+The "Invariant Sections" are certain Secondary Sections whose titles
+are designated, as being those of Invariant Sections, in the notice
+that says that the Document is released under this License. If a
+section does not fit the above definition of Secondary then it is not
+allowed to be designated as Invariant. The Document may contain zero
+Invariant Sections. If the Document does not identify any Invariant
+Sections then there are none.
+
+The "Cover Texts" are certain short passages of text that are listed,
+as Front-Cover Texts or Back-Cover Texts, in the notice that says that
+the Document is released under this License. A Front-Cover Text may
+be at most 5 words, and a Back-Cover Text may be at most 25 words.
+
+A "Transparent" copy of the Document means a machine-readable copy,
+represented in a format whose specification is available to the
+general public, that is suitable for revising the document
+straightforwardly with generic text editors or (for images composed of
+pixels) generic paint programs or (for drawings) some widely available
+drawing editor, and that is suitable for input to text formatters or
+for automatic translation to a variety of formats suitable for input
+to text formatters. A copy made in an otherwise Transparent file
+format whose markup, or absence of markup, has been arranged to thwart
+or discourage subsequent modification by readers is not Transparent.
+An image format is not Transparent if used for any substantial amount
+of text. A copy that is not "Transparent" is called "Opaque".
+
+Examples of suitable formats for Transparent copies include plain
+ASCII without markup, Texinfo input format, LaTeX input format, SGML
+or XML using a publicly available DTD, and standard-conforming simple
+HTML, PostScript or PDF designed for human modification. Examples of
+transparent image formats include PNG, XCF and JPG. Opaque formats
+include proprietary formats that can be read and edited only by
+proprietary word processors, SGML or XML for which the DTD and/or
+processing tools are not generally available, and the
+machine-generated HTML, PostScript or PDF produced by some word
+processors for output purposes only.
+
+The "Title Page" means, for a printed book, the title page itself,
+plus such following pages as are needed to hold, legibly, the material
+this License requires to appear in the title page. For works in
+formats which do not have any title page as such, "Title Page" means
+the text near the most prominent appearance of the work's title,
+preceding the beginning of the body of the text.
+
+A section "Entitled XYZ" means a named subunit of the Document whose
+title either is precisely XYZ or contains XYZ in parentheses following
+text that translates XYZ in another language. (Here XYZ stands for a
+specific section name mentioned below, such as "Acknowledgements",
+"Dedications", "Endorsements", or "History".) To "Preserve the Title"
+of such a section when you modify the Document means that it remains a
+section "Entitled XYZ" according to this definition.
+
+The Document may include Warranty Disclaimers next to the notice which
+states that this License applies to the Document. These Warranty
+Disclaimers are considered to be included by reference in this
+License, but only as regards disclaiming warranties: any other
+implication that these Warranty Disclaimers may have is void and has
+no effect on the meaning of this License.
+
+
+2. VERBATIM COPYING
+
+You may copy and distribute the Document in any medium, either
+commercially or noncommercially, provided that this License, the
+copyright notices, and the license notice saying this License applies
+to the Document are reproduced in all copies, and that you add no other
+conditions whatsoever to those of this License. You may not use
+technical measures to obstruct or control the reading or further
+copying of the copies you make or distribute. However, you may accept
+compensation in exchange for copies. If you distribute a large enough
+number of copies you must also follow the conditions in section 3.
+
+You may also lend copies, under the same conditions stated above, and
+you may publicly display copies.
+
+
+3. COPYING IN QUANTITY
+
+If you publish printed copies (or copies in media that commonly have
+printed covers) of the Document, numbering more than 100, and the
+Document's license notice requires Cover Texts, you must enclose the
+copies in covers that carry, clearly and legibly, all these Cover
+Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
+the back cover. Both covers must also clearly and legibly identify
+you as the publisher of these copies. The front cover must present
+the full title with all words of the title equally prominent and
+visible. You may add other material on the covers in addition.
+Copying with changes limited to the covers, as long as they preserve
+the title of the Document and satisfy these conditions, can be treated
+as verbatim copying in other respects.
+
+If the required texts for either cover are too voluminous to fit
+legibly, you should put the first ones listed (as many as fit
+reasonably) on the actual cover, and continue the rest onto adjacent
+pages.
+
+If you publish or distribute Opaque copies of the Document