<docbook><section><title>InteractiveSparqlQueryBuilderBasicTutorial</title><para> </para>
<title> Interactive SPARQL Query Builder: Basic Tutorial</title> Interactive SPARQL Query Builder: Basic Tutorial
 <bridgehead class="http://www.w3.org/1999/xhtml:h2"> Creating RDF Instance Data using iSPARQL</bridgehead>
<orderedlist spacing="compact"><listitem>Go to <ulink url="http://cname/isparql,">http://cname/isparql,</ulink> for ex.
 <ulink url="http://id.myopenlink.net/isparql">http://id.myopenlink.net/isparql</ulink> </listitem>
<listitem>The iSPARQL initialization window will be shown:  <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isparqlload.png" /></figure> </listitem>
<listitem>Finally will be presented the iSPARQL <emphasis>Advanced</emphasis> tab open with a default SPARQL query: <programlisting>SELECT * WHERE {?s ?p ?o}
</programlisting> <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isparql1.png" /></figure> </listitem>
<listitem>Go to <emphasis>QBE</emphasis> tab:  <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isparql2.png" /></figure> </listitem>
<listitem>Click the <emphasis>Clear Pane</emphasis> icon on the toolbar to empty the Canvas.
 <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isparql3.png" /></figure> <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isparql4.png" /></figure> </listitem>
<listitem>Next we will import the Schemas that contain the Terms to be used in the our Graph Pattern.
 In the <emphasis>Schemas</emphasis> pane enter <ulink url="http://rdfs.org/sioc/types">http://rdfs.org/sioc/types</ulink># and click the &quot;Import&quot; button.
 Perform the same steps for the schema with URL: <ulink url="http://rdfs.org/sioc/ns">http://rdfs.org/sioc/ns</ulink># </listitem>
<listitem>As result the <emphasis>Schemas</emphasis> window under &quot;unbound&quot;, you should now see the items <emphasis>sioct</emphasis> and <emphasis>sioc</emphasis>.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg1.png" /></figure> </listitem>
<listitem>Now click on the <emphasis>sioct</emphasis> -&gt; <emphasis>Classes</emphasis> -&gt; <emphasis>+</emphasis>  icon in order to expand the classes list: <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg2.png" /></figure> </listitem>
<listitem>Scroll down the shown list and drag-and-drop the Subject Node <emphasis>Weblog</emphasis> onto the QBE working Canvas.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg3.png" /></figure> </listitem>
<listitem>As result should be created a Subject node of Datatype <emphasis>sioct:Weblog</emphasis> at the point you dropped it.
</listitem>
<listitem>The properties of the selected node are shown in the Subject <emphasis>Node</emphasis> pane where you can: <orderedlist spacing="compact"><listitem>Change the <emphasis>Node type</emphasis> to URI or Literal; </listitem>
<listitem>Change the <emphasis>Node Variable label</emphasis> value; </listitem>
<listitem>Set the <emphasis>Node Datatype</emphasis>; </listitem>
<listitem>Set the <emphasis>visibility property</emphasis> of the variable by hatching the &quot;Visible?&quot; check-box; </listitem>
<listitem>Set <emphasis>participation</emphasis> in the &quot;Order By&quot; clause bz hatching the &quot;Order By&quot; check-box: <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg4.png" /></figure> </listitem>
</orderedlist></listitem>
<listitem>You can <emphasis>add a new node</emphasis> from the QBE toolbar.
 Click the <emphasis>Add mode</emphasis> icon, and drag-and-drop an Object Node onto the Canvas.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg5.png" /></figure> </listitem>
<listitem>In the Object <emphasis>Node</emphasis> pane, change the <emphasis>type</emphasis> to <emphasis>Literal</emphasis> and change the <emphasis>Variable</emphasis> label value to <emphasis>?s</emphasis>.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg6.png" /></figure> </listitem>
<listitem>You can <emphasis>add a Datatype to a node</emphasis> through the <emphasis>Schemas</emphasis> pane or enter it manually.
 To use the Schemas pane -- <orderedlist spacing="compact"><listitem>Import the schema that contains the terms you wish to use in your Graph Pattern.
 For ex.
 import the foaf schema: <ulink url="http://xmlns.com/foaf/0.1/">http://xmlns.com/foaf/0.1/</ulink> <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg7.png" /></figure> </listitem>
<listitem>Drag-and-drop the Class <emphasis>Document</emphasis> item from the Concepts list over the Node with <emphasis>Literal</emphasis> type that we created above.
</listitem>
<listitem>You should now see that the <emphasis>Datatype</emphasis> in the <emphasis>Node</emphasis> pane for the selected node has changed, from <emphasis>Literal</emphasis> to <emphasis>foaf:Document</emphasis>.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg8.png" /></figure> </listitem>
</orderedlist></listitem>
<listitem>To <emphasis>delete a node</emphasis>, select the desired node, e.g., the Node with Variable label <emphasis>?s</emphasis>, and click the <emphasis>Remove</emphasis> button in the QBE toolbar.
 You will be prompted to verify deletion.
 Click <emphasis>OK</emphasis> to delete.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg9.png" /></figure> </listitem>
<listitem>You can add more nodes: <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg10.png" /></figure> </listitem>
<listitem><emphasis>Add connections</emphasis> by clicking the <emphasis>Connector</emphasis> icon on the QBE toolbar and drag from one node to another.
<orderedlist spacing="compact"><listitem>For example, drag a connection from the node with Variable label <emphasis>?forum</emphasis> to the <emphasis>?post</emphasis> node.
</listitem>
<listitem>A connection will now be shown between the two nodes and a <emphasis>Connector</emphasis> pane will be shown above the <emphasis>Schema</emphasis> pane; this is the property window for the currently selected connection.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg11.png" /></figure> </listitem>
<listitem>Enter for <emphasis>Name</emphasis> for ex.
 <emphasis>sioc:container_of</emphasis> and un-hatch the <emphasis>Visible?</emphasis> check-box.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg12.png" /></figure> </listitem>
<listitem>Click the <emphasis>Connector</emphasis> icon from the QBE toolbar and drag from the <emphasis>?post</emphasis> node to to the <emphasis>?maker</emphasis> node.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg13.png" /></figure> </listitem>
<listitem>In the <emphasis>Connector</emphasis> pane, check the <emphasis>Optional?</emphasis> check-box and un-hatch the <emphasis>Visible?</emphasis> check-box.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg14.png" /></figure> </listitem>
<listitem>Now we will add a type (from the foaf schema) to this connection.
 The type can be an <emphasis>Attribute</emphasis> (A) or <emphasis>Relationship</emphasis> (R) property from the Schema pane.
 &quot;Attribute&quot; (A) items are shown under each imported Schema&#39;s Properties with a green letter &quot;A&quot; icon.
 &quot;Relationship&quot; (R) items are shown under each imported Schema&#39;s Properties with a blue letter &quot;R&quot; icon.
 In the <emphasis>Schemas</emphasis> pane, go to foaf -&gt; Properties and drag the &quot;Relationship&quot; (R) property <emphasis>maker</emphasis> onto the selected connection on the Canvas.
</listitem>
<listitem>In the <emphasis>Connector</emphasis> pane, the value of the <emphasis>Name</emphasis> field will change to <emphasis>foaf:maker</emphasis>.
 Note that the connection line between the nodes <emphasis>?post</emphasis> and <emphasis>?maker</emphasis> is not solid, because we set it to be optional in the <emphasis>Connector</emphasis> window: <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg15.png" /></figure> </listitem>
<listitem>Click the &quot;Connector&quot; icon from the QBE toolbar and drag from the <emphasis>?maker</emphasis> node to the <emphasis>?nick</emphasis> node.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg16.png" /></figure> </listitem>
<listitem>In the <emphasis>Connector</emphasis> window hatch the <emphasis>Optional?</emphasis> check-box and un-hatch the <emphasis>Visible?</emphasis> check-box.
 Enter <emphasis>foaf:nick</emphasis> for <emphasis>Name</emphasis>.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg17.png" /></figure> </listitem>
</orderedlist></listitem>
<listitem><emphasis>The Final Graph Model</emphasis> can be viewed in the QBE working pane.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg18.png" /></figure></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Querying</bridgehead>
 <orderedlist spacing="compact"><listitem>We now have the final graph model.
 Before using it in a query, we need to set a proper target Graph URI.
 For this, change the value in the <emphasis>Data Source URI</emphasis> field for ex.
 to <ulink url="http://id.myopenlink.net/dataspace">http://id.myopenlink.net/dataspace</ulink> <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg19.png" /></figure> </listitem>
<listitem>Click the <emphasis>Run Query</emphasis> button on the QBE toolbar.
</listitem>
<listitem>The query results will be shown in the <emphasis>Results</emphasis> tab.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg20.png" /></figure> </listitem>
<listitem>You can also change dereferencing: <itemizedlist mark="bullet" spacing="compact"><listitem>&quot;SPARQL Describe&quot; ( by default ): for selected link of the result set performs describe, for ex.
 for link &quot;<ulink url="http://id.myopenlink.net/dataspace/Bratsas/weblog/Bratsas%27s%20Weblog">http://id.myopenlink.net/dataspace/Bratsas/weblog/Bratsas%27s%20Weblog</ulink>&quot;: <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg21.png" /></figure> </listitem>
<listitem>&quot;SELECT IRI as S or O&quot;: for selected link of the result set performs select IRI as S or O, for ex.
 for link &quot;<ulink url="http://id.myopenlink.net/dataspace/Bratsas/weblog/Bratsas%27s%20Weblog">http://id.myopenlink.net/dataspace/Bratsas/weblog/Bratsas%27s%20Weblog</ulink>&quot;: <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg22.png" /></figure> </listitem>
<listitem>&quot;GET PAGE&quot;: for selected link of the result set performs redirect to this link, for ex.
 for link &quot;<ulink url="http://id.myopenlink.net/dataspace/Bratsas/weblog/Bratsas%27s%20Weblog">http://id.myopenlink.net/dataspace/Bratsas/weblog/Bratsas%27s%20Weblog</ulink>&quot;: <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg23.png" /></figure> </listitem>
<listitem>&quot;Use Virtuoso Web Service&quot;, for selected link of the result set performs Virtuoso Web Service execution, for ex.
 link for &quot;<ulink url="http://id.myopenlink.net/dataspace/Bratsas/weblog/Bratsas%27s%20Weblog">http://id.myopenlink.net/dataspace/Bratsas/weblog/Bratsas%27s%20Weblog</ulink>&quot;: <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg24.png" /></figure> </listitem>
</itemizedlist></listitem>
<listitem>View the SPARQL parameters values in the <emphasis>SPARQL Params</emphasis> sub-tab: <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg25.png" /></figure> </listitem>
<listitem>View the response values from the <emphasis>Response</emphasis> sub-tab: <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg26.png" /></figure> </listitem>
<listitem>View the SPARQL query produced from the graph model you have built from the <emphasis>Query</emphasis> sub-tab: <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg27.png" /></figure></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Saving the Graph Model</bridgehead>
 <orderedlist spacing="compact"><listitem>Go to QBE  tab and click the <emphasis>Save As</emphasis> icon from the QBE toolbar.
</listitem>
<listitem>As result should be shown the <ulink url="WebDAV">WebDAV</ulink> Browser: <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg28.png" /></figure> </listitem>
<listitem>Select a destination folder, input a file name, for e.g., <ulink url="MySimpleTest">MySimpleTest</ulink>, and select <emphasis>SPARQL Definitions (*.rq)</emphasis> for <emphasis>File type</emphasis>.
 You may also save the query in XML format, by choosing <emphasis>Dynamic Data Web Page (*.isparql)</emphasis> for <emphasis>File type</emphasis>.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg29.png" /></figure> </listitem>
<listitem>Click &quot;Save&quot;.</listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Generating a SPARQL Query from the Graph Model</bridgehead>
 <orderedlist spacing="compact"><listitem>Go to QBE tab.
</listitem>
<listitem>Click the <emphasis>Generate</emphasis> icon on the toolbar.
</listitem>
<listitem>The <emphasis>Advanced</emphasis> tab will open, with the query generated from your Graph in the <emphasis>SPARQL Query</emphasis> text-area.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg30.png" /></figure> </listitem>
<listitem>Use the <emphasis>Prefixes</emphasis>, <emphasis>Templates</emphasis>, and <emphasis>Statement Help</emphasis> drop-down lists above the <emphasis>SPARQL Query</emphasis> text-area to format the query.
<itemizedlist mark="bullet" spacing="compact"><listitem><emphasis>Note</emphasis>: You can revert your changes by clicking the &quot;Get from QBE&quot; button on the <emphasis>Advanced</emphasis> tab toolbar.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg31.png" /></figure> </listitem>
</itemizedlist></listitem>
<listitem>Now in the SPARQL Query Working area of the Advanced tab, add a new optional node to the query for <emphasis>foaf:phone</emphasis>.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg32.png" /></figure> </listitem>
<listitem>To apply the query changes to the Graph model, click the &quot;Visualize&quot; button on the <emphasis>Advanced</emphasis> tab toolbar.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg33.png" /></figure></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Setting Results Rows</bridgehead>
 <orderedlist spacing="compact"><listitem>Go to the <emphasis>QBE</emphasis> tab.
</listitem>
<listitem>At the bottom of the page change in &quot;Query options&quot; the <emphasis>Resize site limit</emphasis> value, for ex.
 to 10: <figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg34.png" /></figure></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Adding a dataset</bridgehead>
 <orderedlist spacing="compact"><listitem>On the QBE toolbar, click the <emphasis>Dataset</emphasis> button.
</listitem>
<listitem>Choose <emphasis>Type</emphasis> and enter a <emphasis>Data Source URI</emphasis> value.
</listitem>
<listitem>Click the <emphasis>Add</emphasis> button.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg35.png" /></figure></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h2"> Other iSPARQL Features</bridgehead>
 <bridgehead class="http://www.w3.org/1999/xhtml:h3"> Auto arrange the Graph Model</bridgehead>
 <orderedlist spacing="compact"><listitem>Go to the <emphasis>QBE</emphasis> tab.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg36.png" /></figure> </listitem>
<listitem>Click the <emphasis>Auto arrange</emphasis> icon on the toolbar.
</listitem>
<listitem>The Graph model layout will be re-arranged to a more compact form.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg37.png" /></figure></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Group selected nodes of the Graph Model</bridgehead>
 <orderedlist spacing="compact"><listitem>Go to the <emphasis>QBE</emphasis> tab.
</listitem>
<listitem>Select several nodes from the Graph.
 You can do this by holding the &quot;Shift&quot; (on Windows) or &quot;Command&quot;/&quot;Apple&quot; (on Mac) key while clicking the nodes.
</listitem>
<listitem>Click the &quot;Group Selected&quot; icon from the toolbar.
</listitem>
<listitem>The selected nodes will be shown on the Canvas in one-color area as grouped.
 You can use the <emphasis>Group</emphasis> pane which will be shown above the <emphasis>Schemas</emphasis> window to: <itemizedlist mark="bullet" spacing="compact"><listitem>Change the <emphasis>Group Type</emphasis>: Graph, Optional, Union or Construct </listitem>
<listitem>Set the Group&#39;s ID label.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg38.png" /></figure></listitem>
</itemizedlist></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Add Named Graph(s) to the SPARQL query</bridgehead>
 <orderedlist spacing="compact"><listitem>Click to the <emphasis>Advanced</emphasis> tab.
</listitem>
<listitem>Click to the <emphasis>Named Graph(s)</emphasis> sub-tab.
</listitem>
<listitem>In the form, enter a value for <emphasis>Named Graph</emphasis>, and click the <emphasis>Add</emphasis> button.
</listitem>
<listitem>The number of added Graphs will be shown, right-aligned to the <emphasis>Named Graph(s)</emphasis> sub-tab.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg39.png" /></figure></listitem>
</orderedlist><bridgehead class="http://www.w3.org/1999/xhtml:h3"> Add statement to the SPARQL query</bridgehead>
 <orderedlist spacing="compact"><listitem>Go to the <emphasis>Advanced</emphasis> tab.
</listitem>
<listitem>You can add a statement to the SPARQL Query with <itemizedlist mark="bullet" spacing="compact"><listitem>the <emphasis>Statement Help</emphasis> drop-down list or </listitem>
<listitem>the <emphasis>Statement Help</emphasis> button shown right after it.
<orderedlist spacing="compact"><listitem>Click the  button &quot;Statement Help&quot;.
</listitem>
<listitem>Click on the desired statement name in the <emphasis>Statement Help</emphasis> window which appears.
<figure><graphic fileref="InteractiveSparqlQueryBuilderBasicTutorial/isg40.png" /></figure></listitem>
</orderedlist></listitem>
</itemizedlist></listitem>
</orderedlist><para> </para>
<bridgehead class="http://www.w3.org/1999/xhtml:h2"> Related</bridgehead>
<itemizedlist mark="bullet" spacing="compact"><listitem><ulink url="InteractiveSparqlQueryBuilderTutorials">iSPARQL Tutorials</ulink> </listitem>
<listitem><ulink url="InteractiveSparqlQueryBuilderBasicTutorial1">Basic iSPARQL Tutorial with query built from a blank canvas and pre-typed Nodes</ulink> </listitem>
<listitem><ulink url="InteractiveSparqlQueryBuilderBasicTutorial2">Basic iSPARQL Tutorial with query built from a blank canvas and Nodes dragged from the Toolbar</ulink> </listitem>
<listitem><ulink url="InteractiveSparqlQueryBuilderQueryTutorialConstruct">iSPARQL Querying Tutorial with SPARQL Query type &quot;CONSTRUCT&quot;</ulink> </listitem>
<listitem><ulink url="InteractiveSparqlQueryBuilderQueryTutorialDescribe">iSPARQL Querying Tutorial with SPARQL Query type &quot;DESCRIBE&quot;</ulink> </listitem>
<listitem><ulink url="InteractiveSparqlQueryBuilderQueryTutorialDescribeGoogleMapView">iSPARQL Querying Tutorial &quot;DESCRIBE&quot; with Google Maps View Results</ulink> </listitem>
<listitem><ulink url="InteractiveSparqlQueryBuilderQueryTutorialInsert">iSPARQL Querying Tutorial with SPARQL Query type &quot;INSERT&quot;</ulink> </listitem>
<listitem><ulink url="InteractiveSparqlQueryBuilderQueryTutorialDelete">iSPARQL Querying Tutorial with SPARQL Query type &quot;DELETE&quot;</ulink> </listitem>
<listitem><ulink url="InteractiveSparqlQueryBuilderQueryTutorialSlc">iSPARQL Querying Tutorial with SPARQL Query type &quot;SELECT&quot;</ulink> </listitem>
<listitem><ulink url="OATWikiWebIndex">OpenLink AJAX Toolkit (OAT)</ulink></listitem>
</itemizedlist><para> <ulink url="CategorySPARQL">CategorySPARQL</ulink> <ulink url="CategoryRDF">CategoryRDF</ulink> <ulink url="CategoryOpenSource">CategoryOpenSource</ulink> <ulink url="CategoryOAT">CategoryOAT</ulink> <ulink url="CategoryTutorial">CategoryTutorial</ulink> <ulink url="CategoryDocumentation">CategoryDocumentation</ulink></para>
</section></docbook>