<docbook><section><title>OATDOCrdfstore</title><para> </para>
<title> rdfstore.js</title> rdfstore.js
<para>Client-side RDF store.
 (see <ulink url="OATDOCrdfbrowser">RDF Browser</ulink>)</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Objects</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStore(callback, options)</bridgehead>
<para>Creates the object.
 Argument callback is executed every time store&#39;s contents change.
 Available <computeroutput>options</computeroutput> (properties of options object) are:</para>
<itemizedlist mark="bullet" spacing="compact"><listitem><computeroutput><emphasis>ajaxStart</emphasis></computeroutput> - function to be executed when dereferencing starts </listitem>
<listitem><computeroutput><emphasis>ajaxEnd</emphasis><computeroutput> - function to be executed when dereferencing stops</computeroutput></computeroutput></listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Properties</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStore::data.triples</bridgehead>
<para>All loaded data in a big array of triples (array of arrays).</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStore::data.all</bridgehead>
<para>All loaded data in a complex JSON object, as shown in the Example.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStore::data.structured</bridgehead>
<para>Loaded data after filters have been applied.
 Same structure as <computeroutput>data.all</computeroutput>.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Methods</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStore::addURL(url, onstart, onend)</bridgehead>
<para>Dereferences url and adds its contents to store.
 <computeroutput>onstart</computeroutput> and <computeroutput>onend</computeroutput> arguments are used to override global <computeroutput>ajaxStart</computeroutput> and <computeroutput>ajaxEnd</computeroutput> parameters, respectively.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStore::addTriples(triplesArray, url)</bridgehead>
<para>Adds an array of triples (triplesArray) to storage.
 The url specifies the address where these triples originate.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStore::addXmlDoc(xmlDoc, url)</bridgehead>
<para>Adds an XML document (xmlDoc, fetched byOAT.AJAX.GETfor instance) to storage.
 The <computeroutput>url</computeroutput> specifies the address where this document originates.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStore::getTitle(itemReference)</bridgehead>
<para>Returns a reasonable title (falls back to URI) of an item in storage.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStore::simplify(string)</bridgehead>
<para>Simplifies an URI by removing as much as possible (leaving the part after &#39;#&#39; or &#39;/&#39;).</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStore::addFilter(type, value1, [value2])</bridgehead>
<para>Applies a pass filter to store contents.
 Filter type is specified as one of available constants.</para>
<para>For FILTER_PROPERTY, both 2nd and 3rd arguments should be used: these specify predicate value and object value(only resources having this P and O will pass).</para>
<para>For FILTER_URI, only 2nd argument should be used: this value specifies an URI to be filtered (only resources having this URI as O or S will pass).</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStore::removeFilter(type, value1, [value2])</bridgehead>
<para>Removes a previously set filter; syntax is the same as in <computeroutput>addFilter</computeroutput>.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStore::disable(url)</bridgehead>
<para>Temporarily disables (removes) all triples originating from URL from the store.
 URL must be dereferenced.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStore::enable(url)</bridgehead>
<para>Re-enables previously disabled URL, so its contents are loaded in a store.
 URL must be dereferenced.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Constants</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStoreData.FILTER_PROPERTY</bridgehead>
<para><ulink url="ToBeDone">ToBeDone</ulink></para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> OAT.RDFStoreData.FILTER_URI</bridgehead>
<para><ulink url="ToBeDone">ToBeDone</ulink></para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> CSS IDs</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> rdf_side</bridgehead>
<para><ulink url="ToBeDone">ToBeDone</ulink></para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> rdf_cache</bridgehead>
<para><ulink url="ToBeDone">ToBeDone</ulink></para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> rdf_filter</bridgehead>
<para><ulink url="ToBeDone">ToBeDone</ulink></para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> rdf_tabs</bridgehead>
<para><ulink url="ToBeDone">ToBeDone</ulink></para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> rdf_content</bridgehead>
<para><ulink url="ToBeDone">ToBeDone</ulink></para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Examples</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Example 1</bridgehead>
<programlisting>[
    {
        preds:{
            &quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&quot;:[
                &quot;http://www.w3.org/2000/10/swap/pim/contact#Male&quot;, 
                &quot;http://xmlns.com/foaf/0.1/Person&quot;
            ],
            &quot;http://www.w3.org/2000/01/rdf-schema#label&quot;:[&quot;Tim Berners-Lee&quot;], 
            &quot;http://www.w3.org/2000/10/swap/pim/contact#assistant&quot;:[{...}], 
            &quot;http://www.w3.org/2000/10/swap/pim/contact#homePage&quot;:[&quot;./&quot;], 
            &quot;http://www.w3.org/2000/10/swap/pim/contact#office&quot;:[{...}]
        },
        ouri:&quot;samples/tbl.xml&quot;,
        type:&quot;http://xmlns.com/foaf/0.1/PersonalProfileDocument&quot;,
        uri:&quot;_:832_0&quot;, 
        back:[{...}]
    }, 
    ...
]
</programlisting><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h3"> Example 2</bridgehead>
<programlisting>var callback = function() {
    alert(&quot;Store contents have changed, check them out!&quot;);
}
var store = new OAT.RDFStore(callback, {});
store.addURL(&quot;myRDF.n3&quot;);
</programlisting><para> <ulink url="CategoryDocumentation">CategoryDocumentation</ulink> <ulink url="CategoryOAT">CategoryOAT</ulink> <ulink url="CategoryOpenSource">CategoryOpenSource</ulink> <ulink url="CategoryToBeDone">CategoryToBeDone</ulink></para>
</section></docbook>