Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 71d40963b505df4524269198e237b3e3 > files > 979

virtuoso-opensource-doc-6.1.4-2.fc14.noarch.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
 <head profile="http://internetalchemy.org/2003/02/profile">
  <link rel="foaf" type="application/rdf+xml" title="FOAF" href="http://www.openlinksw.com/dataspace/uda/about.rdf" />
  <link rel="schema.dc" href="http://purl.org/dc/elements/1.1/" />
  <meta name="dc.title" content="1. Overview" />
  <meta name="dc.subject" content="1. Overview" />
  <meta name="dc.creator" content="OpenLink Software Documentation Team ;&#10;" />
  <meta name="dc.copyright" content="OpenLink Software, 1999 - 2009" />
  <link rel="top" href="index.html" title="OpenLink Virtuoso Universal Server: Documentation" />
  <link rel="search" href="/doc/adv_search.vspx" title="Search OpenLink Virtuoso Universal Server: Documentation" />
  <link rel="parent" href="overview.html" title="Chapter Contents" />
  <link rel="prev" href="virtuosofaq.html" title="Virtuoso 6 FAQ" />
  <link rel="next" href="contents.html" title="Contents" />
  <link rel="shortcut icon" href="../images/misc/favicon.ico" type="image/x-icon" />
  <link rel="stylesheet" type="text/css" href="doc.css" />
  <link rel="stylesheet" type="text/css" href="/doc/translation.css" />
  <title>1. Overview</title>
  <meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
  <meta name="author" content="OpenLink Software Documentation Team ;&#10;" />
  <meta name="copyright" content="OpenLink Software, 1999 - 2009" />
  <meta name="keywords" content="" />
  <meta name="GENERATOR" content="OpenLink XSLT Team" />
 </head>
 <body>
  <div id="header">
    <a name="virtuosotipsandtricks" />
    <img src="../images/misc/logo.jpg" alt="" />
    <h1>1. Overview</h1>
  </div>
  <div id="navbartop">
   <div>
      <a class="link" href="overview.html">Chapter Contents</a> | <a class="link" href="virtuosofaq.html" title="Virtuoso 6 FAQ">Prev</a> | <a class="link" href="installation.html" title="Installation Guide">Next</a>
   </div>
  </div>
  <div id="currenttoc">
   <form method="post" action="/doc/adv_search.vspx">
    <div class="search">Keyword Search: <br />
        <input type="text" name="q" /> <input type="submit" name="go" value="Go" />
    </div>
   </form>
   <div>
      <a href="http://www.openlinksw.com/">www.openlinksw.com</a>
   </div>
   <div>
      <a href="http://docs.openlinksw.com/">docs.openlinksw.com</a>
   </div>
    <br />
   <div>
      <a href="index.html">Book Home</a>
   </div>
    <br />
   <div>
      <a href="contents.html">Contents</a>
   </div>
   <div>
      <a href="preface.html">Preface</a>
   </div>
    <br />
   <div class="selected">
      <a href="overview.html">Overview</a>
   </div>
    <br />
   <div>
      <a href="WhatIsVirtuoso.html">What is Virtuoso?</a>
   </div>
   <div>
      <a href="virtwhydoi.html">Why Do I Need Virtuoso?</a>
   </div>
   <div>
      <a href="whatisnewto2x.html">Key Features of Virtuoso</a>
   </div>
   <div>
      <a href="virtuosofaq.html">Virtuoso 6 FAQ</a>
   </div>
   <div class="selected">
      <a href="virtuosotipsandtricks.html">Tips and Tricks</a>
    <div>
        <a href="#virtuosotipsandtricksspchar" title="How Can I execute SPARQL queries containing '$' character using ISQL?">How Can I execute SPARQL queries containing &#39;$&#39; character using ISQL?</a>
        <a href="#virtuosotipsandtricksfinddeadlockstables" title="How can I find on which table deadlocks occur?">How can I find on which table deadlocks occur?</a>
        <a href="#virtuosotipsandtricksoutotmemoryerror" title="How Can I configure parameters to avoid out of memory error?">How Can I configure parameters to avoid out of memory error?</a>
        <a href="#virtuosotipsandtricksrdftriggersoptions" title="What are &quot;Generate RDB2RDF triggers&quot; and &quot;Enable Data Syncs with Physical Quad Store&quot; RDF Views options?">What are &quot;Generate RDB2RDF triggers&quot; and &quot;Enable Data Syncs with Physical Quad Store&quot; RDF Views options?</a>
        <a href="#virtuosotipsandtricksmanagedaterangequery" title="How to Manage Date Range SPARQL queries?">How to Manage Date Range SPARQL queries?</a>
        <a href="#virtuosotipsandtricksquadstorageinternally" title="How can I see which quad storages exist and in which quad storage a graph resides?">How can I see which quad storages exist and in which quad storage a graph resides?</a>
        <a href="#virtuosotipsandtricksdroprecrdefstrg" title="Can I drop and re-create the DefaultQuadStorage?">Can I drop and re-create the DefaultQuadStorage?</a>
        <a href="#virtuosotipsandtricksgraphsecurity" title="How to display only some information from RDF graph?">How to display only some information from RDF graph?</a>
        <a href="#virtuosotipsandtrickssparqlcondport" title="Is it possible to have the SPARQL endpoint on a different port than the Conductor?">Is it possible to have the SPARQL endpoint on a different port than the Conductor?</a>
        <a href="#virtuosotipsandtricksenableadonetvs2010" title="How to enable the Virtuoso Entity Framework 3.5 ADO.Net Provider in Visual Studio 2010?">How to enable the Virtuoso Entity Framework 3.5 ADO.Net Provider in Visual Studio 2010?</a>
        <a href="#virtuosotipsandtrickscontrolunicode3" title="How Can I Control the normalization of UNICODE3 accented chars in free-text index?">How Can I Control the normalization of UNICODE3 accented chars in free-text index?</a>
        <a href="#virtuosotipsandtricksdefinegraphwithspongeroption" title="How Can I define graph with virt:rdf_sponger option set to &quot;on&quot;?">How Can I define graph with virt:rdf_sponger option set to &quot;on&quot;?</a>
        <a href="#virtuosotipsandtricksconvprstr" title="How do I use SPARUL to change a selection of property values from URI References to Literals?">How do I use SPARUL to change a selection of property values from URI References to Literals?</a>
        <a href="#virtuosotipsandtricksbulkloadcl" title="How is a Checkpoint performed against a Virtuoso Clustered Server?">How is a Checkpoint performed against a Virtuoso Clustered Server?</a>
        <a href="#virtuosotipsandtrickconstrprst" title="How can I use CONSTRUCT with PreparedStatements?">How can I use CONSTRUCT with PreparedStatements?</a>
        <a href="#virtuosotipsandtrickssparulupdatestrl" title="How can perform SPARQL Updates without transactional log size getting exceed?">How can perform SPARQL Updates without transactional log size getting exceed?</a>
        <a href="#virtuosotipsandtrickscrawlercustompl" title="How can I write custom crawler using PL?">How can I write custom crawler using PL?</a>
        <a href="#virtuosotipsandtrickscrawlercustomde" title="How Can I Get an exact mapping for a date?">How Can I Get an exact mapping for a date?</a>
        <a href="#virtuosotipsandtricksgetcertattr" title="How Can I Get certificate attributes using SPARQL?">How Can I Get certificate attributes using SPARQL?</a>
        <a href="#virtuosotipsandtricksmultithreadjdbc" title="How can I make Multi Thread Virtuoso connection using JDBC??">How can I make Multi Thread Virtuoso connection using JDBC??</a>
        <a href="#virtuosotipsandtricksgetcertattr" title="How Do I Perform Bulk Loading of RDF Source Files into one or more Graph IRIs?">How Do I Perform Bulk Loading of RDF Source Files into one or more Graph IRIs?</a>
        <a href="#virtuosotipsandtricksrdfschowlinfrl" title="How to exploit RDF Schema and OWL Inference Rules with minimal effort?">How to exploit RDF Schema and OWL Inference Rules with minimal effort?</a>
        <a href="#virtuosotipsandtricksdumparbqntr" title="How can I dump arbitrary query result as N-Triples?">How can I dump arbitrary query result as N-Triples?</a>
        <a href="#virtuosotipsandtrickbindnmgrprst" title="How do I bind named graph parameter in prepared statement?">How do I bind named graph parameter in prepared statement?</a>
        <a href="#virtuosotipsandtricksadonetinsb" title="How can I insert binary data to Virtuoso RDF storage in plain queries and with parameter binding via ADO.NET calls?">How can I insert binary data to Virtuoso RDF storage in plain queries and with parameter binding via ADO.NET calls?</a>
        <a href="#instrdfvs" title="How can I insert RDF data from Visual Studio to Virtuoso?">How can I insert RDF data from Visual Studio to Virtuoso?</a>
        <a href="#descrmd" title="How does default describe mode work?">How does default describe mode work?</a>
        <a href="#notresphttp" title="What should I do if the Virtuoso Server is not responding to HTTP requests?">What should I do if the Virtuoso Server is not responding to HTTP requests?</a>
        <a href="#cxmlurlptrn" title="What CXML params are supported for the SPARQL URL pattern?">What CXML params are supported for the SPARQL URL pattern?</a>
        <a href="#replallgr" title="How can I replicate all graphs?">How can I replicate all graphs?</a>
        <a href="#rndsalltr" title="What is best method to get a random sample of all triples for a subset of all the resources &#10;      &#9;of a SPARQL endpoint?">What is best method to get a random sample of all triples for a subset of all the resources 
      	of a SPARQL endpoint?</a>
        <a href="#replallgr" title="How can I replicate all graphs?">How can I replicate all graphs?</a>
        <a href="#sparqlmkmeshup" title="How can I use SPARQL to make Meshups?">How can I use SPARQL to make Meshups?</a>
        <a href="#clusternetmeter" title="How can I use the net_meter utility before starting the ingestion to a cluster?">How can I use the net_meter utility before starting the ingestion to a cluster?</a>
        <a href="#loadcmrdf" title="How can I use the LOAD command to import RDF data?">How can I use the LOAD command to import RDF data?</a>
        <a href="#degrprc" title="How can I delete graphs using stored procedure?">How can I delete graphs using stored procedure?</a>
        <a href="#sparulspongertut" title="How can I use SPARUL to add missing triples to a Named Graph?">How can I use SPARUL to add missing triples to a Named Graph?</a>
        <a href="#ifsparqlbi" title="How can I use the SPARQL IF operator for SPARQL-BI endpoint?">How can I use the SPARQL IF operator for SPARQL-BI endpoint?</a>
        <a href="#chpntset" title="How can I handle checkpoint condition?">How can I handle checkpoint condition?</a>
        <a href="#inccntnegt" title="How can I incorporate Content Negotiation into RDF bulk loaders?">How can I incorporate Content Negotiation into RDF bulk loaders?</a>
        <a href="#linkeddata3simplesteps" title="Virtuoso Linked Data Deployment In 3 Simple Steps?">Virtuoso Linked Data Deployment In 3 Simple Steps?</a>
        <a href="#difcrdrdelgr" title="What are the differences between create, drop, clear and delete Graph?">What are the differences between create, drop, clear and delete Graph?</a>
        <a href="#srchprd" title="How can I perform search for predicate values?">How can I perform search for predicate values?</a>
        <a href="#constrinserst" title="How can I use INSERT via CONSTRUCT Statements?">How can I use INSERT via CONSTRUCT Statements?</a>
        <a href="#cleargraphrelemtgr" title="How to clear graphs which are related to empty graphs?">How to clear graphs which are related to empty graphs?</a>
        <a href="#subqrbl" title="How can I use sub-queries to enable literal values based joins?">How can I use sub-queries to enable literal values based joins?</a>
        <a href="#sparqlpreforder" title="How can I execute query with labels preference order?">How can I execute query with labels preference order?</a>
        <a href="#getobjdtype" title="How can I get object datatype?">How can I get object datatype?</a>
        <a href="#howbackuprestoreind" title="How Can I Backup and Restore individual table(s) and individual index(s)?">How Can I Backup and Restore individual table(s) and individual index(s)?</a>
        <a href="#bifcontainsoptions" title="What bif:contains free-text options can I use?">What bif:contains free-text options can I use?</a>
        <a href="#sparqlendpointprotection" title="What SPARQL Endpoint Protection Methods can I use?">What SPARQL Endpoint Protection Methods can I use?</a>
        <a href="#sparqlassignrole" title="How do I assign SPARQL role to SQL user?">How do I assign SPARQL role to SQL user?</a>
    </div>
   </div>
    <br />
  </div>
  <div id="text">
          <a name="virtuosotipsandtricks" />
    <h2>1.5. Tips and Tricks</h2>
    
          <a name="virtuosotipsandtricksspchar" />
    <h3>1.5.1. How Can I execute SPARQL queries containing &#39;$&#39; character using ISQL?</h3>                
      <p>Assuming a SPARQL query should filter on the length of labels:</p>
<div>
      <pre class="programlisting">
SELECT ?label
FROM &lt;http://mygraph.com&gt;
WHERE 
  { 
    ?s ?p ?label
    FILTER(regex(str(?label), &quot;^.{1,256}$&quot;) )
  } 
</pre>
    </div>      
      <p>ISQL uses &#39;<strong>$</strong>&#39; character as a prefix for macro names of its preprocessor. 
      When &#39;<strong>$</strong>&#39; character is used in SPARQL query to be executed in ISQL, the character 
      should be replaced with &#39;<strong>$$</strong>&#39; notation or an escape char + numeric code:</p>
<div>
      <pre class="programlisting">
SQL&gt; SPARQL 
SELECT ?label
FROM &lt;http://mygraph.com&gt;
WHERE 
  { 
    ?s ?p ?label
    FILTER(REGEX(str(?label), &quot;^.{1,256}$$&quot;) )
  } 	
</pre>
    </div>      
      <p>Note also that the FILTER written in this way, finds <strong>?label-s</strong> with length 
      less than 256.</p>
      <p>To achieve fast results, <strong>REGEX</strong> should be replaced with the 
      <strong>bif:length</strong> function:</p>      
<div>
      <pre class="programlisting">
SQL&gt; SPARQL 
SELECT ?label
FROM &lt;http://mygraph.com&gt;
WHERE 
  { 
    ?s ?p ?label
    FILTER (bif:length(str(?label))&lt;= 256)
  } 	
</pre>
    </div>      
      <p>In this way the SPARQL query execution can work much faster if the interoperability is 
      	not required and <strong>?label-s</strong> are numerous.</p>
    <br />          
    
      <a name="virtuosotipsandtricksfinddeadlockstables" />
    <h3>1.5.2. How can I find on which table deadlocks occur?</h3>
      <p>One possible way to find on which table deadlocks occur is to execute the following statement:</p>    
<div>
      <pre class="programlisting">
SELECT TOP 10 * 
FROM SYS_L_STAT 
ORDER BY deadlocks DESC	
</pre>
    </div>      
    <br />       
    
      <a name="virtuosotipsandtricksoutotmemoryerror" />
    <h3>1.5.3. How Can I configure parameters to avoid out of memory error?</h3>
      <p>In order to avoid out of memory error, you should make sure the values for the paramaters 
      	<strong>NumberOfBuffers</strong> and <strong>MaxCheckpointRemap</strong> are not set with the same values.</p>    
      <p>For example, the following configuration will cause an error out of memory:</p>	
<div>
      <pre class="programlisting">
# virtuoso.ini

...
[Parameters]
NumberOfBuffers = 246837
MaxDirtyBuffers = 18517
MaxCheckpointRemap = 246837
...
</pre>
    </div>      
       <p>Changing the value of the parameter <strong>MaxCheckpointRemap</strong> with let&#39;s 
       say 1/4 of the DB size will resolve the issue.</p>
    <br />                  
    
      <a name="virtuosotipsandtricksrdftriggersoptions" />
    <h3>1.5.4. What are &quot;Generate RDB2RDF triggers&quot; and &quot;Enable Data Syncs with Physical Quad Store&quot; RDF Views options?</h3>
      <p>These RDF Views options basically persist the triples in the transient View Graph in the Native Quad Store. The Data Sync is how you keep the transient views in sync with the persisted triples.</p>	      
      <p>Without this capability you cannot exploit faceted browsing without severe performance overhead when using Linked Data based conceptual views over ODBC or JDBC accessible data sources.</p>	
      <p>Note: Using these options when the RFViews have already been created is not currently possible via the Conductor UI. Instead you should be able to add them manually from isql:</p>	            
<ol>
      <li>Drop the RDF View graph and Quad Map.</li>
      <li>Create it again with the RDB2RDF Triggers options enabled.</li>
    </ol>  
     <div class="tip">
      <div class="tiptitle">See Also:</div>
       <p>
        <a href="rdfperformancetuning.html#rdb2rdftriggers">RDB2RDF Triggers</a>
      </p>
     </div>    
    <br />  
    
      <a name="virtuosotipsandtricksmanagedaterangequery" />
    <h3>1.5.5. How to Manage Date Range SPARQL queries?</h3>
      <p>The following examples demonstrate how to manage date range in a SPARQL query:</p>	
      <p>
      <strong>Example with date range</strong>
    </p> 
<div>
      <pre class="programlisting">
SELECT ?s ?date 
FROM &lt;http://dbpedia.org&gt; 
WHERE 
  { 
    ?s ?p ?date . FILTER ( ?date &gt;= &quot;19450101&quot;^^xsd:date &amp;&amp; ?date &lt;= &quot;19451231&quot;^^xsd:date )  
  } 
LIMIT 100
</pre>
    </div>      
      <p>
      <strong>Example with bif:contains</strong>
    </p> 
      <p>Suppose there is the following query using bif:contains for date:</p>
      <p>If ?date is of type xsd:date or xsd:dateTime and of valid syntax then 
      	bif:contains(?date, &#39;&quot;1945*&quot;&#39; ) will not found it, because it will be parsed at load/create and 
      	stored as SQL DATE value.
      </p>	
      <p>So if data are all accurate and typed properly then the filter is:</p>
<div>
      <pre class="programlisting">
(?date &gt;= xsd:date(&quot;1945-01-01&quot;) &amp;&amp; ?date &lt; xsd:date(&quot;1946-01-01&quot;))	
</pre>
    </div>      
      <p>i.e. the query should be:</p>
<div>
      <pre class="programlisting">
SELECT DISTINCT ?s ?date
FROM &lt;http://dbpedia.org&gt;
WHERE
  {
    ?s ?p ?date . FILTER( ?date &gt;= xsd:date(&quot;1945-01-01&quot;) &amp;&amp; ?date &lt; xsd:date(&quot;1946-01-01&quot;)  &amp;&amp; (str(?p) != str(rdfs:label)) )
  }
LIMIT 10	
</pre>
    </div>      
      <p>If data falls, then the free-text will be OK for tiny examples but not for &quot;big&quot; cases because 
      	<strong>bif:contains(?date, &#39;&quot;1945*&quot;&#39;)</strong> would require that less than 200 words in the 
      	table begins with 1945. Still, some data can be of accurate type and syntax so range comparison 
      	should be used for them and results aggregated via UNION.</p>
      <p>If dates mention timezones then the application can chose the beginning and the end of the 
      	year in some timezones other than the default.</p>	
    <br />  
    
      <a name="virtuosotipsandtricksquadstorageinternally" />
    <h3>1.5.6. How can I see which quad storages exist and in which quad storage a graph resides?</h3>
      <p>Let&#39;s take for example a <a href="http://virtuoso.openlinksw.com/whitepapers/relational%20rdf%20views%20mapping.html">created RDF view from relational data in Virtuoso</a>. The RDF output therefor should have two graphs which reside in a quad storage named for ex.:
      </p>	
<div>
      <pre class="programlisting">
http://localhost:8890/rdfv_demo/quad_storage/default	
</pre>
    </div>      
      <p>Also the RDF is accessible over the SPARQL endpoint with the following query:
      </p>	
<div>
      <pre class="programlisting">
define input:storage &lt;http://localhost:8890/rdfv_demo/quad_storage/default&gt;
SELECT * 
WHERE 
  { 
    ?s ?p ?o 
  }	
</pre>
    </div>      
      <p>Now one could ask is there a way to define internally (once) that the quad storage should be 
      	included in queries to the SPARQL endpoint? So that the user does not have to define the 
      	<strong>input:storage</strong> explicitly in each query, like this:</p>	
<div>
      <pre class="programlisting">
http://localhost:8890/sparql?query=select * where { ?s ?p ?o }&amp;default-graph-uri=NULL&amp;named-graph-uri=NULL	
</pre>
    </div>      
      <p>All metadata about all RDF storages are kept in &quot;system&quot; graph 
      	&lt;http://www.openlinksw.com/schemas/virtrdf#&gt; ( namespace prefix <strong>virtrdf:</strong> ). 
      	Subjects of type <strong>virtrdf:QuadStorage</strong> are RDF storages. There are three of them by default:
      </p>	
<div>
      <pre class="programlisting">
SQL&gt; SPARQL SELECT * FROM virtrdf: WHERE { ?s a virtrdf:QuadStorage };
s
VARCHAR
_______________________________________________________________________________

http://www.openlinksw.com/schemas/virtrdf#DefaultQuadStorage
http://www.openlinksw.com/schemas/virtrdf#DefaultServiceStorage
http://www.openlinksw.com/schemas/virtrdf#SyncToQuads

3 Rows. -- 3 msec.	
</pre>
    </div>
      <ul>
        <li>
        <strong>virtrdf:DefaultQuadStorage</strong> is what&#39;s in use if no input:storage specified.</li>
        <li>
        <strong>virtrdf:DefaultServiceStorage</strong> will be used for SPARQL federation.</li>
        <li>
        <strong>virtrdf:SyncToQuads</strong> is to keep the list of Linked Data Views that are translated into RDB2RDF triggers.</li>        
      </ul>      
      <p>There are two ways of using the RDF View from above in SPARQL endpoint without 
      	<strong>define input:storage</strong>:</p>	
      <ol>
      <li>Create RDF View right in <strong>virtrdf:DefaultQuadStorage</strong> or add the 
        view in other storage and then copy it from there to <strong>virtrdf:DefaultQuadStorage</strong>.
          <ul>
            <li>In any of these two variants, use: 
<div>
              <pre class="programlisting">
SPARQL ALTER QUAD STORAGE virtrdf:DefaultQuadStorage . . .	
</pre>
            </div>                  	
            </li>
          </ul>        	
        </li>
      <li>Use <strong>SYS_SPARQL_HOST</strong> table as described 
        <a href="rdfsparql.html#rdfdefaultgraph">here</a> and set <strong>SH_DEFINES</strong> so it 
        contains your favorite <strong>define input:storage</strong>.</li>
    </ol>      	
    <br />      
    
      <a name="virtuosotipsandtricksdroprecrdefstrg" />
    <h3>1.5.7. Can I drop and re-create the DefaultQuadStorage?</h3>                    
      <p>Currently system metadata consist of three &quot;levels&quot;:</p>
      <ol>
      <li>
        <strong>QuadMapFormats</strong> are used to describe transformations of individual 
        SQL values (or types of SQL values),</li>
      <li>
        <strong>QuadMaps</strong> refers to <strong>QuadMapFormats</strong> (via 
        <strong>QuadMapValues</strong>) and describe some &quot;minimal&quot; independent RDB2RDF 
        transformations,</li>
      <li>
        <strong>QuadStorages</strong> organizes <strong>QuadMaps</strong>.</li>
    </ol>      
      <p>
      <strong>QuadStorages</strong> contains only &quot;symlinks&quot; to maps, if you drop a storage 
      you don&#39;t drop all mappings inside. If you drop the <strong>DefaultQuadStorage</strong> or 
      some other built-in thing, it can be safely recovered by 
      <a href="fn_rdf_audit_metadata.html">DB.DBA.RDF_AUDIT_METADATA</a>, 
      with first parameter set to 1. This will keep your own data intact. However we recommend to write 
      a script that declares all your formats, Linked Data Views and storages, to be able to reproduce the 
      configuration after any failures.</p>
    <br />    
    
      <a name="virtuosotipsandtricksgraphsecurity" />
    <h3>1.5.8. How to display only some information from RDF graph?</h3>                    
      <p>Virtuoso supports graph-level security, as described <a href="rdfgraphsecurity.html">here</a> 
      but not subject-level or predicate-level. When exposing data that needs protected access, triples 
      should be confined to private  name graphs which are protected by ACLs using WebID.</p>
      <p>Note, how you can use <a href="http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtAuthPolicyFOAFSSL">WebID to protect Virtuoso SPARQL endpoints</a>.</p>  
      <div class="tip">
      <div class="tiptitle">See Also:</div>
        <p>
        <a href="rdfgraphsecurity.html">RDF Graphs Security</a>
      </p>
      </div>
    <br />   
    
      <a name="virtuosotipsandtrickssparqlcondport" />
    <h3>1.5.9. Is it possible to have the SPARQL endpoint on a different port than the Conductor?</h3>                    
      <p>Virtuoso Web Server has the capability to create extra listeners using the <a href="htmlconductorbar.html#admui.internetdomains">Conductor interface</a>.</p>
      <ol>
      <li>At install time you have your HTTP Server port in your virtuoso.ini set to 8890, which 
        	you want to keep in your local network as this contains ALL the endpoints that you have 
        	registered in Virtuoso. So as long as you do not open this port in your firewall, you can 
        	only get at it from the local machine.</li>
      <li>Next you should create a new vhost entry using the EXTERNAL name of your machine and 
        	use port 80 (or a higher port if you do not want to run as root) for ex.:
<div>
          <pre class="programlisting">
Interface: 0.0.0.0
Port: 8080
Http Host:  my.example.com	
</pre>
        </div>        	
        </li>
      <li>Next you add a &quot;New directory to this line&quot;, click on &quot;Type&quot; radio button and choose 
        	&quot;Sparql access point&quot; from the drop-down list and press Next button. Set &quot;Path&quot; to /sparql 
        	and press the &quot;Save Changes&quot; button to store.</li>
      <li>At this point you have created: http://my.example.com:8080/sparql which functions 
        	exactly the same as your internal http://localhost:8890/sparql. You can now open your firewall 
        	and allow outside machines to connect to port 8080 so people can use your SPARQL endpoint 
        	without access to any other endpoint on your Virtuoso installation.</li>
      <li>You should probably also change your virtuoso.ini so:
<div>
          <pre class="programlisting">
[URIQA]
DefaultHost = my.example.com:8080	
</pre>
        </div>        	
        </li>
      <li>If you use port 80, you do not have to add :80 at the end of this setting, although 
        	it should not make any difference.</li>
      <li>You can now add other directories / endpoints to the new <strong>my.example.com</strong> 
          interface you just created e.g. a nice / directory that points to a index.html which describes 
          your site etc.</li>
    </ol>
      <div class="tip">
      <div class="tiptitle">See Also:</div>
        <p>
        <a href="htmlconductorbar.html#admui.internetdomains">Internet Domains</a>
      </p>
      </div>
    <br />  
    
      <a name="virtuosotipsandtricksenableadonetvs2010" />
    <h3>1.5.10. How to enable the Virtuoso Entity Framework 3.5 ADO.Net Provider in Visual Studio 2010?</h3>                    
      <p>The Virtuoso Entity Framework 3.5 ADO.Net Provider is current only list as a Visible control 
      	in the Visual Studio 2008 IDE as the current installers only create the necessary registry 
      	entries for Visual Studio 2008. To make it visible in the Visual Studio 2010&#39;s IDE the 
      	following registry settings need to be manually updated and manual addtions to some of 
      	the VS 2010 XML configuration files:</p>
      <ol>
      <li>Export following registry keys to .reg files and using a text editor, such as Wordpad, edit the Visual Studio version numbers from 8.0 or 9.0 to 10.0:
<div>
          <pre class="programlisting">
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\DataProviders\{EE00F82B-C5A4-4073-8FF1-33F815C9801D}
- and -
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\DataSources\{90FBCAF2-8F42-47CD-BF1A-88FF41173060}
</pre>
        </div>        	
        </li>
      <li>Once edited, save and double click them to create the new registry entries under:
<div>
          <pre class="programlisting">
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0....	
</pre>
        </div>        	
        </li>
      <li>In addition, locate the file C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config, 
        locate the node, then locate the <strong>&lt;add name=&quot;VirtuosoClient3? Data Provider&quot; ...</strong> 
        node within it: 
<div>
          <pre class="programlisting">
&lt;add name=&quot;VirtuosoClient3 Data Provider&quot; invariant=&quot;OpenLink.Data.Virtuoso&quot;
    description=&quot;.NET Framework Data Provider for Virtuoso&quot; type=&quot;OpenLink.Data.Virtuoso.VirtuosoClientFactory, virtado3, Version=6.2.3128.2, Culture=neutral, PublicKeyToken=391bf132017ae989&quot; /&gt;	
</pre>
        </div>        	
        </li>
    </ol>
      <p>and copy is to the equivalent C:\WINDOWS\Microsoft.NET\Frameworks\v4.0.30128\CONFIG\machine.config location.</p>
      <p>Visual Studio 2010 will then have the necessary information to locate and load the Virtuoso ADO.Net provider in its IDE.</p>
      <p>The registry should typically contain the following entries for Visual Studio 2010 as a result:</p>
<div>
      <pre class="programlisting">
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}]
@=&quot;.NET Framework Data Provider for Virtuoso&quot;
&quot;AssociatedSource&quot;=&quot;{4D90D7C5-69A6-43EE-83ED-59A0E442D260}&quot;
&quot;CodeBase&quot;=&quot;C:\\Windows\\assembly\\GAC_MSIL\\virtado3\\6.2.3128.1__391bf132017ae989\\virtado3.dll&quot;
&quot;Description&quot;=&quot;Provider_Description, OpenLink.Data.Virtuoso.DDEX.Net3.DDEXResources, virtado3, Version=6.2.3128.1, Culture=neutral, PublicKeyToken=391bf132017ae989&quot;
&quot;DisplayName&quot;=&quot;Provider_DisplayName, OpenLink.Data.Virtuoso.DDEX.Net3.DDEXResources, virtado3, Version=6.2.3128.1, Culture=neutral, PublicKeyToken=391bf132017ae989&quot;
&quot;InvariantName&quot;=&quot;OpenLink.Data.Virtuoso&quot;
&quot;PlatformVersion&quot;=&quot;2.0&quot;
&quot;ShortDisplayName&quot;=&quot;Provider_ShortDisplayName, OpenLink.Data.Virtuoso.DDEX.Net3.DDEXResources, virtado3, Version=6.2.3128.1, Culture=neutral, PublicKeyToken=391bf132017ae989&quot;
&quot;Technology&quot;=&quot;{77AB9A9D-78B9-4ba7-91AC-873F5338F1D2}&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}\SupportedObjects]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}\SupportedObjects\IDSRefBuilder]
@=&quot;Microsoft.VisualStudio.Data.Framework.DSRefBuilder&quot;
&quot;Assembly&quot;=&quot;Microsoft.VisualStudio.Data.Framework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}\SupportedObjects\IVsDataAsyncCommand]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}\SupportedObjects\IVsDataCommand]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}\SupportedObjects\IVsDataConnectionProperties]
@=&quot;OpenLink.Data.Virtuoso.DDEX.Net3.VirtuosoDataConnectionProperties&quot;
&quot;Assembly&quot;=&quot;virtado3, Version=6.2.3128.1, Culture=neutral, PublicKeyToken=391bf132017ae989&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}\SupportedObjects\IVsDataConnectionSupport]
@=&quot;Microsoft.VisualStudio.Data.Framework.AdoDotNet.AdoDotNetConnectionSupport&quot;
&quot;Assembly&quot;=&quot;Microsoft.VisualStudio.Data.Framework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}\SupportedObjects\IVsDataConnectionUIControl]
@=&quot;OpenLink.Data.Virtuoso.DDEX.Net3.VirtuosoDataConnectionUIControl&quot;
&quot;Assembly&quot;=&quot;virtado3, Version=6.2.3128.1, Culture=neutral, PublicKeyToken=391bf132017ae989&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}\SupportedObjects\IVsDataConnectionUIProperties]
@=&quot;OpenLink.Data.Virtuoso.DDEX.Net3.VirtuosoDataConnectionProperties&quot;
&quot;Assembly&quot;=&quot;virtado3, Version=6.2.3128.1, Culture=neutral, PublicKeyToken=391bf132017ae989&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}\SupportedObjects\IVsDataMappedObjectConverter]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}\SupportedObjects\IVsDataObjectIdentifierResolver]
@=&quot;OpenLink.Data.Virtuoso.DDEX.Net3.VirtuosoDataObjectIdentifierResolver&quot;
&quot;Assembly&quot;=&quot;virtado3, Version=6.2.3128.1, Culture=neutral, PublicKeyToken=391bf132017ae989&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}\SupportedObjects\IVsDataObjectSupport]
@=&quot;Microsoft.VisualStudio.Data.Framework.DataObjectSupport&quot;
&quot;Assembly&quot;=&quot;Microsoft.VisualStudio.Data.Framework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot;
&quot;XmlResource&quot;=&quot;OpenLink.Data.Virtuoso.DDEX.Net3.VirtuosoObjectSupport&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}\SupportedObjects\IVsDataSourceInformation]
@=&quot;OpenLink.Data.Virtuoso.DDEX.Net3.VirtuosoDataSourceInformation&quot;
&quot;Assembly&quot;=&quot;virtado3, Version=6.2.3128.1, Culture=neutral, PublicKeyToken=391bf132017ae989&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}\SupportedObjects\IVsDataTransaction]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}\SupportedObjects\IVsDataViewSupport]
@=&quot;Microsoft.VisualStudio.Data.Framework.DataViewSupport&quot;
&quot;Assembly&quot;=&quot;Microsoft.VisualStudio.Data.Framework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a&quot;
&quot;XmlResource&quot;=&quot;OpenLink.Data.Virtuoso.DDEX.Net3.VirtuosoViewSupport&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataSources\{4D90D7C5-69A6-43EE-83ED-59A0E442D260}]
@=&quot;OpenLink Virtuoso Data Source&quot;
&quot;DefaultProvider&quot;=&quot;{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}&quot;

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataSources\{4D90D7C5-69A6-43EE-83ED-59A0E442D260}\SupportingProviders]

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\DataSources\{4D90D7C5-69A6-43EE-83ED-59A0E442D260}\SupportingProviders\{0886A2BB-03D0-4E00-8A3D-F235A5DC0F6D}]
&quot;Description&quot;=&quot;DataSource_Description, OpenLink.Data.Virtuoso.DDEX.Net3.DDEXResources, virtado3, Version=6.2.3128.1, Culture=neutral, PublicKeyToken=391bf132017ae989&quot; 	
</pre>
    </div>      
      <p>The next Virtuoso releases, 6.3+ will support this new Visual Studio 2010 release out of the box.</p>                  
    <br /> 
    
      <a name="virtuosotipsandtrickscontrolunicode3" />
    <h3>1.5.11. How Can I Control the normalization of UNICODE3 accented chars in free-text index?</h3>                    
<p>
The normalization of UNICODE3 accented chars in free-text index can be controlled by setting up the 
configuration parameter <strong>XAnyNormalization</strong> in the
virtuoso.ini config file, section [I18N]. This parameter controls whether accented
UNICODE characters should be converted to their non-accented base
variants at the very beginning of free-text indexing or parsing a
free-text query string. The parameter&#39;s value is an integer that is bitmask with
only 2 bits in use atm:
</p>
<ol>
      <li>0: the default behavior, do not normalize anything, so &quot;Jose&quot; and
&quot;José&quot; are two distinct words.
</li>
      <li>2: Any combined char is converted to its (smallest known) base. So
&quot;é&quot; will lose its accent and become plain old ASCII &quot;e&quot;.</li>
      <li>3: This is equl to 1|2 and when set then performs both conversions. 
As a result, pair of base char and combinig char loses its second char and chars with accents will lose
accents.</li>
    </ol>
     <p>If the parameter is required at all, the needed value is probably 3. So
the fragment of virtuoso.ini is:</p>
<div>
      <pre class="programlisting">
[I18N]
XAnyNormalization=3
</pre>
    </div>
     <p>In some seldom case the value of 1 can be appropriate. The parameter
should be set once before creating the database. If changed on the
existing database, all free-text indexes that may contain non-ASCII data
should be re-created. On a typical system, the parameter affects all
text columns, XML columns, RDF literals and queries.</p>
<p>Strictly speaking, it affects not all of them but only items that use
default &quot;x-any&quot; language or language derived from x-any such as &quot;en&quot; and
&quot;en-US&quot; but if you haven&#39;t tried writing new C plugins for custom
languages you should not look so deep.</p>
     <p>As an example, with <strong>XAnyNormalization=3</strong> once can get the following:</p>
<div>
      <pre class="programlisting">
SQL&gt;SPARQL 

INSERT IN &lt;http://InternationalNSMs/&gt;
   { &lt;s&gt; &lt;sp&gt; &quot;Índio João Macapá Júnior Tôrres Luís Araújo José&quot; ; 
     &lt;ru&gt; &quot;Он добавил картошки, посолил и поставил аквариум на огонь&quot; . }

INSERT INTO &lt;http://InternationalNSMs/&gt;, 2 (or less) triples -- done


SQL&gt; DB.DBA.RDF_OBJ_FT_RULE_ADD (null, null, &#39;InternationalNSMs.wb&#39;);

Done. -- 0 msec.

SQL&gt;vt_inc_index_db_dba_rdf_obj();

Done. -- 26 msec.

SQL&gt;SPARQL 
SELECT * 
FROM &lt;http://InternationalNSMs/&gt; 
WHERE 
  {
    ?s ?p ?o 
  }
ORDER BY ASC (str(?o))

s  sp  Índio João Macapá Júnior Tôrres Luís Araújo José
s  ru  Он добавил картошки, посолил и поставил аквариум на огонь

2 Rows. -- 2 msec.

SQL&gt; SPARQL 
SELECT * 
FROM &lt;http://InternationalNSMs/&gt; 
WHERE 
  { 
    ?s ?p ?o . ?o bif:contains &quot;&#39;Índio João Macapá Júnior Tôrres Luís Araújo José&#39;&quot; . 
  }

s  sp  Índio João Macapá Júnior Tôrres Luís Araújo José

1 Rows. -- 2 msec.

SQL&gt;SPARQL 
SELECT * 
FROM &lt;http://InternationalNSMs/&gt; 
WHERE
  { 
    ?s ?p ?o . ?o bif:contains &quot;&#39;Indio Joao Macapa Junior Torres Luis Araujo Jose&#39;&quot; . }

s  sp  Índio João Macapá Júnior Tôrres Luís Araújo José

1 Rows. -- 1 msec.

SQL&gt; SPARQL 
SELECT * 
FROM &lt;http://InternationalNSMs/&gt; 
WHERE 
  { 
    ?s ?p ?o . ?o bif:contains &quot;&#39;поставил аквариум на огонь&#39;&quot; . }

s  ru  Он добавил картошки, посолил и поставил аквариум на огонь

</pre>
    </div>
     <p>There was also request for function that normalizes characters in
strings as free-text engine will do with XAnyNormalization=3 , the function will be provided as a separate patch and depends on this
specific patch.
    </p>
    <div class="tip">
      <div class="tiptitle">See Also:</div>
       <p>
        <a href="databaseadmsrv.html#VIRTINI">Virtuoso Configuration File</a>
      </p>
    </div>
    <br />               
    
      <a name="virtuosotipsandtricksdefinegraphwithspongeroption" />
    <h3>1.5.12. How Can I define graph with virt:rdf_sponger option set to &quot;on&quot;?</h3>                    
      <p>Suppose we have the following scenario:</p>
      <ol>
      <li>Create Virtuoso user using Conductor.</li>
      <li>Create for the user a RDF Sink folder.</li>
      <li>In the properties of the RDF sink folder add the following 
          <strong>virt:rdf_graph</strong> option: 
<div>
          <pre class="programlisting">
http://localhost:8080/DAV/home/dba/rdf_sink/	
</pre>
        </div>
        </li>
      <li>Set <strong>virt:rdf_sponger</strong> to &quot;on&quot;.</li>
      <li>Upload RDF files to the RDF Sink folder.</li>
      <li>As result the RDF data should be stored in graph 
        	for ex. (depending on your folder name etc.): 
<div>
          <pre class="programlisting">
http://local.virt/DAV/home/wa_sink/rdf_sink/wa_address_agents.rdf	
</pre>
        </div>
        </li>
      <li>In order to define any graph you want with the option from above, you should execute:
<div>
          <pre class="programlisting">
SQL&gt;DAV_PROP_SET (davLocation,  &#39;virt:rdf_graph&#39;, iri, _uid, _pwd);	
</pre>
        </div>
          <ul>
            <li>Calling this function uses the given IRI as the graph IRI when sponging stuff 
            	put in the rdf_sink/ collection davLocation.</li>
          </ul>            
        </li>
      <li>Finally you should execute the following command to get the RDF data from the new graph:
<div>
          <pre class="programlisting">
SQL&gt;SELECT DAV_PPROP_GET (&#39;/DAV/home/dba/rdf_sink/&#39;, &#39;virt:rdf_graph&#39;,&#39;dba&#39;, &#39;dba&#39;);	
</pre>
        </div>
        </li>
    </ol>
    <br />                     
    
      <a name="virtuosotipsandtricksconvprstr" />
    <h3>1.5.13. How do I use SPARUL to change a selection of property values from URI References to Literals?</h3>                    
      <p>Assume a given graph where triples are comprised of property values that are mixed across URI References and Typed Literals as exemplified by the results of the query below:</p>
<div>
      <pre class="programlisting">
SELECT DISTINCT ?sa ?oa 
FROM &lt;http://ucb.com/nbeabase&gt;
WHERE 
  { 
    ?sa a &lt;http://ucb.com/nbeabase/resource/Batch&gt; .
    ?sa &lt;http://ucb.com/nbeabase/resource/chemAbsNo&gt; ?oa . FILTER regex(?oa, &#39;-&#39;,&#39;i&#39;)
  }

</pre>
    </div>
      <p>You can use the following SPARUL pattern to harmonize the property values across relevant triples in a specific graph, as shown below:</p>
<div>
      <pre class="programlisting">
SQL&gt; SPARQL 
INSERT INTO GRAPH &lt;http://ucb.com/nbeabase&gt; 
  { 
    ?sa &lt;http://ucb.com/nbeabase/resource/sampleId&gt; `str (?oa)` 
  }  
WHERE 
  { 
    ?sa &lt;http://ucb.com/nbeabase/resource/chemAbsNo&gt; ?oa . FILTER regex(?oa, &#39;-&#39;,&#39;i&#39;)   
  }	
</pre>
    </div>      
    <br />   
    
      <a name="virtuosotipsandtricksbulkloadcl" />
    <h3>1.5.14. How is a Checkpoint performed against a Virtuoso Clustered Server?</h3>                    
      <p>The cluster <a href="">cl_exec()</a> function is 
      used to perform a checkpoint across all node of a Virtuoso cluster as follows:</p>
<div>
      <pre class="programlisting">
SQL&gt;cl_exec (&#39;checkpoint&#39;); 	
</pre>
    </div>      
      <p>This typically needs to be run after loading RDF datasets into a Virtuoso cluster to prevent lose of data when the cluster is restarted.</p>

    <br />   
    
      <a name="virtuosotipsandtrickconstrprst" />
    <h3>1.5.15. How can I use CONSTRUCT with PreparedStatements?</h3>                           
      <p>Assume a given query which uses pragma <strong>output:format &#39;_JAVA_&#39;</strong> with CONSTRUCT:</p>
<div>
      <pre class="programlisting">
SPARQL DEFINE output:format &#39;_JAVA_&#39;
   CONSTRUCT { ?s ?p ?o }
WHERE
  { 
    ?s ?p ?o . 
    FILTER (?s = iri(?::0)) 
  }
LIMIT 1
</pre>
    </div>      
      <p>In order to work correctly, the query should be modified to:</p>
<div>
      <pre class="programlisting">
SPARQL DEFINE output:format &#39;_JAVA_&#39;
   CONSTRUCT { `iri(?::0)` ?p ?o }
WHERE
  { 
    `iri(?::0)` ?p ?o 
  }
LIMIT 1	
</pre>
    </div>      
      <p>Equivalent variant of the query is also:</p>
<div>
      <pre class="programlisting">
SPARQL DEFINE output:format &#39;_JAVA_&#39;
  CONSTRUCT { ?s ?p ?o }
WHERE
  { 
    ?s ?p ?o . 
    FILTER (?s = iri(?::0)) 
  }
LIMIT 1	
</pre>
    </div>      
    <br />       
    
      <a name="virtuosotipsandtrickssparulupdatestrl" />
    <h3>1.5.16. How can perform SPARQL Updates without transactional log size getting exceed?</h3>             
      <p>Since SPARUL updates are generally not meant to be transactional, it is best to run these in:</p>
<div>
      <pre class="programlisting">
SQL&gt; log_enable (2);	
</pre>
    </div>      
      <p>mode, which commits every operation as it is done. This prevents one from running out of 
      	rollback space. Also for bulk updates, transaction logging can be turned off. If so, one 
      	should do a manual checkpoint after the operation to ensure persistence across server restart 
      	since there is no roll forward log.</p>
      <p>Alternatively, the &quot;<strong>TransactionAfterImageLimit</strong>&quot; parameter can be set 
      in the virtuoso.ini config file to a higher value than its 50MB default:</p>
<div>
      <pre class="programlisting">
#virtuoso.ini
...
[Parameters]
...
TransactionAfterImageLimit = N bytes default 50000000
...	
</pre>
    </div>      
    <div class="tip">
      <div class="tiptitle">See Also:</div>
       <p>
        <a href="rdfperformancetuning.html#rdfperfsparul">Using SPARUL</a>
      </p>
       <p>
        <a href="sect5_ini_Parameters.html">Virtuoso INI Parameters</a>
      </p>       
    </div>
    <br />         
    
      <a name="virtuosotipsandtrickscrawlercustompl" />
    <h3>1.5.17. How can I write custom crawler using PL?</h3>
      <p>The following code is an example of loading data via crawler with special function to generate link for downloading:</p>
<div>
      <pre class="programlisting">
create procedure EUROPEANA_STORE ( 
  in _host varchar, 
  in _url varchar, 
  in _root varchar, 
  inout _content varchar, 
  in _s_etag varchar, 
  in _c_type varchar, 
  in store_flag int := 1, 
  in udata any := null, 
  in lev int := 0)
{
   declare url varchar;
   declare xt, xp any;
   declare old_mode int;
   xt := xtree_doc (_content, 2);
   xp := xpath_eval (&#39;//table//tr/td/a[@href]/text()&#39;, xt, 0);
   commit work;
   old_mode := log_enable (3,1);
   foreach (any u in xp) do
     {
       u := cast (u as varchar);
       url := sprintf (&#39;http://semanticweb.cs.vu.nl/europeana/api/export_graph?graph=%U&amp;mimetype=default&amp;format=turtle&#39;, u);
       dbg_printf (&#39;%s&#39;, u);
	 {
	   declare continue handler for sqlstate &#39;*&#39; { 
	     dbg_printf (&#39;ERROR: %s&#39;, __SQL_MESSAGE);
	   };
	   SPARQL LOAD ?:url into GRAPH ?:u;
	 }
     }
   log_enable (old_mode, 1);
   return WS.WS.LOCAL_STORE (_host, _url, _root, _content, _s_etag, _c_type, store_flag, 0);
}	
</pre>
    </div>      
    <div class="tip">
      <div class="tiptitle">See Also:</div>
       <p>
        <a href="htmlconductorbar.html#contentcrawlerrdf">Set Up the Content Crawler to Gather RDF</a>
      </p>
    </div>
    <br />  
    
      <a name="virtuosotipsandtrickscrawlercustomde" />
    <h3>1.5.18. How Can I Get an exact mapping for a date?</h3> 
      <p>Assume a given attempts to get an exact mapping for the literal &quot;1950&quot; using 
      	<strong>bif:contains</strong>:</p>
<div>
      <pre class="programlisting">
SPARQL
SELECT DISTINCT ?s ?o 
FROM &lt;http://dbpedia.org&gt; 
WHERE 
  {
    ?s ?p ?o . 
   FILTER( bif:contains (?o, &#39;&quot;1950&quot;&#39;) 
           &amp;&amp; isLiteral(?o) 
           &amp;&amp; ( str(?p) ! = rdfs:label  || str(?p) !=  foaf:name 
           &amp;&amp; ( ?o=&#39;1950&#39;)
         )
  }	
</pre>
    </div>      
      <p>As an integer 1950 or date 1950-01-01 are not texts, they are not in free-text index 
      	and thus invisible for CONTAINS free-text predicate.</p>
      <p>A possible way to make them visible that way is to introduce an additional RDF predicate 
      	that will contain objects of the triples in question, converted to strings via str() function.</p>
      <p>Thus better results will be approached: if searches about dates are frequent then a new 
      	predicate can have date/datetime values extracted from texts, eliminating the need for bif:contains.</p>
      <p>Therefor, the query from above should be changed to:</p>
<div>
      <pre class="programlisting">
SPARQL
SELECT DISTINCT ?s ?o 
FROM &lt;http://dbpedia.org&gt; 
WHERE 
  {
    ?s ?p ?o . 
    FILTER (  isLiteral(?o) 
              &amp;&amp; (  str(?p) != str(rdfs:label) || str(?p) !=  foaf:name ) 
              &amp;&amp; str(?o) in (&quot;1950&quot;, &quot;1950-01-01&quot;))
  }
</pre>
    </div>                                       
    <br />        	            	
    
      <a name="virtuosotipsandtricksgetcertattr" />
    <h3>1.5.19. How Can I Get certificate attributes using SPARQL?</h3>     
      <p>The SPARQL query should use the <strong>cert:hex</strong> and 
      <strong>cert:decimal</strong> in order to get to the values, so for ex:</p>
<div>
      <pre class="programlisting">
PREFIX cert: &lt;http://www.w3.org/ns/auth/cert#&gt; 
PREFIX rsa: &lt;http://www.w3.org/ns/auth/rsa#&gt; 

SELECT ?webid 
FROM &lt;http://webid.myxwiki.org/xwiki/bin/view/XWiki/homepw4&gt;
WHERE 
  {
    [] cert:identity ?webid ;
             rsa:modulus ?m ;
     rsa:public_exponent ?e .
     ?m cert:hex &quot;b520f38479f5803a7ab33233155eeef8ad4e1f575b603f7780f3f60ceab1\n34618fbe117539109c015c5f959b497e67c1a3b2c96e5f098bb0bf2a6597\n779d26f55fe8d320de7af0562fd2cd067dbc9d775b22fc06e63422717d00\na6801dedafd7b54a93c3f4e59538475673972e524f4ec2a3667d0e1ac856\nd532e32bf30cef8c1adc41718920568fbe9f793daeeaeeaa7e8367b7228a\n895a6cf94545a6f6286693277a1bc7750425ce6c35d570e89453117b88ce\n24206afd216a705ad08b7c59\n&quot;^^xsd:string .
     ?e cert:decimal &quot;65537&quot;^^xsd:string
  }	
</pre>
    </div>      
    <br />  
    
      <a name="virtuosotipsandtricksmultithreadjdbc" />
    <h3>1.5.20. How can I make Multi Thread Virtuoso connection using JDBC??</h3>     
      <p>See details <a href="sect5_JDBCDriverhibernatesetupandtestingexmp4.html">here</a>.</p> 
    <br />            
    
      <a name="virtuosotipsandtricksgetcertattr" />
    <h3>1.5.21. How Do I Perform Bulk Loading of RDF Source Files into one or more Graph IRIs?</h3>     
      <p>See details <a href="http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtBulkRDFLoader">here</a>.</p>       
    <br />      
    
      <a name="virtuosotipsandtricksrdfschowlinfrl" />
    <h3>1.5.22. How to exploit RDF Schema and OWL Inference Rules with minimal effort?</h3>     
      <p>When you install Virtuoso, it&#39;s reasoner and highly scalable inference capabilities may not 
      	be obvious. Typical cases involve using <strong>rdfs:subClassOf</strong> predicates in queries 
      	and wondering why reasoning hasn&#39;t occurred in line with the semantics defined in RDF Schema.</p>
      <p>The experience applies when using more sophisticated predicates from OWL such as 
      	<strong>owl:equivalentProperty</strong>, <strong>owl:equivalentClass</strong>, 
      	<strong>owl:sameAs</strong>, <strong>owl:SymmetricalProperty</strong>, 
      	<strong>owl:inverseOf</strong> etc ...</p>
      <p>Virtuoso implemented inference rules processing in a loosely coupled manner that allow 
      	users to conditionally apply inference context (via rules) to SPARQL queries. Typically, you 
      	have to create these rules following steps outlined <a href="rdfsparqlrule.html">here</a>.</p>
      <p>This tips and tricks note provides a shortcut for setting up and exploring RDF Schema and 
      	OWL reasoning once you&#39;ve installed the <a href="http://s3.amazonaws.com/opldownload/uda/vad-packages/6.1/virtuoso/fct_dav.vad">Virtuoso Faceted Browser VAD package</a>.</p>
      <div class="tip">
      <div class="tiptitle">See Also:</div>
       <p>
        <a href="rdfsparqlrule.html">Inference Rules and Reasoning</a>
      </p>
       <p>
        <a href="http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtFacetBrowserInstallConfig">Virtuoso Faceted Browser Installation and configuration</a>
      </p>
       <p>
        <a href="http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtuosoFacetsWebService">Virtuoso Faceted Web Service</a>
      </p>       
     </div>          
    <br />   
    
      <a name="virtuosotipsandtricksdumparbqntr" />
    <h3>1.5.23. How can I dump arbitrary query result as N-Triples?</h3>     
      <p>Assume the following arbitrary query:</p>
<div>
      <pre class="programlisting">
SPARQL define output:format &quot;NT&quot; 
CONSTRUCT { ?s a ?t } 
FROM virtrdf:
WHERE { ?s a ?t };	
</pre>
    </div>      
      <p>For iteration over result-set of an arbitrary query, use 
      	<a href="fn_exec_next.html">exec_next()</a> in a loop that begins with 
      	<a href="fn_exec.html">exec()</a> with cursor output variable as 
      	an argument and ends with <a href="fn_exec_close.html">exec_close()</a> 
      	after it is out of data.</p>
    <br />               	            	      
            	            	      
     <a name="virtuosotipsandtrickbindnmgrprst" />
    <h3>1.5.24. How do I bind named graph parameter in prepared statement?</h3>        	
     <p>Assume the following SPARQL query:</p>
<div>
      <pre class="programlisting">
CONSTRUCT 
  { 
    ?s ?p ?o
  } 
FROM ?context 
WHERE 
  { 
    ?s ?p ?o 
  }	
</pre>
    </div>     
     <p>To bind the named graph context of the query from above, the best solution due 
     	to performance implications, is to change the syntax of the query as:</p>
<div>
      <pre class="programlisting">
CONSTRUCT 
  { 
    ?s ?p ?o
  } 
WHERE 
  { 
    graph `iri(??)` { ?s ?p ?o } 
  }	
</pre>
    </div>     
     <p>Note: In case of using &quot;FROM clause&quot;, it needs a constant in order to check at the 
     	compile time whether the IRI refers to a graph or a graph group:</p>
     <ul>
       <li>Assume &quot;FROM clause&quot; is used as for ex:
<div>
          <pre class="programlisting">
CONSTRUCT 
  { 
    ?s ?p ?o
  } 
FROM `iri(??)` 
WHERE
  { 
    ?s ?p ?o
  }	
</pre>
        </div>  
         <ul>
           <li>In this case can be made security checks at 
           	the compile time (i.e., once) and not waste time at the run time.</li>
         </ul>      	
       </li>
       <li>Assume &quot;FROM clause&quot; is used as for ex:
<div>
          <pre class="programlisting">
CONSTRUCT 
  { 
    ?s ?p ?o
  }
FROM iri(??) 
WHERE 
  { 
    ?s ?p ?o 
  }	
</pre>
        </div>        	
         <ul>
           <li>In this case a compile-time check, a run-time check or 50/50 mix of them can 
           	be performed, depending on the security policies.</li>
         </ul>      	
       </li>
       <li>FROM without constant would mean that security rules, if they present in the storage, 
       	are used at the run time, for every triple that matches every triple pattern in the default graph. 
       	This issue can be reproduced if FROM is not specified at all: if security differs from default 
       	then the effect is noticeably bad.</li>
     </ul>
   <br />          	
    
      <a name="virtuosotipsandtricksadonetinsb" />
    <h3>1.5.25. How can I insert binary data to Virtuoso RDF storage in plain queries and with parameter binding via ADO.NET calls?</h3>     
      <p>The following example shows different methods for insert binary data to Virtuoso RDF storage in plain queries and with parameter binding via ADO.NET calls:</p>
<div>
      <pre class="programlisting">
# Test_Bin.cs


using System;
using System.Runtime.InteropServices;
using System.Text;
using System.Data;
using OpenLink.Data.Virtuoso;

#if ODBC_CLIENT
namespace OpenLink.Data.VirtuosoOdbcClient
#elif CLIENT
namespace OpenLink.Data.VirtuosoClient
#else
namespace OpenLink.Data.VirtuosoTest
#endif
{
    class Test_Bin
    {
        [STAThread]
        static void Main(string[] args)
        {
            IDataReader myread = null;
            IDbConnection c;

            c = new VirtuosoConnection(&quot;HOST=localhost:1111;UID=dba;PWD=dba;&quot;);

            IDbCommand cmd = c.CreateCommand();
            int ros;

            try
            {
                c.Open();

                cmd.CommandText = &quot;sparql clear graph &lt;ado.bin&gt;&quot;;
                cmd.ExecuteNonQuery();

//insert binary as base64Binary
                cmd.CommandText = &quot;sparql insert into graph &lt;ado.bin&gt; { &lt;res1&gt; &lt;attr&gt; \&quot;GpM7\&quot;^^&lt;http://www.w3.org/2001/XMLSchema#base64Binary&gt; }&quot;;
                cmd.ExecuteNonQuery();

//insert binary as hexBinary
                cmd.CommandText = &quot;sparql insert into graph &lt;ado.bin&gt; { &lt;res2&gt; &lt;attr&gt; \&quot;0FB7\&quot;^^&lt;http://www.w3.org/2001/XMLSchema#hexBinary&gt; }&quot;;
                cmd.ExecuteNonQuery();


//prepare for insert with parameter binding
                cmd.CommandText = &quot;sparql define output:format &#39;_JAVA_&#39; insert into graph &lt;ado.bin&gt; { `iri($?)` &lt;attr&gt; `bif:__rdf_long_from_batch_params($?,$?,$?)` }&quot;;

//bind parameters for insert binary as base64Binary
                IDbDataParameter param = cmd.CreateParameter();
                param.ParameterName = &quot;p1&quot;;
                param.DbType = DbType.AnsiString;
                param.Value = &quot;res3&quot;;
                cmd.Parameters.Add(param);

                param = cmd.CreateParameter();
                param.ParameterName = &quot;p2&quot;;
                param.DbType = DbType.Int32;
                param.Value = 4;
                cmd.Parameters.Add(param);

                param = cmd.CreateParameter();
                param.ParameterName = &quot;p3&quot;;
                param.DbType = DbType.AnsiString;
                param.Value = &quot;GpM7&quot;;
                cmd.Parameters.Add(param);

                param = cmd.CreateParameter();
                param.ParameterName = &quot;p4&quot;;
                param.DbType = DbType.AnsiString;
                param.Value = &quot;http://www.w3.org/2001/XMLSchema#base64Binary&quot;;
                cmd.Parameters.Add(param);

                cmd.ExecuteNonQuery();

                cmd.Parameters.Clear();

//bind parameters for insert binary as hexBinary
                param = cmd.CreateParameter();
                param.ParameterName = &quot;p1&quot;;
                param.DbType = DbType.AnsiString;
                param.Value = &quot;res4&quot;;
                cmd.Parameters.Add(param);

                param = cmd.CreateParameter();
                param.ParameterName = &quot;p2&quot;;
                param.DbType = DbType.Int32;
                param.Value = 4;
                cmd.Parameters.Add(param);

                param = cmd.CreateParameter();
                param.ParameterName = &quot;p3&quot;;
                param.DbType = DbType.AnsiString;
                param.Value = &quot;0FB7&quot;;
                cmd.Parameters.Add(param);

                param = cmd.CreateParameter();
                param.ParameterName = &quot;p4&quot;;
                param.DbType = DbType.AnsiString;
                param.Value = &quot;http://www.w3.org/2001/XMLSchema#hexBinary&quot;;
                cmd.Parameters.Add(param);

                cmd.ExecuteNonQuery();

                cmd.Parameters.Clear();

//bind parameters for insert binary as byte[]
                param = cmd.CreateParameter();
                param.ParameterName = &quot;p1&quot;;
                param.DbType = DbType.AnsiString;
                param.Value = &quot;res5&quot;;
                cmd.Parameters.Add(param);

                param = cmd.CreateParameter();
                param.ParameterName = &quot;p2&quot;;
                param.DbType = DbType.Int32;
                param.Value = 3;
                cmd.Parameters.Add(param);

                param = cmd.CreateParameter();
                param.ParameterName = &quot;p3&quot;;
                param.DbType = DbType.Binary;
                byte[] bin_val = {0x01, 0x02, 0x03, 0x04, 0x05};
                param.Value = bin_val;
                cmd.Parameters.Add(param);

                param = cmd.CreateParameter();
                param.ParameterName = &quot;p4&quot;;
                param.DbType = DbType.AnsiString;
                param.Value = System.DBNull.Value; 
                cmd.Parameters.Add(param);

                cmd.ExecuteNonQuery();

                cmd.Parameters.Clear();

//execute select and check the results
                cmd.CommandText = &quot;sparql SELECT ?s ?o FROM &lt;ado.bin&gt; WHERE {?s ?p ?o}&quot;; ;
                myread = cmd.ExecuteReader();
                int r = 0;

                while (myread.Read())
                {
                    Console.WriteLine(&quot;=== ROW === &quot;+r);
                    for (int i = 0; i &lt; myread.FieldCount; i++)
                    {
                        string s;
                        if (myread.IsDBNull(i))
                            Console.Write(&quot;N/A|\n&quot;);
                        else
                        {
                            object o = myread.GetValue(i);
                            Type t = myread.GetFieldType(i);

                            s = myread.GetString(i);
                            Console.Write(s + &quot;[&quot;);
                            if (o is SqlExtendedString)
                            {
                                SqlExtendedString se = (SqlExtendedString)o;
                                Console.Write(&quot;IriType=&quot; + se.IriType + &quot;;StrType=&quot; + se.StrType + &quot;;Value=&quot; + se.ToString());
                                Console.Write(&quot;;ObjectType=&quot; + o.GetType() + &quot;]|\n&quot;);
                            }
                            else if (o is SqlRdfBox)
                            {
                                SqlRdfBox se = (SqlRdfBox)o;
                                Console.Write(&quot;Lang=&quot; + se.StrLang + &quot;;Type=&quot; + se.StrType + &quot;;Value=&quot; + se.Value);
                                Console.Write(&quot;;ObjectType=&quot; + o.GetType() + &quot;]|\n&quot;);
                                object v = se.Value;
                                if (v is System.Byte[])
                                {
                                    byte[] vb = (byte[])v;
                                    for (int z = 0; z &lt; vb.Length; z++)
                                    {
                                        Console.WriteLine(&quot;&quot;+z+&quot;=&quot;+vb[z]);
                                    }
                                }
                            }
                            else
                                Console.Write(o.GetType() + &quot;]|\n&quot;);
                        }
                    }
                    r++;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(&quot;{0} Exception caught.&quot;, e);
            }
            finally
            {
                //		  if (myread != null)
                //		    myread.Close();

                if (c.State == ConnectionState.Open)
                    c.Close();

            }

        }
    }
}
</pre>
    </div>      
      <p>Output log for example is in the log.txt:</p>
<div>
      <pre class="programlisting">
# log.txt
=== ROW === 0
res1[IriType=IRI;StrType=IRI;Value=res1;ObjectType=OpenLink.Data.Virtuoso.SqlExtendedString]|
GpM7[Lang=;Type=http://www.w3.org/2001/XMLSchema#base64Binary;Value=GpM7;ObjectType=OpenLink.Data.Virtuoso.SqlRdfBox]|
=== ROW === 1
res2[IriType=IRI;StrType=IRI;Value=res2;ObjectType=OpenLink.Data.Virtuoso.SqlExtendedString]|
0FB7[Lang=;Type=http://www.w3.org/2001/XMLSchema#hexBinary;Value=0FB7;ObjectType=OpenLink.Data.Virtuoso.SqlRdfBox]|
=== ROW === 2
res3[IriType=IRI;StrType=IRI;Value=res3;ObjectType=OpenLink.Data.Virtuoso.SqlExtendedString]|
GpM7[Lang=;Type=http://www.w3.org/2001/XMLSchema#base64Binary;Value=GpM7;ObjectType=OpenLink.Data.Virtuoso.SqlRdfBox]|
=== ROW === 3
res4[IriType=IRI;StrType=IRI;Value=res4;ObjectType=OpenLink.Data.Virtuoso.SqlExtendedString]|
0FB7[Lang=;Type=http://www.w3.org/2001/XMLSchema#hexBinary;Value=0FB7;ObjectType=OpenLink.Data.Virtuoso.SqlRdfBox]|
=== ROW === 4
res5[IriType=IRI;StrType=IRI;Value=res5;ObjectType=OpenLink.Data.Virtuoso.SqlExtendedString]|
0102030405[System.Byte[]]|	
</pre>
    </div>      
    <br />     
    
      <a name="instrdfvs" />
    <h3>1.5.26. How can I insert RDF data from Visual Studio to Virtuoso?</h3>     
      <p>The following example shows how to insert RDF Data from Visual Studio to Virtuoso:</p>
<div>
      <pre class="programlisting">    
using System;
using System.Runtime.InteropServices;
using System.Text;
using System.Data;
using OpenLink.Data.Virtuoso;

#if ODBC_CLIENT
namespace OpenLink.Data.VirtuosoOdbcClient
#elif CLIENT
namespace OpenLink.Data.VirtuosoClient
#else
namespace OpenLink.Data.VirtuosoTest
#endif
{
    class Test_Insert
    {
        [STAThread]
        static void Main(string[] args)
        {
            IDataReader myread = null;
            IDbConnection c;

            c = new VirtuosoConnection(&quot;HOST=localhost:1111;UID=dba;PWD=dba;Charset=UTF-8&quot;);

            IDbCommand cmd = c.CreateCommand();
            int ros;

            try
            {
                c.Open();

                cmd.CommandText = &quot;sparql clear graph &lt;ado.net&gt;&quot;;
                cmd.ExecuteNonQuery();

                cmd.CommandText = &quot;sparql insert into graph &lt;ado.net&gt; { &lt;a&gt; &lt;P01&gt; \&quot;131\&quot;^^&lt;http://www.w3.org/2001/XMLSchema#short&gt; }&quot;;
                cmd.ExecuteNonQuery();

                cmd.CommandText = &quot;sparql insert into graph &lt;ado.net&gt; { &lt;a&gt; &lt;P02&gt; \&quot;1234\&quot;^^&lt;http://www.w3.org/2001/XMLSchema#integer&gt; }&quot;;
                cmd.ExecuteNonQuery();

                cmd.CommandText = &quot;sparql insert into graph &lt;ado.net&gt; { &lt;a&gt; &lt;P03&gt; \&quot;12345.12\&quot;^^&lt;http://www.w3.org/2001/XMLSchema#float&gt; }&quot;;
                cmd.ExecuteNonQuery();

                cmd.CommandText = &quot;sparql insert into graph &lt;ado.net&gt; { &lt;a&gt; &lt;P04&gt; \&quot;123456.12\&quot;^^&lt;http://www.w3.org/2001/XMLSchema#double&gt; }&quot;;
                cmd.ExecuteNonQuery();

                cmd.CommandText = &quot;sparql insert into graph &lt;ado.net&gt; { &lt;a&gt; &lt;P05&gt; \&quot;123456.12\&quot;^^&lt;http://www.w3.org/2001/XMLSchema#decimal&gt; }&quot;;
                cmd.ExecuteNonQuery();

                cmd.CommandText = &quot;sparql insert into graph &lt;ado.net&gt; { &lt;a&gt; &lt;P06&gt; \&quot;01020304\&quot;^^&lt;http://www.w3.org/2001/XMLSchema#hexBinary&gt; }&quot;;
                cmd.ExecuteNonQuery();

                cmd.CommandText = &quot;sparql insert into graph &lt;ado.net&gt; { &lt;a&gt; &lt;P07&gt; \&quot;01.20.1980T04:51:13\&quot;^^&lt;http://www.w3.org/2001/XMLSchema#dateTime&gt; }&quot;;
                cmd.ExecuteNonQuery();

                cmd.CommandText = &quot;sparql insert into graph &lt;ado.net&gt; { &lt;a&gt; &lt;P08&gt; \&quot;01.20.1980\&quot;^^&lt;http://www.w3.org/2001/XMLSchema#date&gt; }&quot;;
                cmd.ExecuteNonQuery();

                cmd.CommandText = &quot;sparql insert into graph &lt;ado.net&gt; { &lt;a&gt; &lt;P09&gt; \&quot;01:20:19\&quot;^^&lt;http://www.w3.org/2001/XMLSchema#time&gt; }&quot;;
                cmd.ExecuteNonQuery();

                cmd.CommandText = &quot;sparql insert into graph &lt;ado.net&gt; { &lt;a&gt; &lt;P10&gt; \&quot;test\&quot; }&quot;;
                cmd.ExecuteNonQuery();

                cmd.CommandText = &quot;sparql define output:format &#39;_JAVA_&#39; insert into graph &lt;ado.net&gt; { &lt;b&gt; `iri($?)` `bif:__rdf_long_from_batch_params($?,$?,$?)` }&quot;;

//add Object URI
                add_triple(cmd, &quot;S01&quot;, 1, &quot;test1&quot;, null);

//add Object BNode
                add_triple(cmd, &quot;S02&quot;, 1, &quot;_:test2&quot;, null);


//add Literal
                add_triple(cmd, &quot;S03&quot;, 3, &quot;test3&quot;, null);

//add Literal with Datatype
                add_triple(cmd, &quot;S04&quot;, 4, &quot;1234&quot;, &quot;http://www.w3.org/2001/XMLSchema#integer&quot;);

//add Literal with Lang
                add_triple(cmd, &quot;S05&quot;, 5, &quot;test5&quot;, &quot;en&quot;);


                add_triple(cmd, &quot;S06&quot;, 3, (short)123, null);
                add_triple(cmd, &quot;S07&quot;, 3, 1234, null);
                add_triple(cmd, &quot;S08&quot;, 3, (float)12345.12, null);
                add_triple(cmd, &quot;S09&quot;, 3, 123456.12, null);
                add_triple(cmd, &quot;S10&quot;, 3, new DateTime(2001, 02, 23, 13, 44, 51, 234), null);
                add_triple(cmd, &quot;S11&quot;, 3, new DateTime(2001, 02, 24), null);
                add_triple(cmd, &quot;S12&quot;, 3, new TimeSpan(19, 41, 23), null);
 

                add_triple(cmd, &quot;S13&quot;, 4, &quot;GpM7&quot;, &quot;http://www.w3.org/2001/XMLSchema#base64Binary&quot;);
                add_triple(cmd, &quot;S14&quot;, 4, &quot;0FB7&quot;, &quot;http://www.w3.org/2001/XMLSchema#hexBinary&quot;);
                byte[] bin_val = { 0x01, 0x02, 0x03, 0x04, 0x05 };
                add_triple(cmd, &quot;S15&quot;, 3, bin_val, null);

            }
            catch (Exception e)
            {
                Console.WriteLine(&quot;{0} Exception caught.&quot;, e);
            }
            finally
            {

                if (c.State == ConnectionState.Open)
                    c.Close();

            }

        }


        static void add_triple(IDbCommand cmd, string sub, int ptype, object val, string val_add)
        {
                cmd.Parameters.Clear();

                IDbDataParameter param = cmd.CreateParameter();
                param.ParameterName = &quot;p1&quot;;
                param.DbType = DbType.AnsiString;
                param.Value = sub;
                cmd.Parameters.Add(param);

                param = cmd.CreateParameter();
                param.ParameterName = &quot;p2&quot;;
                param.DbType = DbType.Int32;
                param.Value = ptype;
                cmd.Parameters.Add(param);

                param = cmd.CreateParameter();
                param.ParameterName = &quot;p3&quot;;
                if (val != null &amp;&amp; val.GetType() == typeof (System.String))
                    param.DbType = DbType.AnsiString;
                param.Value = val;
                cmd.Parameters.Add(param);

                param = cmd.CreateParameter();
                param.ParameterName = &quot;p4&quot;;
                param.DbType = DbType.AnsiString;
                param.Value = val_add;
                cmd.Parameters.Add(param);

                cmd.ExecuteNonQuery();
        }



    }
}	
</pre>
    </div>      
     <div class="tip">
      <div class="tiptitle">See Also:</div>
       <p>
        <a href="rdfinsertmethods.html">RDF Insert Methods in Virtuoso</a>
      </p>
     </div> 
    <br />     	
    
      <a name="descrmd" />
    <h3>1.5.27. How does default describe mode work?</h3>     
      <p>The default describe mode works only if subject has a type/class. To get any anonymous subject described CBD mode should be used:</p>
<div>
      <pre class="programlisting"> 
$ curl -i -L -H &quot;Accept: application/rdf+xml&quot; http://lod.openlinksw.com/describe/?url=http%3A%2F%2Fwww.mpii.de%2Fyago%2Fresource%2FEddie%255FMurphy
HTTP/1.1 303 See Other
Date: Mon, 21 Mar 2011 14:24:36 GMT
Server: Virtuoso/06.02.3129 (Linux) x86_64-generic-linux-glibc25-64  VDB
Content-Type: text/html; charset=UTF-8
Accept-Ranges: bytes
TCN: choice
Vary: negotiate,accept,Accept-Encoding
Location: http://lod.openlinksw.com/sparql?query=%20DESCRIBE%20%3Chttp%3A%2F%2Fwww.mpii.de%2Fyago%2Fresource%2FEddie%255FMurphy%3E&amp;format=application%
2Frdf%2Bxml
Content-Length: 0

HTTP/1.1 200 OK
Date: Mon, 21 Mar 2011 14:24:37 GMT
Server: Virtuoso/06.02.3129 (Linux) x86_64-generic-linux-glibc25-64  VDB
Accept-Ranges: bytes
Content-Type: application/rdf+xml; charset=UTF-8
Content-Length: 467967

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt;
&lt;rdf:RDF xmlns:rdf=&quot;http://www.w3.org/1999/02/22-rdf-syntax-ns#&quot; xmlns:rdfs=&quot;http://www.w3.org/2000/01/rdf-schema#&quot;&gt;
&lt;rdf:Description rdf:about=&quot;http://www.mpii.de/yago/resource/MTV%5FMovie%5FAward%5Ffor%5FBest%5FComedic%5FPerformance&quot;&gt;&lt;n0pred:hasInternalWikipediaLinkTo xmlns:n0pred=&quot;http://www.mpii.de/yago/resource/&quot; rdf:resource=&quot;http://www.mpii.de/yago/resource/Eddie%5FMurphy&quot;/&gt;&lt;/rdf:Description&gt;
&lt;rdf:Description rdf:about=&quot;http://www.mpii.de/yago/resource/#fact_23536547421&quot;&gt;&lt;rdf:subject rdf:resource=&quot;http://www.mpii.de/yago/resource/Eddie%5FMurphy&quot;/&gt;&lt;/rdf:Description&gt;
&lt;rdf:Description rdf:about=&quot;http://www.mpii.de/yago/resource/#fact_23536896725&quot;&gt;&lt;rdf:object rdf:resource=&quot;http://www.mpii.de/yago/resource/Eddie%5FMurphy&quot;/&gt;&lt;/rdf:Description&gt;
...
</pre>
    </div>            
    <br />    
    
      <a name="notresphttp" />
    <h3>1.5.28. What should I do if the Virtuoso Server is not responding to HTTP requests?</h3>     
      <p>Assume the Virtuoso server is not responding to HTTP requests although SQL connection is working. In order to determine what activity is being performed that might account for this:</p>
<ol>
      <li>Check the status: 
<div>
          <pre class="programlisting"> 
SQL&gt; status(&#39;&#39;);
REPORT
VARCHAR
_______________________________________________________________________________


OpenLink Virtuoso VDB Server
Version 06.02.3129-pthreads for Linux as of Mar 16 2011 
Registered to Uriburner (Personal Edition, unlimited connections)
Started on: 2011/03/17 10:49 GMT+60
 
Database Status:
  File size 0, 37598208 pages, 7313125 free.
  1000000 buffers, 993399 used, 76771 dirty 0 wired down, repl age 25548714 0 w. io 0 w/crsr.
  Disk Usage: 2642884 reads avg 4 msec, 30% r 0% w last  1389 s, 1557572 writes,
    15331 read ahead, batch = 79.  Autocompact 308508 in 219226 out, 28% saved.
Gate:  71130 2nd in reads, 0 gate write waits, 0 in while read 0 busy scrap. 
Log = virtuoso.trx, 14922248 bytes
VDB: 0 exec 0 fetch 0 transact 0 error
1757362 pages have been changed since last backup (in checkpoint state)
Current backup timestamp: 0x0000-0x00-0x00
Last backup date: unknown
Clients: 5 connects, max 2 concurrent
RPC: 116 calls, -1 pending, 1 max until now, 0 queued, 2 burst reads (1%), 0 second brk=9521074176
Checkpoint Remap 331113 pages, 0 mapped back. 1180 s atomic time.
    DB master 37598208 total 7313125 free 331113 remap 40593 mapped back
   temp  569856 total 569851 free
 
Lock Status: 52 deadlocks of which 0 2r1w, 86078 waits,
   Currently 1 threads running 0 threads waiting 0 threads in vdb.
Pending:


25 Rows. -- 1274 msec.
SQL&gt; 
	
</pre>
        </div>   	
  </li>
      <li>Connect with the PL debugger and see what is running currently using the info threads call: 
<div>
          <pre class="programlisting"> 
$ isql 1111 dba &lt;password&gt; -D
DEBUG&gt; info threads	
</pre>
        </div>   	
  </li>
      <li>This should return the current code being executed by the Sever.</li>
      <li>Run <a href="fn_txn_killall.html">txn_killall()</a> to kill any pending transactions which may enable the server to start responding to HTTP requests again: 
<div>
          <pre class="programlisting"> 

SQL&gt; txn_killall();

Done. -- 866 msec.	
</pre>
        </div>   	
  </li>
    </ol>
    <br /> 
    
      <a name="cxmlurlptrn" />
    <h3>1.5.29. What CXML params are supported for the SPARQL URL pattern?</h3>     
      <p>The following options are supported for CXML link behavior in the SPARQL URL Pattern:</p>
<ol>
      <li>Local faceted navigation links: 
<div>
          <pre class="programlisting"> 
# CXML_redir_for_subjs=&amp;CXML_redir_for_hrefs=&amp;: 

http://lod.openlinksw.com/sparql?default-graph-uri=&amp;should-sponge=&amp;query=SELECT+DISTINCT+%3Fcafe+%3Flat+%3Flong+%3Fcafename+%3Fchurchname++%28+bif%3Around%28bif%3Ast_distance+%28%3Fchurchgeo%2C+%3Fcafegeo%29%29+%29++WHERE++{++++%3Fchurch+a+lgv%3Aplace_of_worship+.++++%3Fchurch+geo%3Ageometry+%3Fchurchgeo+.++++%3Fchurch+lgv%3Aname+%3Fchurchname+.++++%3Fcafe+a+lgv%3Acafe+.++++%3Fcafe+lgv%3Aname+%3Fcafename+.++++%3Fcafe+geo%3Ageometry+%3Fcafegeo+.++++%3Fcafe+geo%3Alat+%3Flat+.++++%3Fcafe+geo%3Along+%3Flong+.++++FILTER+%28+bif%3Ast_intersects+%28%3Fchurchgeo%2C+bif%3Ast_point+%282.3498%2C48.853%29%2C5%29++%26%26+bif%3Ast_intersects+%28%3Fcafegeo%2C+%3Fchurchgeo%2C+0.2%29+%29+}+LIMIT+50&amp;debug=on&amp;timeout=&amp;format=text%2Fhtml&amp;CXML_redir_for_subjs=&amp;CXML_redir_for_hrefs=&amp;save=display&amp;fname=
</pre>
        </div>   	
  </li>
      <li>External Resource Links: 
<div>
          <pre class="programlisting"> 
# CXML_redir_for_subjs=&amp;CXML_redir_for_hrefs=121: 

http://lod.openlinksw.com/sparql?default-graph-uri=&amp;should-sponge=&amp;query=SELECT+DISTINCT+%3Fcafe+%3Flat+%3Flong+%3Fcafename+%3Fchurchname++%28+bif%3Around%28bif%3Ast_distance+%28%3Fchurchgeo%2C+%3Fcafegeo%29%29+%29++WHERE++{++++%3Fchurch+a+lgv%3Aplace_of_worship+.++++%3Fchurch+geo%3Ageometry+%3Fchurchgeo+.++++%3Fchurch+lgv%3Aname+%3Fchurchname+.++++%3Fcafe+a+lgv%3Acafe+.++++%3Fcafe+lgv%3Aname+%3Fcafename+.++++%3Fcafe+geo%3Ageometry+%3Fcafegeo+.++++%3Fcafe+geo%3Alat+%3Flat+.++++%3Fcafe+geo%3Along+%3Flong+.++++FILTER+%28+bif%3Ast_intersects+%28%3Fchurchgeo%2C+bif%3Ast_point+%282.3498%2C48.853%29%2C5%29++%26%26+bif%3Ast_intersects+%28%3Fcafegeo%2C+%3Fchurchgeo%2C+0.2%29+%29+}+LIMIT+50&amp;debug=on&amp;timeout=&amp;format=text%2Fhtml&amp;CXML_redir_for_subjs=&amp;CXML_redir_for_hrefs=121&amp;save=display&amp;fname=

</pre>
        </div>   	
  </li>
      <li>External faceted navigation links: 
<div>
          <pre class="programlisting"> 
# CXML_redir_for_subjs=&amp;CXML_redir_for_hrefs=LOCAL_PIVOT: 

http://lod.openlinksw.com/sparql?default-graph-uri=&amp;should-sponge=&amp;query=SELECT+DISTINCT+%3Fcafe+%3Flat+%3Flong+%3Fcafename+%3Fchurchname++%28+bif%3Around%28bif%3Ast_distance+%28%3Fchurchgeo%2C+%3Fcafegeo%29%29+%29++WHERE++{++++%3Fchurch+a+lgv%3Aplace_of_worship+.++++%3Fchurch+geo%3Ageometry+%3Fchurchgeo+.++++%3Fchurch+lgv%3Aname+%3Fchurchname+.++++%3Fcafe+a+lgv%3Acafe+.++++%3Fcafe+lgv%3Aname+%3Fcafename+.++++%3Fcafe+geo%3Ageometry+%3Fcafegeo+.++++%3Fcafe+geo%3Alat+%3Flat+.++++%3Fcafe+geo%3Along+%3Flong+.++++FILTER+%28+bif%3Ast_intersects+%28%3Fchurchgeo%2C+bif%3Ast_point+%282.3498%2C48.853%29%2C5%29++%26%26+bif%3Ast_intersects+%28%3Fcafegeo%2C+%3Fchurchgeo%2C+0.2%29+%29+}+LIMIT+50&amp;debug=on&amp;timeout=&amp;format=text%2Fhtml&amp;CXML_redir_for_subjs=&amp;CXML_redir_for_hrefs=LOCAL_PIVOT&amp;save=display&amp;fname=
</pre>
        </div>   	
  </li>
      <li>External description resource(TTL): 
<div>
          <pre class="programlisting"> 
# CXML_redir_for_subjs=&amp;CXML_redir_for_hrefs=LOCAL_TTL:

http://lod.openlinksw.com/sparql?default-graph-uri=&amp;should-sponge=&amp;query=SELECT+DISTINCT+%3Fcafe+%3Flat+%3Flong+%3Fcafename+%3Fchurchname++%28+bif%3Around%28bif%3Ast_distance+%28%3Fchurchgeo%2C+%3Fcafegeo%29%29+%29++WHERE++{++++%3Fchurch+a+lgv%3Aplace_of_worship+.++++%3Fchurch+geo%3Ageometry+%3Fchurchgeo+.++++%3Fchurch+lgv%3Aname+%3Fchurchname+.++++%3Fcafe+a+lgv%3Acafe+.++++%3Fcafe+lgv%3Aname+%3Fcafename+.++++%3Fcafe+geo%3Ageometry+%3Fcafegeo+.++++%3Fcafe+geo%3Alat+%3Flat+.++++%3Fcafe+geo%3Along+%3Flong+.++++FILTER+%28+bif%3Ast_intersects+%28%3Fchurchgeo%2C+bif%3Ast_point+%282.3498%2C48.853%29%2C5%29++%26%26+bif%3Ast_intersects+%28%3Fcafegeo%2C+%3Fchurchgeo%2C+0.2%29+%29+}+LIMIT+50&amp;debug=on&amp;timeout=&amp;format=text%2Fhtml&amp;CXML_redir_for_subjs=&amp;CXML_redir_for_hrefs=LOCAL_TTL&amp;save=display&amp;fname=
</pre>
        </div>   	
  </li>
      <li>External description resource(CXML): 
<div>
          <pre class="programlisting"> 
# CXML_redir_for_subjs=&amp;CXML_redir_for_hrefs=LOCAL_CXML: 

http://lod.openlinksw.com/sparql?default-graph-uri=&amp;should-sponge=&amp;query=SELECT+DISTINCT+%3Fcafe+%3Flat+%3Flong+%3Fcafename+%3Fchurchname++%28+bif%3Around%28bif%3Ast_distance+%28%3Fchurchgeo%2C+%3Fcafegeo%29%29+%29++WHERE++{++++%3Fchurch+a+lgv%3Aplace_of_worship+.++++%3Fchurch+geo%3Ageometry+%3Fchurchgeo+.++++%3Fchurch+lgv%3Aname+%3Fchurchname+.++++%3Fcafe+a+lgv%3Acafe+.++++%3Fcafe+lgv%3Aname+%3Fcafename+.++++%3Fcafe+geo%3Ageometry+%3Fcafegeo+.++++%3Fcafe+geo%3Alat+%3Flat+.++++%3Fcafe+geo%3Along+%3Flong+.++++FILTER+%28+bif%3Ast_intersects+%28%3Fchurchgeo%2C+bif%3Ast_point+%282.3498%2C48.853%29%2C5%29++%26%26+bif%3Ast_intersects+%28%3Fcafegeo%2C+%3Fchurchgeo%2C+0.2%29+%29+}+LIMIT+50&amp;debug=on&amp;timeout=&amp;format=text%2Fhtml&amp;CXML_redir_for_subjs=&amp;CXML_redir_for_hrefs=LOCAL_CXML&amp;save=display&amp;fname=
</pre>
        </div>   	
  </li>
    </ol>
    <br /> 
    
      <a name="replallgr" />
    <h3>1.5.30. How can I replicate all graphs?</h3>     
      <p>To replicate all graphs ( except the system graph http://www.openlinksw.com/schemas/virtrdf# ), 
      	one should use http://www.openlinksw.com/schemas/virtrdf#rdf_repl_all as graph IRI:</p>
<div>
      <pre class="programlisting"> 
SQL&gt; DB.DBA.RDF_RDF_REPL_GRAPH_INS (&#39;http://www.openlinksw.com/schemas/virtrdf#rdf_repl_all&#39;);
</pre>
    </div>   	
    <br />        	
    
      <a name="rndsalltr" />
    <h3>1.5.31. What is best method to get a random sample of all triples for a subset of all the resources 
      	of a SPARQL endpoint?</h3>     
      <p>The best method to get a random sample of all triples for a subset of all the resources of 
      	a SPARQL endpoint, is decimation in its original style:</p>
<div>
      <pre class="programlisting"> 
SELECT ?s ?p ?o 
FROM &lt;some-graph&gt;
WHERE 
  { 
    ?s ?p ?o .
    FILTER ( 1 &gt; bif:rnd (10, ?s, ?p, ?o) )
  }
</pre>
    </div>   	
      <p>By tweaking first argument of <strong>bif:rnd()</strong> and the left side of the 
      inequality you can tweak decimation ratio from 1/10 to the desired value. What&#39;s important is 
      to know that the SQL optimizer has a right to execute <strong>bif:rnd (10)</strong> only once 
      at the beginning of the query, so we had to pass additional three arguments that can be known only 
      when a table row is fetched so <strong>bif:rnd (10, ?s, ?p, ?o)</strong> is calculated for every 
      row and thus any given row is either returned or ignored independently from others.</p>
      <p>However, <strong>bif:rnd (10, ?s, ?p, ?o)</strong> contains a subtle inefficiency. In RDF 
      store, graph nodes are stored as numeric IRI IDs and literal objects can be stored in a separate 
      table. The call of an SQL function needs arguments of traditional SQL datatypes, so the query 
      processor will extract the text of IRI for each node and the full value for each literal object. 
      That is significant waste of time. The workaround is:</p>      
<div>
      <pre class="programlisting"> 
SPARQL 
SELECT ?s ?p ?o 
FROM &lt;some-graph&gt; 
WHERE 
  { 
    ?s ?p ?o .
    FILTER ( 1&gt;  &lt;SHORT_OR_LONG::bif:rnd&gt;  (10, ?s, ?p, ?o))  
  }
</pre>
    </div>   	
      <p>This tells the SPARQL front-end to omit redundant conversions of values.</p>
    <br />   
    
      <a name="replallgr" />
    <h3>1.5.32. How can I replicate all graphs?</h3>     
      <p>To replicate all graphs ( except the system graph http://www.openlinksw.com/schemas/virtrdf# ), 
      	one should use http://www.openlinksw.com/schemas/virtrdf#rdf_repl_all as graph IRI:</p>
<div>
      <pre class="programlisting"> 
SQL&gt; DB.DBA.RDF_RDF_REPL_GRAPH_INS (&#39;http://www.openlinksw.com/schemas/virtrdf#rdf_repl_all&#39;);
</pre>
    </div>   	
    <br />  
    
      <a name="sparqlmkmeshup" />
    <h3>1.5.33. How can I use SPARQL to make Meshups?</h3>     
      <p>The following example demonstrates how to use SPARQL in order to make Meshups:</p>
<div>
      <pre class="programlisting"> 
PREFIX dbo: &lt;http://dbpedia.org/ontology/&gt;
PREFIX rtb: &lt;http://www.openlinksw.com/schemas/oat/rdftabs#&gt;

CONSTRUCT 
  {
    ?museum geo:geometry ?museumgeo ;
             rtb:useMarker &#39;star&#39; ;
             foaf:name ?musname;
             rdfs:comment ?muscomment.
    ?edu geo:geometry ?edugeo ;
          rtb:useMarker &#39;book&#39; ;
          foaf:name ?eduname;
          rdfs:comment ?educomment.
    ?wh geo:geometry ?whgeo;
            rtb:useMarker &#39;03&#39;;
            foaf:name ?whname;
            rdfs:comment ?whcomment.
  }
WHERE 
  { 
    {
      ?museum a dbo:Museum;
              geo:geometry ?museumgeo;
              foaf:name ?musname;
              rdfs:comment ?muscomment.
      filter (lang(?musname)=&#39;en&#39; &amp;&amp; lang(?muscomment)=&#39;en&#39;)
    } 
    UNION 
    {
      ?edu a dbo:University;
           geo:geometry ?edugeo;
           foaf:name ?eduname;
           rdfs:comment ?educomment.
      filter (lang(?eduname)=&#39;en&#39; &amp;&amp; lang(?educomment)=&#39;en&#39;)
    } 
    UNION 
    {
      ?wh a dbo:WorldHeritageSite;
            geo:geometry ?whgeo;
            rdfs:label ?whname;
            rdfs:comment ?whcomment. 
      filter (lang(?whname)=&#39;en&#39; &amp;&amp; lang(?whcomment)=&#39;en&#39;)
    } 
  }
</pre>
    </div>   	
    <br /> 
    
      <a name="clusternetmeter" />
    <h3>1.5.34. How can I use the net_meter utility before starting the ingestion to a cluster?</h3>                 	
      <p>The <a href="">net_meter</a> utility is a SQL procedure that runs a network 
test procedure on every host of the cluster. The network test procedure sends a message 
to every other host of the cluster and waits for the replies from each host. After the last 
reply is received the action is repeated. This results in a symmetrical load of the network, 
all points acting as both clients and servers to all other points.
      </p>
<div>
      <pre class="programlisting">
net_meter ( 
  in n_threads int, 
  in n_batches int, 
  in bytes int, 
  in ops_per_batch int)
</pre>
    </div>
      <p>The parameters have the following meaning:</p>
      <ul>
        <li>
        <strong>n_threads</strong>: The number of network test instances started on 
each host. A value of 4 on a cluster of 4 hosts would result in a total of 16 network test 
procedures spread over 4 processes.
        </li>
        <li>
        <strong>n_batches</strong>: The number of message exchanges done by each network 
test procedure. A message exchange consists of sending one request to every other host of the cluster 
and of waiting for all to have replied.
        </li>
        <li>
        <strong>bytes</strong>: The number of bytes sent to each host in each message 
exchange. The reply from each host has the same number of bytes.
        </li>
        <li>
        <strong>ops_per_batch</strong>: This causes each message batch to contain several 
operations. In practice this is a multiplier on the number of bytes.
        </li>
      </ul>
      
        <a name="clusternetmeterex" />
    <h4>1.5.34.1. Example</h4>
        <p>Assume anuser has run 2 sets of tests on a cluster:</p>
        <p>The first one was 1 thread, 1000 batches, 1000 bytes per exchange, 1 operation per batch:</p>
<div>
      <pre class="programlisting">
SQL&gt; net_meter (1, 1000, 1000, 1);

round_trips     MBps
REAL            REAL
    
_______________________________________

1245.393315542000254  2.489418401123078

1 Rows. -- 39345 msec.	
</pre>
    </div>
        <p>resulted in a measured throughput of 2.5 MBps</p>
        <p>The second one was 1 thread, 5000 batches, 10000 bytes per exchange, 1 operation per batch:</p>
<div>
      <pre class="programlisting">
SQL&gt; net_meter (1, 5000, 10000, 1);

round_trips     MBps
REAL            REAL
    
___________________________________________

15915.291672080031181  305.017186586494738

1 Rows. -- 15394 msec.	
</pre>
    </div>
        <p>resulted in a measured throughput of 305 MBps.</p>
        <p>This indicates that the user&#39;s network is slow when sending multiple short messages.</p>
        <p>When using the ingestion you should check the:</p>
<div>
      <pre class="programlisting">
status(&#39;cluster&#39;);	
</pre>
    </div>        	   
        <p>command a few times and check the XX KB/s amount which should be around or above the 2500 mark.</p>
      <br />	
    <br />   
    
      <a name="loadcmrdf" />
    <h3>1.5.35. How can I use the LOAD command to import RDF data?</h3>                 	
      <p>SPARQL INSERT can be done using the LOAD command:</p>
<div>
      <pre class="programlisting">  
SPARQL INSERT INTO &lt;..&gt; { .... } [[FROM ...] { ... }]

SPARQL LOAD &lt;x&gt; [INTO &lt;y&gt;]

-- &lt;ResourceURL&gt; will be the Graph IRI of the loaded data:
SPARQL LOAD &lt;ResourceURL&gt;	
</pre>
    </div>  	  
       
      	<a name="loadcmrdfex" />
    <h4>1.5.35.1. Examples</h4> 
          
      	  <a name="loadcmrdfex1" />
    <h5>1.5.35.1.1. Load from Resource URL</h5>         	
      	  <p>In order to load data from resource URL for ex: 
http://www.w3.org/People/Berners-Lee/card#i , execute from isql the following command:</p>
<div>
      <pre class="programlisting">  
SQL&gt; SPARQL LOAD &lt;http://www.w3.org/People/Berners-Lee/card#i&gt;;
callret-0
VARCHAR
_______________________________________________________________________________

Load &lt;http://www.w3.org/People/Berners-Lee/card#i&gt; into graph &lt;http://www.w3.org/People/Berners-Lee/card#i&gt; -- done

1 Rows. -- 703 msec.
SQL&gt;	
</pre>
    </div> 
        <br />      	
                 	
      	  <a name="loadcmrdfex2" />
    <h5>1.5.35.1.2. Load from file</h5>         	
          <ol>
      <li>Create DAV collection which is visible to public, for ex: http://localhost:8890/DAV/tmp</li>
      <li>Upload to the DAV collection a file for ex. with name listall.rq and with the following content:
<div>
          <pre class="programlisting">  
SPARQL
PREFIX rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX sioc: &lt;http://rdfs.org/sioc/ns#&gt;
SELECT ?x ?p ?o
FROM &lt;http://mygraph.com&gt;
WHERE
  {
    ?x rdf:type sioc:User .
    ?x ?p ?o.
    ?x sioc:id ?id .
    FILTER REGEX(str(?id), &quot;^King&quot;)
  }
ORDER BY ?x	
</pre>
        </div>             	
            </li>
      <li>Execute from ISQL the following command:
<div>
          <pre class="programlisting">  
SQL&gt;SPARQL LOAD bif:concat (&quot;http://&quot;, bif:registry_get(&quot;URIQADefaultHost&quot;), &quot;/DAV/tmp/listall.rq&quot;) into graph &lt;http://myNewGraph.com&gt;;
callret-0
VARCHAR
_______________________________________________________________________________

Load &lt;http://localhost:8890/DAV/tmp/listall.rq&gt; into graph &lt;http://myNewGraph.com&gt; -- done

1 Rows. -- 321 msec.	
</pre>
        </div>            	
            </li>
    </ol>      	  
        <br />      	
          
      	  <a name="loadcmrdfex3" />
    <h5>1.5.35.1.3. Directly LOAD triples using ISQL</h5>         	
<div>
      <pre class="programlisting">
SQL&gt;SPARQL INSERT INTO graph &lt;http://mygraph.com&gt;
{
  &lt;http://myopenlink.net/dataspace/Kingsley#this&gt;
  &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt;
  &lt;http://rdfs.org/sioc/ns#User&gt; .

  &lt;http://myopenlink.net/dataspace/Kingsley#this&gt;
  &lt;http://rdfs.org/sioc/ns#id&gt;
  &lt;Kingsley&gt; .

  &lt;http://myopenlink.net/dataspace/Caroline#this&gt;
  &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt;
  &lt;http://rdfs.org/sioc/ns#User&gt; .

  &lt;http://myopenlink.net/dataspace/Caroline#this&gt;
  &lt;http://rdfs.org/sioc/ns#id&gt;
  &lt;Caroline&gt; .
};	
</pre>
    </div>
        <br />      	
      <br />      	
    <br />       
    
      <a name="degrprc" />
    <h3>1.5.36. How can I delete graphs using stored procedure?</h3>     
      <p>The following script demonstrates the use of custom stored procedures for deleting graph(s). 
      	It first creates a table <strong>GRAPHS_TO_DELETE</strong>, into which the names of the graphs 
      	to be deleted should be inserted, as follows:</p>
<div>
      <pre class="programlisting"> 
use MYUSR;

create procedure GRAPHS_TO_DELETE_SP (in gd_iris any)
{
  declare gd_iri iri_id;
  declare dp, row any;
  result_names (gd_iri);
  dp := dpipe (0, &#39;__I2IDN&#39;);
  foreach (varchar iri in GD_IRIS) do
    {
      dpipe_input (dp, iri);
    }
  while (0 &lt;&gt; (row := dpipe_next (dp, 0)))
    {
      result (row[0]);
    }
}
;

drop view GRAPHS_TO_DELETE_VIEW;
create procedure view GRAPHS_TO_DELETE_VIEW as MYUSR.DBA.GRAPHS_TO_DELETE_SP (gd_iris) (gd_iri any);

create procedure DELETE_GRAPHS (in g_iris any)
{
  declare g_iids any;
  if (not isvector (g_iris) and g_iris is not null)
    signal (&#39;22023&#39;, &#39;.....&#39;, &#39;The input argument must be an array of strings or null&#39;);
  if (not length (g_iris))
    return 0;
  delete from DB.DBA.RDF_QUAD where G in (select * from GRAPHS_TO_DELETE_VIEW where gd_iris = g_iris) option (loop exists);
  return row_count ();
}
;
</pre>
    </div>   	
      <p>Finally call the procedure DELETE_GRAPHS to perform the deletion of the specified graphs. 
      	Note it does not return a result set and can be called as follows:</p> 
<div>
      <pre class="programlisting"> 
SQL&gt; select MYUSR.DBA.DELETE_GRAPHS (vector (&#39;g1&#39;, &#39;g2&#39;, &#39;g3&#39;));	
</pre>
    </div>   	
      <p>This will return the number of triples removed from the specified graphs.</p>       
      <p>Note: the procedure only applies to the cluster so to get IRI IDs via partitioned 
      	pipe (DAQ). It is not usable on single.</p>
    <br />     
    
      <a name="sparulspongertut" />
    <h3>1.5.37. How can I use SPARUL to add missing triples to a Named Graph?</h3>         
      
      	<a name="sparulspongertutwhat" />
    <h4>1.5.37.1. What?</h4>
        <p>Use of SPARUL to add missing triples to a Named Graph. For example, an ontology/vocabulary 
        	extension.</p>         
      <br />           
      
      	<a name="sparulspongertutwhy" />
    <h4>1.5.37.2. Why?</h4>
        <p>A lot of ontologies and vocabularies started life prior to emergence of the Linked Data 
        	meme. As a result, many do not include rdfs:isDefinedBy relations (via triples) that associate 
        	Classes and Properties in an ontology with the ontology itself, using de-referencable URIs. 
        	The downside of this pattern is that Linked Data&#39;s follow-your-nose pattern isn&#39;t exploitable 
        	when viewing these ontologies e.g., when using contemporary Linked Data aware browsers.</p>         
      <br />           
      
      	<a name="sparulspongertuthow" />
    <h4>1.5.37.3. How?</h4>
        <p>If SPARUL privileges are assigned to SPARQL or other accounts associated with SPARQL 
        	Endpoint. Or via WebID? protected SPARQL endpoint with SPARUL is granted to SPARQL or specific 
        	accounts or WebIDs in a group.</p>         
<div>
      <pre class="programlisting">
INSERT INTO &lt;LocalNamedGraphIRI&gt;
  { ?s rdfs:DefinedBy &lt;LocalOntologyEntityURI&gt;.
    ?o rdfs:isDefinedBy &lt;http://www.w3.org/ns/auth/acl&gt;. }
FROM &lt;ExtSourceNamedGraphIRI&gt; 
WHERE 
  { 
    ?s a ?o 
  }
</pre>
    </div>  
        
      	  <a name="sparulspongertutex" />
    <h5>1.5.37.3.1. Example</h5>      
          <ol>
      <li>Load Quad Named Graph via Sponger based query: 
<div>
          <pre class="programlisting">
DEFINE get:soft &quot;replace&quot;
SELECT DISTINCT *
FROM &lt;http://www.w3.org/ns/auth/acl#&gt;
WHERE 
  { 
    ?s ?p ?o 
  }
</pre>
        </div>
            </li>
      <li>Added Triples via SPARUL to Ontology Named Graph: 
<div>
          <pre class="programlisting">
INSERT INTO &lt;http://www.w3.org/ns/auth/acl#&gt;
  {  ?s rdfs:DefinedBy &lt;http://www.w3.org/ns/auth/acl&gt;.
     ?o rdfs:DefinedBy &lt;http://www.w3.org/ns/auth/acl&gt;. }
FROM &lt;http://www.w3.org/ns/auth/acl#&gt; 
WHERE 
  {
    ?s a ?o
  }
</pre>
        </div>
            </li>
      <li>Via Conductor or Command-line iSQL courtesy of SPASQL execute the following statements: 
            	<ol>
          <li>Remove an existing graph: 
<div>
              <pre class="programlisting">
SPARQL
CLEAR GRAPH &lt;http://www.w3.org/ns/auth/acl/&gt; ;

SPARQL
CLEAR GRAPH &lt;http://www.w3.org/ns/auth/acl&gt; ;

SPARQL
CLEAR GRAPH &lt;http://www.w3.org/ns/auth/acl#&gt; ;
</pre>
            </div>
                </li>
          <li>Load a new graph: 
<div>
              <pre class="programlisting">
SPARQL
LOAD &lt;http://www.w3.org/ns/auth/acl&gt; ;
</pre>
            </div>
                </li>
          <li>Add missing rdfs:isDefinedBy triples via SPARUL: 
<div>
              <pre class="programlisting">
SPARQL
INSERT INTO &lt;http://www.w3.org/ns/auth/acl&gt;
  {  ?s rdfs:DefinedBy &lt;http://www.w3.org/ns/auth/acl&gt;.
     ?o rdfs:DefinedBy &lt;http://www.w3.org/ns/auth/acl&gt;. }
FROM &lt;http://www.w3.org/ns/auth/acl&gt; 
WHERE 
  {
    ?s a ?o
  } ;
</pre>
            </div>
                </li>
        </ol>
            </li>
      <li>Verification: Access the following url: <strong>http://&lt;cname&gt;/describe/?uri=http://www.w3.org/ns/auth/acl&gt;</strong>
            </li>
    </ol>      	
          <div class="tip">
      <div class="tiptitle">See Also:</div>
            <p>
        <a href="sparqlextensions.html#rdfsparul">SPARUL -- an Update Language For RDF Graphs</a>
      </p>
            <p>
        <a href="http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtSponger">Virtuoso Sponger</a>
        <a href="sparqlextensions.html#rdfsparul" />
      </p>            
          </div>  	
        <br />                 	  
      <br />           
    <br />           
    
      <a name="ifsparqlbi" />
    <h3>1.5.38. How can I use the SPARQL IF operator for SPARQL-BI endpoint?</h3>                 	
      <p>Assume a SPARQL query is to be executed against the Virtuoso DBpedia SPARQL endpoint 
      	(<a href="http://dbpedia.org/sparql">http://dbpedia.org/sparql</a>) to retrieve the 
      	decimal longitude of the &quot;NJ Devils&#39; hometown&quot; with cardinal direction, which determines 
      	whether the decimal is positive (in the case of East) or negative (in the case of West).</p>
      <p>Virtuoso supports SPARQL-BI, an extended SPARQL 1.0 implementation from before SPARQL 1.1 
      	was ratified, thus the &quot;IF&quot; operator is not currently supported, but an equivalent 
      	<a href="fn_either.html">bif:either</a> built-in SQL function does 
      	exist enabling an equivalent query to be executed:</p>
<div>
      <pre class="programlisting">
PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
PREFIX dbo: &lt;http://dbpedia.org/ontology/&gt;
PREFIX dbp: &lt;http://dbpedia.org/property/&gt;
SELECT ?team ( (bif:either( ?ew = &#39;W&#39;, -1, 1)) * (?d + (((?m * 60) + ?s) / 3600.0)) as ?v)
  { 
    ?team a dbo:HockeyTeam . ?team rdfs:label &#39;New Jersey Devils&#39;@en . 
    ?team dbp:city ?cityname . ?city rdfs:label ?cityname . 
    ?city dbp:longd ?d; dbp:longm ?m; dbp:longs ?s; dbp:longew ?ew . 
  }  	
</pre>
    </div>      
      <table class="figure" border="0" cellpadding="0" cellspacing="0">
    <tr>
     <td>
          <img alt="SPARQL IF operator for SPARQL-BI endpoint" src="../images/ui/spbi1.png" />
     </td>
    </tr>
    <tr>
        <td>Figure: 1.5.38.1. SPARQL IF operator for SPARQL-BI endpoint</td>
    </tr>
    </table>
      <div class="tip">
      <div class="tiptitle">See Also:</div>
        <p>
        <a href="rdfsparql.html#rdfsparqlimplementatioptragmas">Supported SPARQL-BI &quot;define&quot; pragmas</a>
      </p>
        <p>
        <a href="http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VOSArticleBISPARQL2">SPARQL-BI</a>
        <a href="sparqlextensions.html#rdfsparul" />
      </p>            
      </div>      
    <br />  
    
      <a name="chpntset" />
    <h3>1.5.39. How can I handle checkpoint condition?</h3>
      <p>In general, to control checkpoint in order to bypass client timeouts during long checkpoints when inserting triples into the Virtuoso server, one must disable automatic checkpoint by:</p>
<div>
      <pre class="programlisting">
SQL&gt; checkpoint_interval (0);	
</pre>
    </div>      
      <p>and also to make sure the AutoCheckpointLogSize is off. Then can be performed checkpoint whenever the client wants using the &#39;checkpoint&#39; command.</p>
      <p>However the need of cache check is not needed unless instance shows regular errors. By default the cache check is disabled.</p>
      <p>Virtuoso offers a new option in the Virtuoso ini file to enable the check of page maps: <strong>PageMapCheck</strong>, 1/0 default 0: </p>
<div>
      <pre class="programlisting">
-- Virtuoso.ini

...
[Parameters]
...
PageMapCheck  = 0
...	
</pre>
    </div>      
      <p>Also customer can add <strong>CheckpointSyncMode = 0</strong> in order to disable sync during checkpoint to speed the operations.</p>
    <br />    
    
      <a name="inccntnegt" />
    <h3>1.5.40. How can I incorporate Content Negotiation into RDF bulk loaders?</h3>       
      <p>The examples from below demonstrate how to incorporate Content Negotiation into RDF bulk loaders:</p>
      <ul>
        <li>Using the <a href="fn_rdf_load_rdfxml.html">DB.DBA.RDF_LOAD_RDFXML</a> function:
<div>
          <pre class="programlisting">
DB.DBA.RDF_LOAD_RDFXML (http_get (&#39;http://purl.org/ontology/mo/&#39;, null, &#39;GET&#39;, &#39;Accept: application/rdf+xml&#39;, null, null, 3), &#39;http://purl.org/ontology/mo/&#39;, &#39;http://purl.org/ontology/mo/&#39;) .	
</pre>
        </div>
        </li>
        <li>Using the <a href="fn_ttlp.html">DB.DBA.TTLP</a> function: The call to http client should be modified to ask for appropriate content type as for ex: 
<div>
          <pre class="programlisting">
DB.DBA.TTLP (http_get (&#39;http://purl.org/ontology/mo/&#39;, null, &#39;GET&#39;, &#39;Accept: text/n3&#39;, null, null, 3), &#39;http://purl.org/ontology/mo/&#39;, &#39;http://purl.org/ontology/mo/&#39;), &#39;...&#39;, &#39;...&#39;);
</pre>
        </div>        	
        </li>
      </ul>
    <br />      
        
       <a name="linkeddata3simplesteps" />
    <h3>1.5.41. Virtuoso Linked Data Deployment In 3 Simple Steps?</h3>	    
       <p>Injecting Linked Data into the Web has been a major pain point for those who seek personal, service, or organization-specific variants of DBpedia. Basically, the sequence goes something like this:</p>
       <ol>
      <li>You encounter DBpedia or the LOD Cloud Pictorial.</li>
      <li>You look around (typically following your nose from link to link).</li>
      <li>You attempt to publish your own stuff.</li>
      <li>You get stuck.</li>
    </ol>       
       <p>The problems typically take the following form:</p>
       <ol>
      <li>Functionality confusion about the complementary Name and Address functionality of a single URI abstraction.</li>
      <li>Terminology confusion due to conflation and over-loading of terms such as Resource, URL, Representation, Document, etc.</li>
      <li>Inability to find robust tools with which to generate Linked Data from existing data sources such as relational databases, CSV files, XML, Web Services, etc.</li>
    </ol>              
       <p>To start addressing these problems, here is a simple guide for generating and publishing Linked Data using Virtuoso.</p>
         
       	 <a name="linkeddata3simplesteps1" />
    <h4>1.5.41.1. Step 1 - RDF Data Generation</h4>    
         <p>Existing RDF data can be added to the Virtuoso RDF Quad Store via a variety of built-in data loader utilities.</p>
         <p>Many options allow you to easily and quickly generate RDF data from other data sources:</p>       	    
         <ul>
           <li>Install the Sponger Bookmarklet for the URIBurner service. Bind this to your own SPARQL-compliant backend RDF database (in this scenario, your local Virtuoso instance), and then Sponge some HTTP-accessible resources.</li>
           <li>Convert relational DBMS data to RDF using the Virtuoso Linked Data Views Wizard.</li>
           <li>Starting with CSV files, you can:
             <ul>
               <li>Place them at an HTTP-accessible location, and use the Virtuoso Sponger to convert them to RDF or;</li>
               <li>Use the CVS import feature to import their content into Virtuoso&#39;s relational 
               	data engine; then use the built-in Linked Data Views Wizard as with other RDBMS data.</li>
             </ul>           	
           </li>
           <li>Starting from XML files, you can:
             <ul>
               <li>Use Virtuoso&#39;s inbuilt XSLT-Processor for manual XML to RDF/XML transformation or;</li>
               <li>Leverage the Sponger Cartridge for GRDDL, if there is a transformation service associated with your XML data source, or;</li>
               <li>Let the Sponger analyze the XML data source and make a best-effort transformation to RDF.</li>               
             </ul>           	
           </li>                      
         </ul>         
       <br />       	
          
       	 <a name="linkeddata3simplesteps2" />
    <h4>1.5.41.2. Step 2 - Linked Data Deployment</h4>           	     
         <p>Install the Faceted Browser VAD package (fct_dav.vad) which delivers the following:</p>       	 
         <ol>
      <li>Faceted Browser Engine UI</li>
      <li>Dynamic Hypermedia Resource Generator:
             <ul>
               <li>delivers descriptor resources for every entity (data object) in the Native or Virtual Quad Stores</li>
               <li>supports a broad array of output formats, including HTML+RDFa, RDF/XML, N3/Turtle, NTriples, RDF-JSON, OData+Atom, and OData+JSON.</li>
             </ul>           	
           </li>
    </ol>         
       <br />       	       
               
       	 <a name="linkeddata3simplesteps3" />
    <h4>1.5.41.3. Step 3 - Linked Data Consumption &amp; Exploitation</h4>           	
         <p>Three simple steps allow you, your enterprise, and your customers to consume and exploit your newly deployed Linked Data --</p>
           <ol>
      <li>Load a page like this in your browser: http://&lt;cname&gt;[:&lt;port&gt;]/describe/?uri=&lt;entity-uri&gt; 
               <ul>
                 <li>&lt;cname&gt;[:&lt;port&gt;] gets replaced by the host and port of your Virtuoso instance </li>
                 <li>&lt;entity-uri&gt; gets replaced by the URI you want to see described -- for instance, the URI of one of the resources you let the Sponger handle.</li>
               </ul>             	
             </li>
      <li>Follow the links presented in the descriptor page.</li>
      <li>If you ever see a blank page with a hyperlink subject name in the About: section at the top of the page, simply add the parameter &quot;&amp;sp=1&quot; to the URL in the browser&#39;s Address box, and hit [ENTER]. This will result in an &quot;on the fly&quot; resource retrieval, transformation, and descriptor page generation.</li>
      <li>Use the navigator controls to page up and down the data associated with the &quot;in scope&quot; resource descriptor.</li>
    </ol>         
       <br />       	       
    <br />          	
    
      <a name="difcrdrdelgr" />
    <h3>1.5.42. What are the differences between create, drop, clear and delete Graph?</h3>
      <p>In Virtuoso it does not matter whether <strong>CREATE GRAPH</strong> and 
      <strong>DROP GRAPH</strong> are called or not. Their purpose is to provide compatibility with 
      the original SPARUL that was designed for Jena. Some Jena triple stores require explicit creation 
      of each graph (like CREATE TABLE in SQL), they report errors if one tries to create a graph twice 
      and so on.</p>
      <p>For Virtuoso, a new graph is not an important system event, it has single quad store shared 
      	by all graphs. When a graph is made by <strong>CREATE GRAPH</strong>, its name is placed in 
      	an auxiliary table that is used solely to signal appropriate errors on CREATE graph that is 
      	CREATE-d already or on DROP of a missing graph; this table is not used in any way in SPARQL or 
      	other subsystems. In a perfect world, smart development tools will query that table to give 
      	hints to a programmer regarding available graphs, but the reality is not so perfect.</p>
      <p>What&#39;s more important is a difference between 
      	<strong>DELETE FROM g { ?s ?p ?o } FROM g WHERE { ?s ?p ?o }</strong> and 
      	<strong>CLEAR GRAPH g</strong>, as both will delete all triples from the specified graph &lt;g&gt; with 
      	equal speed, but <strong>CLEAR GRAPH</strong> will also delete free-text index data about 
      	occurrences of literals in this specific graph. So <strong>CLEAR GRAPH</strong> will make 
      	the database slightly more compact and the text search slightly faster. (Naturally, 
      	<strong>DROP GRAPH</strong> makes <strong>CLEAR GRAPH</strong> inside, not just 
      	<strong>DELETE FROM ...</strong> )</p>      
     <div class="tip">
      <div class="tiptitle">See Also:</div>
       <p>
        <a href="rdfinsertmethods.html">RDF Insert Methods in Virtuoso</a>
      </p>
     </div>    
    <br />          	      
      
      <a name="srchprd" />
    <h3>1.5.43. How can I perform search for predicate values?</h3>	  
      <p>
      <strong>What?</strong>
    </p>
      <p>Creation of a stored procedure that enables users to find properties based on their string based token patterns.</p>
      <p>
      <strong>Why?</strong>
    </p>
      <p>When working with datasets from disparate datasources in a common named graph, there are times when you seek to scope sparql or spasql queries to specific property IRI/URI patterns without embarking upon inefficient regex heuristics.</p>      
      <p>
      <strong>What?</strong>
    </p>
      <p>Make a stored procedure for querying against the main quad store table (rdf_quad). Surface the procedure as a magic predicate using &quot;bif:&quot; prefix. To find all the properties whose predicates start with &quot;http://www.openlinksw.com/&quot;, a Virtuoso/PL procedure can be used as listed below:</p>
<div>
      <pre class="programlisting">
SQL&gt; create procedure PREDICATES_OF_IRI_PATH ( 
  in path varchar, 
  in dump_iri_ids integer := 0)
{
  declare PRED_IRI varchar;
  declare PRED_IRI_ID IRI_ID;
  declare path_head_len integer;
  
  if (dump_iri_ids)
    result_names (PRED_IRI_ID);
  else
    result_names (PRED_IRI);
    
  for ( SELECT RP_NAME, RP_ID 
        FROM RDF_PREFIX
        WHERE (RP_NAME &gt;= path) AND (RP_NAME &lt; path || chr(255)) ) do
    {
      declare fourbytes varchar;
      fourbytes := &#39;----&#39;;
      fourbytes[0] := bit_shift (RP_ID, -24);
      fourbytes[1] := bit_and (bit_shift (RP_ID, -16), 255);
      fourbytes[2] := bit_and (bit_shift (RP_ID, -8), 255);
      fourbytes[3] := bit_and (RP_ID, 255);
      
      for ( SELECT RI_NAME, RI_ID from RDF_IRI
            WHERE (RI_NAME &gt;= fourbytes) AND (RI_NAME &lt; fourbytes || chr(255)) ) do
        {
          if (exists (SELECT TOP 1 1 FROM RDF_QUAD WHERE P=RI_ID))
            result (case when (dump_iri_ids) then RI_ID else RP_NAME || subseq (RI_NAME, 4) end);
        }
    }
    
  for ( path_head_len := length (path)-1; path_head_len &gt;= 0; path_head_len := path_head_len - 1)
    {
      for ( SELECT RP_NAME, RP_ID from RDF_PREFIX
            WHERE RP_NAME = subseq (path, 0, path_head_len) ) do
        {
          declare fourbytes varchar;
          fourbytes := &#39;----&#39;;
          fourbytes[0] := bit_shift (RP_ID, -24);
          fourbytes[1] := bit_and (bit_shift (RP_ID, -16), 255);
          fourbytes[2] := bit_and (bit_shift (RP_ID, -8), 255);
          fourbytes[3] := bit_and (RP_ID, 255);
          
          for ( SELECT RI_NAME, RI_ID from RDF_IRI
                WHERE (RI_NAME &gt;= fourbytes || subseq (path, path_head_len))
                AND (RI_NAME &lt; fourbytes || subseq (path, path_head_len) || chr(255)) ) do
            {
              if (exists (SELECT TOP 1 1 FROM RDF_QUAD WHERE P=RI_ID))
                result (case when (dump_iri_ids) then RI_ID else RP_NAME || subseq (RI_NAME, 4) end);
            }
        }
    }
}
;


Done. -- 16 msec.	
</pre>
    </div>      
      <p>
      <strong>Example Usage</strong>
    </p>
      <ol>
      <li>Execute:
<div>
          <pre class="programlisting">
set echo on;	
</pre>
        </div>        	
        </li>
      <li>Collect all predicates that start with: 
<div>
          <pre class="programlisting">
-- http://www.openlinksw.com/
SQL&gt;PREDICATES_OF_IRI_PATH (&#39;http://www.openlinksw.com/&#39;, 1);
VARCHAR
_______________________________________________________________________________

#i351
#i159
#i10
#i8
...

-- http://www.openlinksw.com/schemas/virtrdf
SQL&gt;PREDICATES_OF_IRI_PATH (&#39;http://www.openlinksw.com/schemas/virtrdf&#39;, 1);
PRED_IRI_ID
VARCHAR
_______________________________________________________________________________

#i159
#i10
#i8
#i6
#i160
#i269
#i278
#i275


-- http://www.openlinksw.com/schemas/virtrdf#
SQL&gt;PREDICATES_OF_IRI_PATH (&#39;http://www.openlinksw.com/schemas/virtrdf#&#39;,1);
PRED_IRI_ID
VARCHAR
_______________________________________________________________________________

#i159
#i10
#i8
#i6
#i160
#i269
#i278
...

-- http://www.openlinksw.com/schemas/virtrdf#i
SQL&gt;PREDICATES_OF_IRI_PATH (&#39;http://www.openlinksw.com/schemas/virtrdf#i&#39;,1);
PRED_IRI_ID
VARCHAR
_______________________________________________________________________________

#i159
#i10
#i8

-- other
SQL&gt;PREDICATES_OF_IRI_PATH (&#39;no://such :)&#39;, 1);
0 Rows. -- 0 msec.
	
</pre>
        </div>        	
        </li>
      <li>Show all predicates that start with: 
<div>
          <pre class="programlisting">
-- http://www.openlinksw.com/
SQL&gt;PREDICATES_OF_IRI_PATH (&#39;http://www.openlinksw.com/&#39;);
PRED_IRI
VARCHAR
_______________________________________________________________________________

http://www.openlinksw.com/schemas/DAV#ownerUser
http://www.openlinksw.com/schemas/virtrdf#inheritFrom
http://www.openlinksw.com/schemas/virtrdf#isSpecialPredicate
http://www.openlinksw.com/schemas/virtrdf#item
http://www.openlinksw.com/schemas/virtrdf#loadAs
http://www.openlinksw.com/schemas/virtrdf#noInherit
http://www.openlinksw.com/schemas/virtrdf#qmGraphMap
http://www.openlinksw.com/schemas/virtrdf#qmMatchingFlags
http://www.openlinksw.com/schemas/virtrdf#qmObjectMap
http://www.openlinksw.com/schemas/virtrdf#qmPredicateMap
http://www.openlinksw.com/schemas/virtrdf#qmSubjectMap
...

-- http://www.openlinksw.com/schemas/virtrdf
SQL&gt;PREDICATES_OF_IRI_PATH (&#39;http://www.openlinksw.com/schemas/virtrdf&#39;);
PRED_IRI
VARCHAR
_______________________________________________________________________________

http://www.openlinksw.com/schemas/virtrdf#inheritFrom
http://www.openlinksw.com/schemas/virtrdf#isSpecialPredicate
http://www.openlinksw.com/schemas/virtrdf#item
http://www.openlinksw.com/schemas/virtrdf#loadAs
http://www.openlinksw.com/schemas/virtrdf#noInherit
http://www.openlinksw.com/schemas/virtrdf#qmGraphMap
http://www.openlinksw.com/schemas/virtrdf#qmMatchingFlags
http://www.openlinksw.com/schemas/virtrdf#qmObjectMap
http://www.openlinksw.com/schemas/virtrdf#qmPredicateMap
http://www.openlinksw.com/schemas/virtrdf#qmSubjectMap
http://www.openlinksw.com/schemas/virtrdf#qmTableName
...

-- http://www.openlinksw.com/schemas/virtrdf#
SQL&gt;PREDICATES_OF_IRI_PATH (&#39;http://www.openlinksw.com/schemas/virtrdf#&#39;);
PRED_IRI
VARCHAR
_______________________________________________________________________________

http://www.openlinksw.com/schemas/virtrdf#inheritFrom
http://www.openlinksw.com/schemas/virtrdf#isSpecialPredicate
http://www.openlinksw.com/schemas/virtrdf#item
http://www.openlinksw.com/schemas/virtrdf#loadAs
http://www.openlinksw.com/schemas/virtrdf#noInherit
http://www.openlinksw.com/schemas/virtrdf#qmGraphMap
http://www.openlinksw.com/schemas/virtrdf#qmMatchingFlags
http://www.openlinksw.com/schemas/virtrdf#qmObjectMap
http://www.openlinksw.com/schemas/virtrdf#qmPredicateMap
http://www.openlinksw.com/schemas/virtrdf#qmSubjectMap
http://www.openlinksw.com/schemas/virtrdf#qmTableName
http://www.openlinksw.com/schemas/virtrdf#qmf01blankOfShortTmpl
http://www.openlinksw.com/schemas/virtrdf#qmf01uriOfShortTmpl
http://www.openlinksw.com/schemas/virtrdf#qmfBoolOfShortTmpl
http://www.openlinksw.com/schemas/virtrdf#qmfBoolTmpl
...

-- http://www.openlinksw.com/schemas/virtrdf#i
SQL&gt;PREDICATES_OF_IRI_PATH (&#39;http://www.openlinksw.com/schemas/virtrdf#i&#39;);
PRED_IRI
VARCHAR
_______________________________________________________________________________

http://www.openlinksw.com/schemas/virtrdf#inheritFrom
http://www.openlinksw.com/schemas/virtrdf#isSpecialPredicate
http://www.openlinksw.com/schemas/virtrdf#item

3 Rows. -- 15 msec.

-- other
SQL&gt;PREDICATES_OF_IRI_PATH (&#39;no://such :)&#39;);
PRED_IRI
VARCHAR
_______________________________________________________________________________


0 Rows. -- 15 msec.
</pre>
        </div>        	
        </li>
    </ol>      
      <p>If you want to use the procedure&#39;s output inside SPARQL queries, it can be wrapped by a procedure view and it in turn can be used in an RDF View but it is redundant for most applications.</p>
      <p>For typical &quot;almost static&quot; data, it is more practical to write a procedure that will store all found predicates in some dedicated &quot;dictionary&quot; graph and then use the graph as usual.</p>
    <br />          	         	
      
      <a name="constrinserst" />
    <h3>1.5.44. How can I use INSERT via CONSTRUCT Statements?</h3>	  
      <p>You can write an ordinary CONSTRUCT statement, ensure that it generates the triples intended to be added, and then replace the leading CONSTRUCT keyword with the INSERT INTO phrase.</p>
      <p>
      <strong>Example:</strong>
    </p>
      <ol>
      <li>Assume new triples need to be added for the equivalentClass:
<div>
          <pre class="programlisting">
CONSTRUCT 
  {  
    ?s &lt;http://www.w3.org/2002/07/owl#equivalentClass&gt; `iri (bif:replace(?o,&#39;http://schema.rdfs.org/&#39;, &#39;http://schema.org/&#39;))`
   } 
FROM &lt;http://www.openlinksw.com/schemas/rdfs&gt; 
WHERE 
  { 
    ?s &lt;http://www.w3.org/2002/07/owl#equivalentClass&gt; ?o
  };	
</pre>
        </div>        	
        </li>
      <li>Execute the CONSTRUCT query from the htp://cname/sparql SPARQL endpoint.</li>
      <li>View the generated triples to ensure they are correct.</li>
      <li>Replace CONSTRUCT with INSERT INTO:
<div>
          <pre class="programlisting">
SPARQL INSERT INTO &lt;http://www.openlinksw.com/schemas/rdfs&gt;  
  {  
    ?s &lt;http://www.w3.org/2002/07/owl#equivalentClass&gt; `iri (bif:replace(?o,&#39;http://schema.rdfs.org/&#39;, &#39;http://schema.org/&#39;))`
   } 
FROM &lt;http://www.openlinksw.com/schemas/rdfs&gt; 
WHERE 
  { 
    ?s &lt;http://www.w3.org/2002/07/owl#equivalentClass&gt; ?o
  } ;	
</pre>
        </div>        	
        </li>
    </ol>
    <br />          	         	      
      
      <a name="cleargraphrelemtgr" />
    <h3>1.5.45. How to clear graphs which are related to empty graphs?</h3>	      
      <p>The following example demonstrates how to remove graphs which are related to empty graphs:</p>
<div>
      <pre class="programlisting">     
PREFIX nrl:&lt;http://www.semanticdesktop.org/ontologies/2007/08/15/nrl#&gt;
SELECT ( bif:exec(bif:sprintf(&quot;SPARQL CLEAR GRAPH&lt;%s&gt;&quot;, str(?mg))))
WHERE 
  {
    ?mg nrl:coreGraphMetadataFor ?g .
    FILTER(?g in ( &lt;urn:nepomuk:local:8a9e692a&gt; )) .
    FILTER ( !bif:exists((SELECT (1) WHERE { GRAPH ?g { ?s ?p ?o . } . })) ) .
  }	 
</pre>
    </div>     
    <br />   
      
      <a name="subqrbl" />
    <h3>1.5.46. How can I use sub-queries to enable literal values based joins?</h3>	            	         	            
        
        <a name="subqrblwhat" />
    <h4>1.5.46.1. What?</h4>	   
        <p>Use of subqueries to enable literal values based joins.</p>         	         	            
      <br />    
        
        <a name="subqrblwhy" />
    <h4>1.5.46.2. Why?</h4>	            	         	            
        <p>Sophisticated access to literal values via subqueries provides powerful mechanism for enhancing sparql graph patterns via dynamic literal value generation.</p>
      <br />
        
        <a name="subqrblhow" />
    <h4>1.5.46.3. How?</h4>	            	         	            
        <p>Use select list variables from subqueries to produce literal object values in sparql graph patterns.</p>        
        
        <a name="subqrblhowex" />
    <h5>1.5.46.3.1. Example</h5>	            	         	            
        <p>Assume in the following query, where should be used a sub-query to replace ?app:</p>   
<div>
      <pre class="programlisting">
SELECT DISTINCT ?r 
WHERE 
  {
    graph ?g 
      {
        ?r nie:url ?url .
      }  .
      ?g nao:maintainedBy ?app .
      ?app nao:identifier &quot;nepomukindexer&quot; .
  }	
</pre>
    </div>             
        <p>If it is not sure that ?app is the only, for e.g., the triple ?app nao:identifier &quot;nepomukindexer&quot; can appear in more than one graph, then the query should be changed to:</p>   
<div>
      <pre class="programlisting">
SELECT DISTINCT ?r 
WHERE 
  {
    graph ?g 
      {
        ?r nie:url ?url .
      }  .
      ?g nao:maintainedBy ?app .
      FILTER (?app = (SELECT ?a WHERE { ?a nao:identifier &quot;nepomukindexer&quot; }))
}	
</pre>
    </div>        
        <p>or even shorter:</p>   
<div>
      <pre class="programlisting">
SELECT DISTINCT ?r 
WHERE 
  {
   graph ?g 
     {
       ?r nie:url ?url .
     }  .
   ?g nao:maintainedBy `(SELECT ?a WHERE { ?a nao:identifier &quot;nepomukindexer&quot; })` .
 }	
</pre>
    </div>        
      <br />                   
      <br />
    <br />  
      
      <a name="sparqlpreforder" />
    <h3>1.5.47. How can I execute query with labels preference order?</h3>	      
      <p>The way to prefer one label to the other can be done as follows:</p>
      <ul>
        <li>Have a procedure which returns preference order:
<div>
          <pre class="programlisting">
create procedure lbl_order (in p any)
{    
  declare r int;
  r := vector (
  &#39;http://www.w3.org/2000/01/rdf-schema#label&#39;,
  &#39;http://xmlns.com/foaf/0.1/name&#39;,
  &#39;http://purl.org/dc/elements/1.1/title&#39;,
  &#39;http://purl.org/dc/terms/title&#39;,
  &#39;http://xmlns.com/foaf/0.1/nick&#39;,
  &#39;http://usefulinc.com/ns/doap#name&#39;,
  &#39;http://rdf.data-vocabulary.org/name&#39;,
  &#39;http://www.w3.org/2002/12/cal/ical#summary&#39;,
  &#39;http://aims.fao.org/aos/geopolitical.owl#nameListEN&#39;,
  &#39;http://s.opencalais.com/1/pred/name&#39;,
  &#39;http://www.crunchbase.com/source_description&#39;,
  &#39;http://dbpedia.org/property/name&#39;,
  &#39;http://www.geonames.org/ontology#name&#39;,
  &#39;http://purl.org/ontology/bibo/shortTitle&#39;,
  &#39;http://www.w3.org/1999/02/22-rdf-syntax-ns#value&#39;,
  &#39;http://xmlns.com/foaf/0.1/accountName&#39;,
  &#39;http://www.w3.org/2004/02/skos/core#prefLabel&#39;,
  &#39;http://rdf.freebase.com/ns/type.object.name&#39;,
  &#39;http://s.opencalais.com/1/pred/name&#39;,
  &#39;http://www.w3.org/2008/05/skos#prefLabel&#39;,
  &#39;http://www.w3.org/2002/12/cal/icaltzd#summary&#39;,
  &#39;http://rdf.data-vocabulary.org/name&#39;,
  &#39;http://rdf.freebase.com/ns/common.topic.alias&#39;,
  &#39;http://opengraphprotocol.org/schema/title&#39;,
  &#39;http://rdf.alchemyapi.com/rdf/v1/s/aapi-schema.rdf#Name&#39;,
  &#39;http://poolparty.punkt.at/demozone/ont#title&#39;
   );
  if (isiri_id (p))
    p := id_to_iri (p);   
  r := position (p, r);
  if (r = 0)
    return 100;
  return r;
}
;	
</pre>
        </div>        	
        </li>
        <li>Execute the following query:
<div>
          <pre class="programlisting">
SPARQL 
DEFINE input:inference &quot;facets&quot; 
SELECT ?o 
WHERE 
  { 
    &lt;http://uriburner.com/about/id/entity/http/www.linkedin.com/in/kidehen#CV_mfrTl4s6Jy&gt; virtrdf:label ?o ; 
       ?p ?o . 
  } 
ORDER BY (sql:lbl_order (?p));
</pre>
        </div>        	
        </li>
        <li>Or execute the following query using sql:
<div>
          <pre class="programlisting">

SELECT __ro2sq (O), lbl_order (P) 
FROM RDF_QUAD table option (with &#39;&#39;facets&#39;&#39;) 
WHERE G = __i2id (?) 
  AND S = __i2id (?) 
  AND P = __i2id (&#39;&#39;http://www.openlinksw.com/schemas/virtrdf#label&#39;&#39;, 0) 
ORDER BY 2
</pre>
        </div>        	
        </li>
      </ul>      
    <br />  
      
      <a name="getobjdtype" />
    <h3>1.5.48. How can I get object datatype?</h3>	      
      <p>To get object datatype should be used the internal Virtuoso/PL function 
      	<a href="fn_rdf_datatype_of_obj.html">DB.DBA.RDF_DATATYPE_OF_OBJ</a>, visible in SPARQL as sql:RDF_DATATYPE_OF_OBJ.
      </p>           
      <p>Suppose the following scenario:</p>	
<div>
      <pre class="programlisting">
# Explicit typecast (insert) 
SQL&gt; sparql insert into &lt;test_datatype&gt; { &lt;a&gt; &lt;string&gt; &quot;string 1&quot;^^xsd:string . };
callret-0
VARCHAR
_______________________________________________________________________________

Insert into &lt;test_datatype&gt;, 1 (or less) triples -- done

1 Rows. -- 94 msec.


#Not explicit typecast (insert)
SQL&gt; sparql insert into &lt;test_datatype&gt; { &lt;a&gt; &lt;string&gt; &quot;string 2&quot;. };
callret-0
VARCHAR
_______________________________________________________________________________

Insert into &lt;test_datatype&gt;, 1 (or less) triples -- done

1 Rows. -- 16 msec.

SQL&gt; SPARQL 
SELECT ?o (iri(sql:RDF_DATATYPE_OF_OBJ(?o, &#39;untyped!&#39;))) 
FROM &lt;test_datatype&gt; { &lt;a&gt; &lt;string&gt; ?o} ;
o                       callret-1
VARCHAR                 VARCHAR
_______________________________________________________________________________

string 1                http://www.w3.org/2001/XMLSchema#string 
string 2                untyped!

2 Rows. -- 16 msec.
SQL&gt;	
</pre>
    </div>      
    <br />        
      
        <a name="howbackuprestoreind" />
    <h3>1.5.49. How Can I Backup and Restore individual table(s) and individual index(s)?</h3>	   
        <p>See more details <a href="databaseadmsrv.html#procindexrecov">here</a>.</p>
    <br /> 
      
      <a name="bifcontainsoptions" />
    <h3>1.5.50. What bif:contains free-text options can I use?</h3>	   
      <p>Virtuoso supports the following free-text options for bif:contains:</p>
      <ol>
      <li>
        <strong>OFFBAND</strong>: See description for this free-text option in 
        <a href="creatingtxtidxs.html#offbanddata">this section</a>.           
          <ul>
            <li>Note: it is useful only if data comers via an RDF View and the source 
            	relational table uses this trick;</li>
          </ul>          
        </li>
      <li>
        <strong>SCORE</strong>: This free-text option is calculated as described in 
        <a href="creatingtxtidxs.html#hitscores">this section</a>:
<div>
          <pre class="programlisting">
SQL&gt;SPARQL 
SELECT ?s1 as ?c1, ?sc, ?rank 
WHERE 
  {
    {
      { 
        SELECT ?s1, (?sc * 3e-1) as ?sc, ?o1, 
          (sql:rnk_scale (&lt;LONG::IRI_RANK&gt; (?s1))) as ?rank  
        WHERE 
          { 
            ?s1 ?s1textp ?o1 . 
            ?o1 bif:contains  &#39;&quot;CNET&quot;&#39;  option (score ?sc)  . 
          } 
        ORDER BY DESC (?sc * 3e-1 + sql:rnk_scale (&lt;LONG::IRI_RANK&gt; (?s1)))  
        LIMIT 20  
        OFFSET 0 
      }
    }
  };

c1                                              sc      rank
_________________________________________________________________________
http://www.mixx.com/stories/45003360/justi...   3 	    5.881291583872891e-14
http://www.mixx.com/stories/45099313/bing_...   2.7     5.881291583872891e-14
http://dbpedia.org/resource/CBS_Interactive 	  1.5 	  5.881291583872891e-14
http://dbpedia.org/resource/CBS_Interactive 	  1.5 	  5.881291583872891e-14


4 Rows. -- 1 msec.
</pre>
        </div>
      </li>
      <li>
        <strong>SCORE_LIMIT</strong>: This free-text option works as it is in plain 
      SQL free-text. <a href="queryingftcols.html">See more details</a> :
<div>
          <pre class="programlisting">
SQL&gt; SPARQL 
SELECT ?s ?sc 
WHERE 
  { 
    ?s ?p ?o . 
    ?o bif:contains &quot;tree&quot; OPTION (score ?sc , score_limit 20)
  };
  
s                                                                      sc
VARCHAR                                                                INTEGER
________________________________________________________________________________   

                                                                      
http://www.openlinksw.com/virtrdf-data-formats#default                 24
http://www.openlinksw.com/virtrdf-data-formats#default                 24
http://www.openlinksw.com/virtrdf-data-formats#sql-longvarbinary       21
http://www.openlinksw.com/virtrdf-data-formats#sql-varchar-dt          20
http://www.openlinksw.com/virtrdf-data-formats#sql-nvarchar-dt         20
http://www.openlinksw.com/virtrdf-data-formats#sql-varchar-lang        20
http://www.openlinksw.com/virtrdf-data-formats#sql-nvarchar-lang       20

7 Rows. -- 2 msec.
</pre>
        </div>          
        </li>
    </ol>
    <br />              
      
      <a name="sparqlendpointprotection" />
    <h3>1.5.51. What SPARQL Endpoint Protection Methods can I use?</h3>	   
      <p>Virtuoso supports the following SPARQL Endpoint protection methods:</p>
      <ol>
    <li>
        <a href="http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtAuthPolicyFOAFSSL">Secure SPARQL Endpoint Guide using WebID Protocol</a>
    </li>
    <li>
        <a href="http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtOAuthSPARQL">Secure SPARQL Endpoint Guide via OAuth</a>
    </li>
    <li>
        <a href="http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtSPARQLProtectSQLDigestAuthentication">Secure SPARQL Endpoint Guide via SQL Accounts -- usage path digest authentication</a>
    </li>
    </ol>
    <br />   
        
    	<a name="sparqlassignrole" />
    <h3>1.5.52. How do I assign SPARQL role to SQL user?</h3>	   
    	<p>This section a sample scenario how to assign SPARQL ( for ex. SPARQL_SELECT ) role to 
    		Virtuoso SQL user:</p>
      <ol>
      <li>Go to <a href="http://cname/conductor">http://cname/conductor</a>.</li>
      <li>Enter dba credentials.</li>
      <li>Go to System Admin -&gt; User Accounts: 
          <table class="figure" border="0" cellpadding="0" cellspacing="0">
      <tr>
       <td>
              <img alt="Assign SPARQL Role to SQL User" src="../images/ui/ag1.png" />
       </td>
      </tr>
      <tr>
            <td>Figure: 1.5.52.1. Assign SPARQL Role to SQL User</td>
      </tr>
        </table>
        </li>
      <li>Click &quot;Edit&quot; for a given user from the very last right column:
          <table class="figure" border="0" cellpadding="0" cellspacing="0">
      <tr>
       <td>
              <img alt="Assign SPARQL Role to SQL User" src="../images/ui/ag2.png" />
       </td>
      </tr>
      <tr>
            <td>Figure: 1.5.52.1. Assign SPARQL Role to SQL User</td>
      </tr>
        </table>
        </li>
      <li>From &quot;Accounts Roles&quot; drop-down list select a SPARQL Role, for ex. 
        	<strong>SPARQL_SELECT</strong> and click the &quot;&gt;&gt;&quot; button:
          <table class="figure" border="0" cellpadding="0" cellspacing="0">
      <tr>
       <td>
              <img alt="Assign SPARQL Role to SQL User" src="../images/ui/ag3.png" />
       </td>
      </tr>
      <tr>
            <td>Figure: 1.5.52.1. Assign SPARQL Role to SQL User</td>
      </tr>
        </table>
        </li>
      <li>Click &quot;Save&quot;. </li>
    </ol>    	                   
    <br />   
  <table border="0" width="90%" id="navbarbottom">
    <tr>
        <td align="left" width="33%">
          <a href="virtuosofaq.html" title="Virtuoso 6 FAQ">Previous</a>
          <br />Virtuoso 6 FAQ</td>
     <td align="center" width="34%">
          <a href="overview.html">Chapter Contents</a>
     </td>
        <td align="right" width="33%">
          <a href="installation.html" title="Installation Guide">Next</a>
          <br />Contents of Installation Guide</td>
    </tr>
    </table>
  </div>
  <div id="footer">
    <div>Copyright© 1999 - 2009 OpenLink Software All rights reserved.</div>
   <div id="validation">
    <a href="http://validator.w3.org/check/referer">
        <img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" />
    </a>
    <a href="http://jigsaw.w3.org/css-validator/">
        <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88" />
    </a>
   </div>
  </div>
 </body>
</html>