Sophie

Sophie

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

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="Function: DB.DBA.TTLP - Virtuoso Functions Guide" />
  <meta name="dc.subject" content="Function: DB.DBA.TTLP - Virtuoso Functions Guide" />
  <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="functions.html" title="Chapter Contents" />
  <link rel="prev" href="appendixa.html" title="Appendix" />
  <link rel="next" href="functions.html#.html" title="" />
  <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>Function: DB.DBA.TTLP - Virtuoso Functions Guide</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="fn_ttlp" />
    <img src="../images/misc/logo.jpg" alt="" />
    <h1>22. Virtuoso Functions Guide - DB.DBA.TTLP</h1>
  </div>
  <div id="navbartop">
   <div>
      <a class="link" href="functions.html">Chapter Contents</a> | <a class="link" href="fn_ld_dir.html" title="ld_dir">Prev</a> | <a class="link" href="fn_ttlp_mt.html" title="DB.DBA.TTLP_MT">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>
      <a class="selected" href="functions.html">Virtuoso Functions Guide</a>
   </div>
    <br />
   <div>
      <a href="functions.html#admin">Administration</a>
   </div>
   <div>
      <a href="functions.html#aggr">Aggregate Functions</a>
   </div>
   <div>
      <a href="functions.html#array">Array Manipulation</a>
   </div>
   <div>
      <a href="functions.html#bpel">BPEL APIs</a>
   </div>
   <div>
      <a href="functions.html#backup">Backup</a>
   </div>
   <div>
      <a href="functions.html#compression">Compression</a>
   </div>
   <div>
      <a href="functions.html#cursors">Cursor</a>
   </div>
   <div>
      <a href="functions.html#time">Date &amp; Time Manipulation</a>
   </div>
   <div>
      <a href="functions.html#debug">Debug</a>
   </div>
   <div>
      <a href="functions.html#dict">Dictionary Manipulation</a>
   </div>
   <div>
      <a href="functions.html#encoding">Encoding &amp; Decoding</a>
   </div>
   <div>
      <a href="functions.html#file">File Manipulation</a>
   </div>
   <div>
      <a href="functions.html#ft">Free Text</a>
   </div>
   <div>
      <a href="functions.html#hash">Hashing / Cryptographic</a>
   </div>
   <div>
      <a href="functions.html#ldap">LDAP</a>
   </div>
   <div>
      <a href="functions.html#localization">Locale</a>
   </div>
   <div>
      <a href="functions.html#mail">Mail</a>
   </div>
   <div>
      <a href="functions.html#misc">Miscellaneous</a>
   </div>
   <div>
      <a href="functions.html#number">Number</a>
   </div>
   <div>
      <a href="functions.html#phrz">Phrases</a>
   </div>
   <div>
      <a class="selected" href="functions.html#rdf">RDF data</a>
   </div>
   <div class="selected">
    <div>
        <a href="fn_rdf_64bit_upgrade.html">db.dba.rdf_64bit_upg...</a>
    </div>
    <div>
        <a href="fn_rdf_audit_metadata.html">db.dba.rdf_audit_met...</a>
    </div>
    <div>
        <a href="fn_rdf_backup_metadata.html">db.dba.rdf_backup_me...</a>
    </div>
    <div>
        <a href="fn_rdf_convert_rdfxml_to_ttl.html">db.dba.rdf_convert_r...</a>
    </div>
    <div>
        <a href="fn_rdf_datatype_of_obj.html">db.dba.rdf_datatype_...</a>
    </div>
    <div>
        <a href="fn_rdf_graph_collect_fp_list.html">db.dba.rdf_graph_col...</a>
    </div>
    <div>
        <a href="fn_rdf_graph_diff.html">db.dba.rdf_graph_dif...</a>
    </div>
    <div>
        <a href="fn_rdf_graph_group_create.html">db.dba.rdf_graph_gro...</a>
    </div>
    <div>
        <a href="fn_rdf_graph_group_ins.html">db.dba.rdf_graph_gro...</a>
    </div>
    <div>
        <a href="fn_rdf_langmatches.html">db.dba.rdf_langmatch...</a>
    </div>
    <div>
        <a href="fn_rdf_load_rdfa.html">db.dba.rdf_load_rdfa</a>
    </div>
    <div>
        <a href="fn_rdf_load_rdfxml.html">db.dba.rdf_load_rdfx...</a>
    </div>
    <div>
        <a href="fn_rdf_load_rdfxml_mt.html">db.dba.rdf_load_rdfx...</a>
    </div>
    <div>
        <a href="fn_rdf_quad_uri.html">db.dba.rdf_quad_uri</a>
    </div>
    <div>
        <a href="fn_rdf_quad_uri_l.html">db.dba.rdf_quad_uri_...</a>
    </div>
    <div>
        <a href="fn_rdf_quad_uri_l_typed.html">db.dba.rdf_quad_uri_...</a>
    </div>
    <div>
        <a href="fn_rdf_regex.html">db.dba.rdf_regex</a>
    </div>
    <div>
        <a href="fn_rdf_restore_metadata.html">db.dba.rdf_restore_m...</a>
    </div>
    <div>
        <a href="fn_rdf_suo_apply_patch.html">db.dba.rdf_suo_apply...</a>
    </div>
    <div>
        <a href="fn_rdf_suo_diff_ttl.html">db.dba.rdf_suo_diff_...</a>
    </div>
    <div>
        <a href="fn_rdf_triples_to_rdf_xml_text.html">db.dba.rdf_triples_t...</a>
    </div>
    <div>
        <a href="fn_rdf_triples_to_ttl.html">db.dba.rdf_triples_t...</a>
    </div>
    <div>
        <a href="fn_rdf_ttl2hash.html">db.dba.rdf_ttl2hash</a>
    </div>
    <div>
        <a href="fn_rdf_void_store.html">db.dba.rdf_void_stor...</a>
    </div>
    <div>
        <a href="fn_sparql_eval.html">db.dba.sparql_eval</a>
    </div>
    <div>
        <a href="fn_sparql_eval_to_array.html">db.dba.sparql_eval_t...</a>
    </div>
    <div>
        <a href="fn_sparql_rdb2rdf_codegen.html">db.dba.sparql_rdb2rd...</a>
    </div>
    <div>
        <a href="fn_sparql_rdb2rdf_list_tables.html">db.dba.sparql_rdb2rd...</a>
    </div>
    <div>
        <a href="fn_sparql_rexec.html">db.dba.sparql_rexec</a>
    </div>
    <div>
        <a href="fn_sparql_rexec_to_array.html">db.dba.sparql_rexec_...</a>
    </div>
    <div>
        <a href="fn_sparql_rexec_with_meta.html">db.dba.sparql_rexec_...</a>
    </div>
    <div>
        <a href="fn_sparql_select_known_graphs.html">db.dba.sparql_select...</a>
    </div>
    <div>
        <a class="selected" href="fn_ttlp.html">db.dba.ttlp</a>
    </div>
    <div>
        <a href="fn_ttlp_mt.html">db.dba.ttlp_mt</a>
    </div>
    <div>
        <a href="fn_ttlp_mt_local_file.html">db.dba.ttlp_mt_local...</a>
    </div>
    <div>
        <a href="fn_GROUP_CONCAT.html">group_concat</a>
    </div>
    <div>
        <a href="fn_isref.html">isref</a>
    </div>
    <div>
        <a href="fn_sample.html">sample</a>
    </div>
    <div>
        <a href="fn___xml_get_ns_prefix.html">__xml_get_ns_prefix</a>
    </div>
    <div>
        <a href="fn___xml_get_ns_uri.html">__xml_get_ns_uri</a>
    </div>
    <div>
        <a href="fn_http_nt_triple.html">http_nt_triple</a>
    </div>
    <div>
        <a href="fn_http_ttl_triple.html">http_ttl_triple</a>
    </div>
    <div>
        <a href="fn_iri_split.html">iri_split</a>
    </div>
    <div>
        <a href="fn_ld_dir.html">ld_dir</a>
    </div>
    <div>
        <a href="fn_rdfs_rule_set.html">rdfs_rule_set</a>
    </div>
    <div>
        <a href="fn_sparql_to_sql_text.html">sparql_to_sql_text</a>
    </div>
   </div>
   <div>
      <a href="functions.html#rmt">Remote SQL Data Source</a>
   </div>
   <div>
      <a href="functions.html#repl">Replication</a>
   </div>
   <div>
      <a href="functions.html#soap">SOAP</a>
   </div>
   <div>
      <a href="functions.html#sql">SQL</a>
   </div>
   <div>
      <a href="functions.html#string">String</a>
   </div>
   <div>
      <a href="functions.html#txn">Transaction</a>
   </div>
   <div>
      <a href="functions.html#type">Type Mapping</a>
   </div>
   <div>
      <a href="functions.html#uddi">UDDI</a>
   </div>
   <div>
      <a href="functions.html#udt">User Defined Types &amp; The CLR</a>
   </div>
   <div>
      <a href="functions.html#vad">VAD</a>
   </div>
   <div>
      <a href="functions.html#jvmpl">Virtuoso Java PL API</a>
   </div>
   <div>
      <a href="functions.html#bif">Virtuoso Server Extension Interface (VSEI)</a>
   </div>
   <div>
      <a href="functions.html#ws">Web &amp; Internet</a>
   </div>
   <div>
      <a href="functions.html#xml">XML</a>
   </div>
   <div>
      <a href="functions.html#XPATH">XPATH &amp; XQUERY</a>
   </div>
    <br />
   <div>
      <a href="functionidx.html">Functions Index</a>
   </div>
    <br />
  </div>
  <div id="text">
    <h2>DB.DBA.TTLP</h2>
    <div class="refpurpose">parses TTL (TURTLE or N3 resource) and places its triples into DB.DBA.RDF_QUAD.</div>
    <div class="funcsynopsis">
        <span class="funcdef">
     <span class="function">DB.DBA.TTLP</span>
     </span>
	(<span class="paramdef">in <span class="parameter">strg</span> any</span>, 
	<span class="paramdef">in <span class="parameter">base</span> varchar</span>, 
	<span class="paramdef">in <span class="parameter">graph</span> varchar</span>, 
        <span class="paramdef">in <span class="parameter">flags </span> integer</span>);
      </div>
  
  
  
  <div class="refsect1">
    <div class="refsect1title">Description</div>
    <p>Parses TTL (TURTLE or N3 resource) and places its triples into DB.DBA.RDF_QUAD.</p>
  </div>
  <div class="refsect1">
    <div class="refsect1title">Parameters</div>
    <div class="refsect2">
        <span class="refsect2title">strg – </span>
      text of the resource
    </div>
    <div class="refsect2">
        <span class="refsect2title">base – </span>
      base IRI to resolve relative IRIs to absolute
    </div>
    <div class="refsect2">
        <span class="refsect2title">graph – </span>
      target graph IRI, parsed triples will appear in that graph.
    </div>
    <div class="refsect2">
        <span class="refsect2title">flags – </span>
      bitmask of parsing flags. Permits some sorts of syntax errors in resource.
Default is 0, meaning no permitted deviations from the spec. Other supported bits are:
<div>
          <pre class="programlisting">
  1 - Single quoted and double quoted strings may with newlines.
  2 - Allows bnode predicates (but SPARQL processor may ignore them!).
  4 - Allows variables, but triples with variables are ignored.
  8 - Allows literal subjects, but triples with them are ignored.
 16 - Allows &#39;/&#39;, &#39;#&#39;, &#39;%&#39; and &#39;+&#39; in local part of QName (&quot;Qname with path&quot;)
 32 - Allows invalid symbols between &#39;&lt;&#39; and &#39;&gt;&#39;, i.e. in relative IRIs.
 64 - Relax TURTLE syntax to include popular violations.
128 - Try to recover from lexical errors as much as it is possible.
256 - Allows TriG syntax, thus loading data in more than one graph.
512 - Allows loading N-quad dataset files with and optional context value to indicate provenance as detailed
&lt;ulink url=&quot;http://sw.deri.org/2008/07/n-quads/&quot;&gt;here&lt;/ulink&gt;.
</pre>
        </div>
    </div>
  </div>
  <div class="refsect1">
      <div class="refsect1title">Return Types</div>
    <p>The return value is not specified and may be changed in future versions.</p>
  </div>

  <div class="refsect1">
    <div class="refsect1title">Examples</div>
    <a name="ex_ttlp" />
      <div class="example">
        <div class="exampletitle" />
      <p>For loading a file of any greater length, it is most practical to use the file_to_string_output
function.</p>
      <p>It is important the file to be accessible for the Virtuoso server. You need to have set properly
the DirsAllowed parameter value in section [Parameters] of the Virtuoso database INI file. For example on
Windows it could be:</p>
<div>
          <pre class="screen">
virtuoso.ini file:
[Parameters]
...
DirsAllowed =  .\tmp
...
</pre>
        </div>
      <p>So in the example the file you want to import from, should be in the tmp folder or in its
subfolder. Note that this example folder is a subfolder of the Virtuoso Server working directory.</p>
<p>
          <strong>Sample Example 1</strong>
        </p>
<div>
          <pre class="screen">
SQL&gt; ttlp (file_to_string_output (&#39;.\tmp\data.ttl&#39;), &#39;&#39;, &#39;http://my_graph&#39;, 0);
</pre>
        </div>
    <p>Forth item in record of NQuad format is optional. If present then it is used as a graph.
If missed then the default graph is used. The purpose is to make SPARQL dataset serialization possible in
a &quot;natural&quot; way: the content of default graph is written without any graph name specified whereas the
content of named graphs is written with fouth field in place. Similarly, TriG uses default graph for
triples outside graph blocks. In all these cases, base IRI is used to resolve all relative IRIs of
the document, no matter what is the destination graph. Here is a simple example:</p>
<p>
          <strong>Sample Example 2</strong>
        </p>
    <p>Suppose we have the simple nquad.nq file:</p>
<div>
          <pre class="programlisting">
&lt;http://www.w3.org/2002/01/tr-automation/tr.rdf&gt; &lt;http://purl.org/dc/elements/1.1/title&gt; &quot;W3C Standards and Technical Reports&quot; &lt;http://www.w3.org/People/Berners-Lee/card&gt; .
&lt;http://www.w3.org/People/Berners-Lee/card&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/PersonalProfileDocument&gt; &lt;http://www.w3.org/People/Berners-Lee/card&gt; .
&lt;http://www.w3.org/People/Berners-Lee/card&gt; &lt;http://creativecommons.org/ns#license&gt; &lt;http://creativecommons.org/licenses/by-nc/3.0/&gt; &lt;http://www.w3.org/People/Berners-Lee/card&gt; .
&lt;http://www.w3.org/People/Berners-Lee/card&gt; &lt;http://purl.org/dc/elements/1.1/title&gt; &quot;Tim Berners-Lee&#39;s FOAF file&quot; &lt;http://www.w3.org/People/Berners-Lee/card&gt; .
&lt;http://www.w3.org/People/Berners-Lee/card&gt; &lt;http://xmlns.com/foaf/0.1/maker&gt; &lt;http://www.w3.org/People/Berners-Lee/card#i&gt; &lt;http://www.w3.org/People/Berners-Lee/card&gt; .
&lt;http://www.w3.org/People/Berners-Lee/card&gt; &lt;http://xmlns.com/foaf/0.1/primaryTopic&gt; &lt;http://www.w3.org/People/Berners-Lee/card#i&gt; &lt;http://www.w3.org/People/Berners-Lee/card&gt; .
&lt;http://www.w3.org/People/Berners-Lee/card#cm&gt; &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#type&gt; &lt;http://xmlns.com/foaf/0.1/Person&gt; &lt;http://www.w3.org/People/Berners-Lee/card&gt; .
&lt;http://www.w3.org/People/Berners-Lee/card#cm&gt; &lt;http://www.w3.org/2000/01/rdf-schema#seeAlso&gt; &lt;http://www.koalie.net/foaf.rdf&gt; &lt;http://www.w3.org/People/Berners-Lee/card&gt; .
&lt;http://www.w3.org/People/Berners-Lee/card#cm&gt; &lt;http://xmlns.com/foaf/0.1/mbox&gt; &lt;mailto:coralie@w3.org&gt; &lt;http://www.w3.org/People/Berners-Lee/card&gt; .
&lt;http://www.w3.org/People/Berners-Lee/card#cm&gt; &lt;http://xmlns.com/foaf/0.1/name&gt; &quot;Coralie Mercier&quot; &lt;http://www.w3.org/People/Berners-Lee/card&gt; .
</pre>
        </div>
    <p>Load the file:</p>
<div>
          <pre class="programlisting">
SQL&gt;DB.DBA.TTLP (file_to_string_output (&#39;./nquad.nq&#39;), &#39;&#39;, &#39;http://localhost:8890/DAV/test&#39;, 512);
Done. -- 48 msec.
</pre>
        </div>
    <p>Select all triples from the graph with URI the fourth provenance URI from the NQuad file i.e.: &lt;http://www.w3.org/People/Berners-Lee/card&gt;:</p>
<div>
          <pre class="programlisting">
 SQL&gt; sparql select * from &lt;http://www.w3.org/People/Berners-Lee/card&gt; where {?s ?p ?o};
 s                                               p                                                  o
 VARCHAR                                         VARCHAR                                            VARCHAR
 ________________________________________________

 http://www.w3.org/2002/01/tr-automation/tr.rdf  http://purl.org/dc/elements/1.1/title              W3C Standards and Technical Reports
 http://www.w3.org/People/Berners-Lee/card       http://www.w3.org/1999/02/22-rdf-syntax-ns#type    http://xmlns.com/foaf/0.1/PersonalProfileDocument
 http://www.w3.org/People/Berners-Lee/card       http://xmlns.com/foaf/0.1/primaryTopic             http://www.w3.org/People/Berners-Lee/card#i
 http://www.w3.org/People/Berners-Lee/card       http://purl.org/dc/elements/1.1/title              Tim Berners-Lee&#39;s FOAF file
 http://www.w3.org/People/Berners-Lee/card       http://xmlns.com/foaf/0.1/maker                    http://www.w3.org/People/Berners-Lee/card#i
 http://www.w3.org/People/Berners-Lee/card       http://creativecommons.org/ns#license              http://creativecommons.org/licenses/by-nc/3.0/
 http://www.w3.org/People/Berners-Lee/card#cm    http://www.w3.org/1999/02/22-rdf-syntax-ns#type    http://xmlns.com/foaf/0.1/Person
 http://www.w3.org/People/Berners-Lee/card#cm    http://xmlns.com/foaf/0.1/mbox                     mailto:coralie@w3.org
 http://www.w3.org/People/Berners-Lee/card#cm    http://xmlns.com/foaf/0.1/name                     Coralie Mercier
 http://www.w3.org/People/Berners-Lee/card#cm    http://www.w3.org/2000/01/rdf-schema#seeAlso       http://www.koalie.net/foaf.rdf

 10 Rows. -- 7 msec.
</pre>
        </div>
    </div>
  </div>
  <div class="refsect1">
    <div class="refsect1title">See Also</div>
    <p>
        <a href="fn_rdf_audit_metadata.html">DB.DBA.RDF_AUDIT_METADATA</a>
      </p>
    <p>
        <a href="fn_rdf_backup_metadata.html">DB.DBA.RDF_BACKUP_METADATA</a>
      </p>
    <p>
        <a href="fn_rdf_load_rdfxml.html">DB.DBA.RDF_LOAD_RDFXML</a>
      </p>
    <p>
        <a href="fn_rdf_load_rdfxml_mt.html">DB.DBA.RDF_LOAD_RDFXML_MT</a>
      </p>
    <p>
        <a href="fn_ttlp_mt.html">DB.DBA.TTLP_MT</a>
      </p>
    <p>
        <a href="fn_ttlp_mt_local_file.html">DB.DBA.TTLP_MT_LOCAL_FILE</a>
      </p>
  </div>
</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>