<docbook><section><title>VirtSPARQLSSL</title><title> Managing a WebID-based SPARQL Endpoint</title> Managing a <ulink url="WebID">WebID</ulink>-based SPARQL Endpoint
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Introduction</bridgehead>
<para>The following guide describes the basic steps for setting up an SSL protected and <ulink url="WebID">WebID</ulink> based SPARQL Endpoint (SPARQL-<ulink url="WebID">WebID</ulink>).
 The guide also covers the use of Virtuoso PL functions and the Virtuoso Conductor for SPARQL endpoint creation and configuration.
 It also covers the use of cURL for exercising the newly generated SPARQL-<ulink url="WebID">WebID</ulink> endpoint.</para>
<para> <emphasis>Note: SPARQL-SSL is alias of SPARQL-<ulink url="WebID">WebID</ulink></emphasis></para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Create a <ulink url="WebID">WebID</ulink>-based SPARQL Endpoint</bridgehead>
<orderedlist spacing="compact"><listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSPkiSetup">Setup the CA issuer and https listener</ulink> </listitem>
<listitem>Create the SPARQL-<ulink url="WebID">WebID</ulink> endpoint: <orderedlist spacing="compact"><listitem>By installing the <ulink url="https://virtuoso.openlinksw.com/download/">policy_manager_dav.vad</ulink> package, which will create the SPARQL-<ulink url="WebID">WebID</ulink> endpoint, or: </listitem>
<listitem>Manually: Define the /sparql-webid endpoint on an HTTPS based listener (HTTPS service endpoint), for example using Virtuoso PL: <programlisting>DB.DBA.VHOST_DEFINE (
	 lhost=&gt;&#39;127.0.0.1:443&#39;,
	 vhost=&gt;&#39;localhost&#39;,
	 lpath=&gt;&#39;/sparql-webid&#39;,
	 ppath=&gt;&#39;/!sparql/&#39;,
	 is_dav=&gt;1,
	 auth_fn=&gt;&#39;DB.DBA.FOAF_SSL_AUTH&#39;,
	 vsp_user=&gt;&#39;dba&#39;,
	 ses_vars=&gt;0,
	 auth_opts=&gt;vector (&#39;https_cert&#39;, &#39;db:https_key_localhost&#39;, &#39;https_key&#39;, &#39;db:https_key_localhost&#39;, &#39;https_verify&#39;, 3, &#39;https_cv_depth&#39;, 10),
	 opts=&gt;vector (&#39;noinherit&#39;, 1),
	 is_default_host=&gt;0
);
</programlisting></listitem>
</orderedlist></listitem>
<listitem><ulink url="VirtAuthServerUI">Setup the SPARQL-WebID endpoint and define ACLs</ulink> using the Virtuoso Conductor </listitem>
<listitem>Export your private key and its associated <ulink url="WebID">WebID</ulink> based X.509 certificate from your Firefox browser or System&#39;s Key Manager into PEM (PKCS12) file <orderedlist spacing="compact"><listitem>If using Firefox use the menu path: Advanced-&gt;View Certificates, then  click Backup for your certificate with name &quot;mykey&quot;.
</listitem>
<listitem>The file &quot;mykey.p12&quot; will be created.
 To disable password protection so that you can use this file in non-interactive mode (e.g.
 with cURL and other HTTP clients) execute: <programlisting>openssl pkcs12 -in mykey.p12 -out mykey.pem -nodes 
</programlisting></listitem>
</orderedlist></listitem>
<listitem><ulink url="VirtWebIDCurlExample1">Test the SPARQL-WebID endpoint with cURL</ulink> (listening on default HTTPS 443 port): <itemizedlist mark="bullet" spacing="compact"><listitem>Note: In this example we use the &quot;-k / --insecure&quot; option with cURL since we are going to be using self-signed X.509 certificates signed by self-signed root CA.
</listitem>
</itemizedlist></listitem>
<listitem>Import your key it via Conductor UI: <orderedlist spacing="compact"><listitem>Go to Conductor -&gt; System Admin-&gt;User Accounts <figure><graphic fileref="VirtSPARQLSSL/c1.png" /></figure> </listitem>
<listitem>Click &quot;Edit&quot; for your user <figure><graphic fileref="VirtSPARQLSSL/c2.png" /></figure> </listitem>
<listitem>Change &quot;User type&quot; to: SQL/ODBC and <ulink url="WebDAV">WebDAV</ulink> <figure><graphic fileref="VirtSPARQLSSL/c3.png" /></figure> </listitem>
<listitem>Enter your ODS user <ulink url="WebID">WebID</ulink>: <programlisting>http://cname:port/dataspace/person/username#this
</programlisting><figure><graphic fileref="VirtSPARQLSSL/c4.png" /></figure> </listitem>
<listitem>Click &quot;Save&quot; </listitem>
<listitem>Click again &quot;Edit&quot; for your user </listitem>
<listitem>In &quot;PKCS12 file:&quot; click the Browse&quot; button and select your key.
</listitem>
<listitem>Enter a local Key Name, for e.g., &quot;cli_key&quot; </listitem>
<listitem>Enter key password <figure><graphic fileref="VirtSPARQLSSL/c5.png" /></figure> </listitem>
<listitem>Click &quot;Import Key&quot; </listitem>
<listitem>As result the key will be stored with name for ex.
 cli_key <figure><graphic fileref="VirtSPARQLSSL/c6.png" /></figure> </listitem>
<listitem>Click &quot;Save&quot; </listitem>
</orderedlist></listitem>
<listitem><ulink url="VirtWebIDCurlExample2">Test the SPARQL-WebID endpoint with http_client</ulink> (listening on default HTTPS 443 port).</listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3">Demo Examples</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://demo.openlinksw.com/tutorial/rdf/fs_s_1/fs_s_1.vsp">Using HTTP client to perform WebID Protocol connection</ulink></listitem>
</itemizedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2">Disable Default SPARQL Endpoint</bridgehead>
<bridgehead class="http://www.w3.org/1999/xhtml:h3">Using iSQL</bridgehead>
<orderedlist spacing="compact"><listitem>To disable /sparql, execute: <programlisting>DB.DBA.VHOST_REMOVE (lpath=&gt;&#39;/sparql&#39;);
</programlisting></listitem>
<listitem>To add the endpoint again via PL, execute: <programlisting>DB.DBA.VHOST_DEFINE (lpath=&gt;&#39;/sparql/&#39;, ppath =&gt; &#39;/!sparql/&#39;, is_dav =&gt; 1, vsp_user =&gt; &#39;dba&#39;, opts =&gt; vector(&#39;noinherit&#39;, 1)); 
</programlisting> </listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3">Using Conductor UI</bridgehead>
<orderedlist spacing="compact"><listitem>Go to <ulink url="http://cname:port/conductor">http://cname:port/conductor</ulink> . </listitem>
<listitem>Enter user dba credentials.
</listitem>
<listitem>Go to &quot;Web Application Server&quot; -&gt; &quot;Virtual Domains &amp; Directories&quot;.
<figure><graphic fileref="VirtSPARQLSSL/s1.png" /></figure> </listitem>
<listitem>Find the logical path &quot;/sparql&quot;.
<figure><graphic fileref="VirtSPARQLSSL/s2.png" /></figure> </listitem>
<listitem>Click &quot;Edit&quot; from the &quot;Action&quot; column.
<figure><graphic fileref="VirtSPARQLSSL/s3.png" /></figure> </listitem>
<listitem>Change &quot;VSP User&quot; to &quot;nobody&quot;.
<figure><graphic fileref="VirtSPARQLSSL/s4.png" /></figure> </listitem>
<listitem>Click &quot;Save Changes&quot;.
</listitem>
<listitem>As result the SPARQL Endpoint should be shown as disabled: <figure><graphic fileref="VirtSPARQLSSL/s5.png" /></figure></listitem>
</orderedlist><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2">Related</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtSPARQLEndpointProtection">Safeguarding your Virtuoso-hosted SPARQL Endpoint</ulink> </listitem>
<listitem><ulink url="VirtTipsAndTricksGuideSPARQLEndpointProtection">SPARQL Endpoint Protection Methods Collection</ulink> </listitem>
<listitem><ulink url="http://docs.openlinksw.com/virtuoso/">Virtuoso documentation</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfsupportedprotocolendpoint">SPARQL Service Endpoint</ulink> </listitem>
<listitem><ulink url="http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfsupportedprotocolendpointuri">Service Endpoint Security</ulink> </listitem>
<listitem><ulink url="http://docs.openlinksw.com/virtuoso/rdfsparql.html#sparqwebservicetbl">Managing a SPARQL Web Service Endpoint</ulink> </listitem>
<listitem><ulink url="http://docs.openlinksw.com/virtuoso/rdfsparql.html">SPARQL</ulink> </listitem>
</itemizedlist></listitem>
<listitem><ulink url="VirtTipsAndTricksGuide">Virtuoso Tips and Tricks Collection</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="VirtSPARQLDET">SPARQL Endpoint DET Configuration Guide</ulink> </listitem>
<listitem><ulink url="VirtSPARQLSecurityWebID">WebID Protocol &amp; SPARQL Endpoint ACLs Tutorial</ulink> </listitem>
<listitem><ulink url="VirtOAuthSPARQL">SPARQL OAuth Tutorial</ulink> </listitem>
<listitem><ulink url="VirtTipsAndTricksGuideSPARQLEndpoints">Securing SPARQL endpoints</ulink> </listitem>
</itemizedlist></listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/OdsSPARQLAuth">SPARUL over SPARQL using the http://cname:port/sparql-auth endpoint</ulink> </listitem>
<listitem><ulink url="VirtAuthServerUI">Virtuoso Authentication Server UI</ulink> </listitem>
<listitem><ulink url="VirtSPARQLSSL">Manage a SPARQL-WebID based Endpoint</ulink> </listitem>
<listitem><ulink url="VirtSetupSSL">Configure Virtuoso instance as an X.509 Certificate Authority and HTTPS listener</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSSetupSSL">Configure Virtuoso+ODS instance as an X.509 Certificate Authority and HTTPS listener</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/VirtODSSecurityWebID">WebID Protocol Support in OpenLink Data Spaces</ulink>.
</listitem>
<listitem>Manage ODS Datadspaces Objects <ulink url="WebID">WebID</ulink> Access Control Lists (ACLs): <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBriefcaseWebID">ODS Briefcase WebID based ACL Guide</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBriefcaseWebIDPerson">Person Entity WebID based ACL Guide</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBriefcaseWebIDGroup">Group Entity WebID based ACL Guide</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBriefcaseWebIDPublic">Public WebID based ACL Guide</ulink> </listitem>
</itemizedlist></listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSFeedManagerWebIDACL">ODS Feed Manager WebID based ACL Guide</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSFeedManagerWebIDACLPerson">Person Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSFeedManagerWebIDACLGroup">Group Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSFeedManagerWebIDACLPublic">Public Specific ACL for anyone with a WebID</ulink> </listitem>
</itemizedlist></listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSCalendarWebIDACL">ODS Calendar WebID based ACL Guide</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSCalendarWebIDACLPerson">Person Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSCalendarWebIDACLGroup">Group Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSCalendarWebIDACLPublic">Public Specific ACL for anyone with a WebID</ulink> </listitem>
</itemizedlist></listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBookmarksWebIDACL">ODS Bookmark Manager WebID based ACL Guide</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBookmarksWebIDACLPerson">Person Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBookmarksWebIDACLGroup">Group Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBookmarksWebIDACLPublic">Public Specific ACL for anyone with a WebID</ulink> </listitem>
</itemizedlist></listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSAddressBookWebIDACL">ODS Addressbook  WebID based ACL Guide</ulink> <itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSAddressBookWebIDACLPerson">Person Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSAddressBookWebIDACLGroup">Group Entity Specific ACL</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSAddressBookWebIDACLPublic">Public Specific ACL for anyone with a WebID</ulink> </listitem>
</itemizedlist></listitem>
</itemizedlist></listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSPkiSetup">Guide for Set up a X.509 certificate issuer and HTTPS listener and generate ODS user certificates.</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/VirtODSPubSubHub">Setting up PubSubHub in ODS</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/VirtPubSubHub">PubSubHubBub Demo Client Example</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/VirtFeedPubSubHub">Feed subscription via PubSubHub protocol Example</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/VirtPubSubHubACL">Setting Up PubSubHub to use WebID Protocol or IP based control lists</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/OdsKeyImport">CA Keys Import using Conductor</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSGenerateX509Certificate">Generate an X.509 Certificate hosted WebID Guide</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSGenerateWebIDX509CertOSKeystore">Generate an X.509 Certificate (with a WebID watermark) to be managed by host operating system keystore</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSGenerateWebIDX509CertBrsKeystore">Generate an X.509 Certificate (with a WebID watermark) to be managed by a browser-based keystore</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSWebIDIdP">Using Virtuoso&#39;s WebID Verification Proxy Service with a WebID-bearing X.509 certificate</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSWebIDIdpProxy">Using Virtuoso&#39;s WebID Identity Provider (IdP) Proxy Service with an X.509 certificate</ulink> </listitem>
<listitem><ulink url="http://ods.openlinksw.com/wiki/ODS/ODSBriefcaseWebIDShareFile">ODS Briefcase WebID Protocol Share File Guide</ulink> </listitem>
<listitem><ulink url="http://esw.w3.org/topic/foaf+ssl">WebID Protocol Specification</ulink> </listitem>
<listitem><ulink url="https://foaf.me/simpleLogin.php">Test WebID Protocol Certificate page</ulink> </listitem>
<listitem><ulink url="http://test.foafssl.org/cert/">WebID Protocol Certificate Generation page</ulink></listitem>
</itemizedlist></section></docbook>