<docbook><section><title>VirtURIShortener</title><title> Shortening URIs with Virtuoso</title> Shortening URIs with Virtuoso
<para>Long URLs are hard for humans to type or remember, and don&#39;t work very well with short message services like <ulink url="http://twitter.com/OpenLink">Twitter</ulink> or <ulink url="http://identi.ca/kidehen">identi.ca</ulink>.</para>
 <para><emphasis>CURIs</emphasis> are compressed URIs which redirect to the original long URL.
 They are easier to share, type, and use in general.</para>
<para>The Virtuoso URI Shortener offers a way to do this in your own domain and data space, without reliance on external services such as <ulink url="http://bit.ly/">bit.ly</ulink>, <ulink url="http://is.gd/">is.gd</ulink>, or <ulink url="http://tinyurl.com/">tinyurl.com</ulink>.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2">How does it work?</bridgehead>
<para>All full-length URIs are stored in a Virtuoso database table which keeps a unique ID number for each URI.
 This ID is converted to base32 encoding, which only uses uppercase letters and numbers from 2 to 7, for use in the CURI.</para>
<emphasis><emphasis>Note</emphasis>: numbers 1 and 0 are not used in this encoding, eliminating the common visual confusion between uppercase o and number 0, and between uppercase i, lowercase L, and number 1.</emphasis><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Configuration Options</bridgehead>
<para>The prefix for loading images, CSS, etc., can be set through the Virtuoso INI file option, CURIUISkinPrefix.</para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2">Package Installation and Accessibility</bridgehead>
<orderedlist spacing="compact"><listitem>Download the <ulink url="https://virtuoso.openlinksw.com/download/">Virtuoso URI Shortener VAD</ulink> package.
</listitem>
<listitem>Install the package through the Virtuoso Conductor from the System Admin -&gt; Packages tab or using the isql command line program as shown below: <programlisting>SQL&gt; DB.DBA.VAD_INSTALL(&#39;tmp/c_uri_dav.vad&#39;,0);
VARCHAR  VARCHAR
_______________________________________________________________________________

00000    No errors detected
00000    Installation of &quot;OpenLink Virtuoso URI Shortener&quot; is complete.
00000    Now making a final checkpoint.
00000    Final checkpoint is made.
00000    SUCCESS


6 Rows. -- 1766 msec.
</programlisting></listitem>
<listitem>Go to Endpoint  - http://&lt;cname&gt;/c <itemizedlist mark="bullet" spacing="compact"><listitem>Note: you could also use the page:http://&lt;cname&gt;[:&lt;port&gt;]/c/create.vsp?uri=xx </listitem>
</itemizedlist></listitem>
<listitem>Paste in long URL.</listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2">Example</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem>Load your service, e.g., http://&lt;cname&gt;/c in your browser.
<figure><graphic fileref="VirtURIShortener/c1.png" /></figure> </listitem>
<listitem>Enter a URI, e.g., <programlisting>http://lod.openlinksw.com/sparql?default-graph-uri=&amp;should-sponge=&amp;query=SELECT+%3Fx%0D%0AWHERE%0D%0A++{%0D%0A++++%3Fx++foaf%3Aname++%22Alice%22++.%0D%0A++++FILTER%0D%0A++++++%28%0D%0A++++++++bif%3Aexists%0D%0A++++++++++%28+%28%0D%0A+++++++++++++SELECT+*%0D%0A+++++++++++++WHERE%0D%0A+++++++++++++++{%0D%0A+++++++++++++++++%3Fx++foaf%3Aknows++%3Fy++++++.%0D%0A+++++++++++++++++%3Fy++foaf%3Aname+++%22John%22%0D%0A+++++++++++++++}%0D%0A++++++++++%29+%29%0D%0A++++++%29%0D%0A++}&amp;format=text%2Fhtml&amp;debug=on&amp;timeout=
</programlisting><figure><graphic fileref="VirtURIShortener/c2.png" /></figure> </listitem>
<listitem>Click <emphasis>Make CURI</emphasis>.
</listitem>
<listitem>A new CURI will be created and displayed, e.g., <programlisting>http://&lt;cname&gt;/c/7EFF
</programlisting><figure><graphic fileref="VirtURIShortener/c3.png" /></figure></listitem>
</itemizedlist></section></docbook>