OpenLink AJAX Toolkit (OAT) Wiki
Documentation, live demonstrations and programmers' guides for the OpenLink AJAX Toolkit (OAT)
Advanced Search
Help?
Location: / Dashboard / OATWikiWeb / InteractiveSparqlQueryBuilderQueryTutorialConstruct

iSPARQL Querying Tutorial with SPARQL Query type "CONSTRUCT".

This tutorial shows how to execute a SPARQL query with type "CONSTRUCT". You can find a rich list of Virtuoso SPARQL Queries in the References section.

Enter and execute a query

Choose a SPARQL query from the References list. For this example, let's use the SPARQL query which dumps sender, nick, and name details for all Weblog posts . You can find this SPARQL Query in the ODS FOAF Queries List.

prefix sioc: <http://rdfs.org/sioc/ns#>
prefix sioct: <http://rdfs.org/sioc/types#>
prefix foaf: <http://xmlns.com/foaf/0.1/>%BR%%BR%
CONSTRUCT
{
  ?post foaf:maker ?maker .
  ?maker foaf:nick ?nick .
  ?maker foaf:name ?fname .
}
from <http://demo.openlinksw.com/dataspace>
where
   {
    ?forum a sioct:Weblog .
    ?forum sioc:container_of ?post.
    optional { ?post foaf:maker ?maker }.
    optional { ?maker foaf:nick ?nick  } .
    optional { ?maker foaf:name ?fname } .
  }
  1. Go to iSPARQL demo page.
  2. By default, user name demo and password demo should be shown in the Login form. Click OK.



  3. You will now see the iSPARQL home page, with QBE tab open and default graph elements on the Canvas. Click the Clear Pane icon on the toolbar to empty the Canvas.



  4. Change the Data Source URI field value on the QBE tab to the Graph of the database against which you want to execute your query, i.e., for this example -- http://demo.openlinksw.com/dataspace



  5. Click the Advanced tab.
  6. Change the Graph value to also be http://demo.openlinksw.com/dataspace, and enter (copy-and-paste) the query chosen above into the SPARQL Query text-area:



  7. Click the Run Query button from the Advanced tab.
  8. The Result sub-tab shown below the Advanced SPARQL Query Working Canvas will present the query execution results, by default in Navigator Visualization mode.



    You can change the visualization to:
    • Browser mode:



    • Raw Triples mode:



    • SVG Graph mode:

      ToBeDone -- UI to be modified to add titles for each drop-down; docs and screenshots then to modify to reflect UI changes.



      • Equal distances drop-down menu offers Equal distances (default) or All nodes at once.



        • Random drop-down menu, active only when "All nodes at once" is chosen, offers nodes positioning of Random (default) or Circle.



      • Show all nodes drop-down menu lets you limit the displayed nodes by their distance from the selected node, from 1 (default) to 4; for example, Selected up to distance 3.



      • Medium distance drop-down menu adjusts distances between nodes, making depiction clearer or more overlapped. Options are Medium distance (default), Close distance, and Far distance.



      • Planar drop-down menu adjusts model shape between Planar (default) and Pseudo-spherical.



      • Labels only on one element drop-down menu determines which nodes are labeled -- Labels only on one element (default), Up to distance from 1 to 4, or Labels on all elements.



    • Images mode. ToBeDone
    • Yahoo Map mode:



  9. You can view your SPARQL Query with type "CONSTRUCT" as a Graph model by clicking the "Load Query to QBE" button.



References

ODS SPARQL Queries

ODS Applications SPARQL Queries

ODS Application Name SIOC Reference SPARQL Query Using Atom OWL Ontology SPARQL Query Using SKOS Ontology SPARQL Query Using FOAF Ontology
Weblog SIOCRefBlog ODS-Weblog Data Query ODS-Weblog Data Query ODS-Weblog Data Query
Briefcase SIOCRefBriefcase ODS-Briefcase Data Query ODS-Briefcase Data Query ODS-Briefcase Data Query
Feed Manager SIOCRefFeeds ODS-Feed-Manager Data Query ODS-Feed-Manager Data Query ODS-Feed-Manager Data Query
Wiki SIOCRefWiki ODS-Wiki Data Query ODS-Wiki Data Query ODS-Wiki Data Query
Calendar SIOCRefCalendar ODS-Calendar Data Query ODS-Calendar Data Query ODS-Calendar Data Query
Bookmark Manager SIOCRefBookmark ODS-Bookmark-Manager Data Query ODS-Bookmark-Manager Data Query ODS-Bookmark-Manager Data Query
Gallery SIOCRefGallery ODS-Gallery Data Query ODS-Gallery Data Query ODS-Gallery Data Query
Polls SIOCRefPolls - ODS-Polls Data Query ODS-Polls Data Query
Addressbook ODSAddressBookRef ODS-Addressbook Data Query ODS-Addressbook Data Query ODS-Addressbook Data Query
Discussions SIOCRefDiscussions ODSAtomOWLRefExampleDiscussions ODS-Discussions Data Query ODS-Discussions Data Query
Community SIOCRefCommunity ODS-Community Data Query ODS-Community Data Query ODS-Community Data Query

Other Virtuoso SPARQL Queries

Powered By Virtuoso