%META:TOPICPARENT{name="InteractiveSparqlQueryBuilderTutorials"}%
---+ iSPARQL Querying Tutorial with SPARQL Query type "SELECT".
This tutorial shows how to execute a SPARQL query with type "SELECT".
You can find a rich list of Virtuoso SPARQL Queries in the [[#References][References]] section.
%TOC%
---+++Enter and execute a query
Choose a SPARQL query from the [[#References][References]] list. For this example, let's use the SPARQL query, which dumps all Weblog Posts for the ODS Member "demo". You can find this SPARQL Query in either the [[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSIOCRef][ODS SPARQL Queries]] or the
[[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefBlog][ODS Weblog SPARQL Queries]] list.
PREFIX rdf:
PREFIX sioc:
PREFIX sioct:
PREFIX xsd:
PREFIX dct:
PREFIX dcc:
SELECT DISTINCT ?role , ?forum_name, ?post, ?title, ?cr, ?url
WHERE
{
?forum a sioct:Weblog .
OPTIONAL{ ?forum sioc:id ?forum_name }.
OPTIONAL{ ?role sioc:function_of }.
OPTIONAL{ ?forum sioc:scope_of ?role } .
OPTIONAL{ ?forum sioc:container_of ?post }.
OPTIONAL{ ?post dct:title ?title }.
OPTIONAL{ ?post dcc:created ?cr }.
OPTIONAL{ ?post sioc:link ?url }.
}
ORDER BY DESC (?cr)
1 Go to http://cname/isparql, for ex. http://id.myopenlink.net/isparql
1 The iSPARQL initialization window will be shown:
%BR%%BR%
%BR%%BR%
1 On successful initialization will be presented the iSPARQL Advanced tab open with a default SPARQL query:
SELECT * WHERE {?s ?p ?o}
%BR%%BR%
%BR%%BR%
1 Go to QBE tab:
%BR%%BR%
%BR%%BR%
1 Click the Clear Pane icon on the toolbar to empty the Canvas.
%BR%%BR%
%BR%%BR%
%BR%%BR%
%BR%%BR%
1 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., http://id.myopenlink.net/dataspace
%BR%%BR%
%BR%%BR%
1 Click the Advanced tab.
1 Change the Graph value to also be as in our example http://id.myopenlink.net/dataspace
and enter (copy-and-paste) the query chosen above into the SPARQL Query text-area:
%BR%%BR%
%BR%%BR%
1 Click the Run Query button on the Advanced tab.
1 The Results sub-tab shown below the Results tab will present the results of executing our SPARQL Query:
%BR%%BR%
%BR%%BR%
1 Additionally you can change the results table column widths by dragging the ends of the column labels:
%BR%%BR%
%BR%%BR%
1 View the SPARQL Query as Graph model by clicking the Load Query into QBE button shown in the Toolbar.
%BR%%BR%
%BR%%BR%
---+++Execute another query
Now we will enter a different SPARQL query to execute, to show how the navigation buttons (grayed-out blue arrows in the toolbar of the
Results tab) work. You can find this SPARQL Query in the [[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSIOCRef][ODS SPARQL Queries list]] and also in the [[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefFeeds][ODS Feed Manager SPARQL Queries list]]. It should obtain a dump of all Posts within an ODS-Feeds Data Space for user "demo".
PREFIX sioc:
PREFIX sioct:
PREFIX dct:
PREFIX dcc:
SELECT ?forum_name, ?channel, ?item_title, ?created
FROM
WHERE
{
?forum a sioct:SubscriptionList;
sioc:id ?forum_name.
OPTIONAL{ ?forum sioc:scope_of ?role }.
OPTIONAL{ ?role sioc:function_of }.
OPTIONAL{ ?forum sioc:parent_of ?channel }.
OPTIONAL{ ?channel sioc:container_of ?post }.
OPTIONAL{ ?post dct:title ?item_title }.
OPTIONAL{ ?post dcc:created ?created }.
}
LIMIT 20
1 Click to the Advanced tab. Change the SPARQL Query to the above.
%BR%%BR%
%BR%%BR%
1 Click the Run Query button on the Advanced toolbar.
1 The Result tab will present the results of the query.
%BR%%BR%
%BR%%BR%
1 With the blue navigation buttons you can view the results of the first, previous, next and last executed queries. Click
the furthest-left blue arrow.
1 The results of the first query we executed -- all Weblog Posts for the ODS Member "demo" -- will be shown. Note that the content of the SPARQL Query area of the Advanced tab has also changed to match.
%BR%%BR%
%BR%%BR%
%BR%%BR%
%BR%%BR%
---+++References
---++++ODS SPARQL Queries
* [[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSIOCRef][ODS SIOC Reference]]
* [[http://virtuoso.openlinksw.com/wiki/main/Main/ODSFOAFRef][ODS FOAF Reference]]
* [[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSKOSRef][ODS SKOS Reference]]
* [[http://virtuoso.openlinksw.com/wiki/main/Main/ODSAtomOWLRef][ODS Atom OWL Reference]]
* [[http://virtuoso.openlinksw.com/wiki/main/Main/VOSODSSparqlSamples][ODS SIOC Query Tutorial]]
* [[http://virtuoso.openlinksw.com/wiki/main/Main/WordPressSIOCRef][WordPress SIOC Reference]]
* [[http://virtuoso.openlinksw.com/wiki/main/Main/MediaWikiSIOCRef][MedaWiki SIOC Reference]]
* [[http://virtuoso.openlinksw.com/wiki/main/Main/PHPBBSIOCRef][PHPBB SIOC Reference]]
---++++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|[[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefBlog][SIOCRefBlog]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSAtomOWLRefExampleBlog][ODS-Weblog Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSKOSRefExampleBlog][ODS-Weblog Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSFOAFRefExampleBlog][ODS-Weblog Data Query]]|
|Briefcase|[[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefBriefcase][SIOCRefBriefcase]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSAtomOWLRefExampleBriefcase][ODS-Briefcase Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSKOSRefExampleBriefcase][ODS-Briefcase Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSFOAFRefExampleBriefcase][ODS-Briefcase Data Query]]|
|Feed Manager|[[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefFeeds][SIOCRefFeeds]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSAtomOWLRefExampleFeeds][ODS-Feed-Manager Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSKOSRefExampleFeeds][ODS-Feed-Manager Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSFOAFRefExampleFeeds][ODS-Feed-Manager Data Query]]|
|Wiki|[[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefWiki][SIOCRefWiki]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSAtomOWLRefExampleWiki][ODS-Wiki Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSKOSRefExampleWiki][ODS-Wiki Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSFOAFRefExampleWiki][ODS-Wiki Data Query]]|
|Calendar|[[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefCalendar][SIOCRefCalendar]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSAtomOWLRefExampleCalendar][ODS-Calendar Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSKOSRefExampleCalendar][ODS-Calendar Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSFOAFRefExampleCalendar][ODS-Calendar Data Query]]|
|Bookmark Manager|[[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefBookmark][SIOCRefBookmark]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSAtomOWLRefExampleBookmarks][ODS-Bookmark-Manager Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSKOSRefExampleBookmarks][ODS-Bookmark-Manager Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSFOAFRefExampleBookmarks][ODS-Bookmark-Manager Data Query]]|
|Gallery|[[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefGallery][SIOCRefGallery]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSAtomOWLRefExampleGallery][ODS-Gallery Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSKOSRefExampleGallery][ODS-Gallery Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSFOAFRefExampleGallery][ODS-Gallery Data Query]]|
|Polls|[[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefPolls][SIOCRefPolls]]|-|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSKOSRefExamplePolls][ODS-Polls Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSFOAFRefExamplePolls][ODS-Polls Data Query]]|
|Addressbook|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSAddressBookRef][ODSAddressBookRef]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSAtomOWLRefExampleAddressbook][ODS-Addressbook Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSKOSRefExampleAddressBook][ODS-Addressbook Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSFOAFRefExampleAddressBook][ODS-Addressbook Data Query]]|
|Discussions|[[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefDiscussions][SIOCRefDiscussions]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSAtomOWLRefExampleDiscussions][ODSAtomOWLRefExampleDiscussions]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSKOSRefExampleDiscussion][ODS-Discussions Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSFOAFRefExampleDiscussion][ODS-Discussions Data Query]]|
|Community|[[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefCommunity][SIOCRefCommunity]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSAtomOWLRefExampleCommunity][ODS-Community Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSSKOSRefExampleCommunity][ODS-Community Data Query]]|[[http://virtuoso.openlinksw.com/wiki/main/Main/ODSFOAFRefExampleCommunity][ODS-Community Data Query]]|
---++++Other Virtuoso SPARQL Queries
* [[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefTutorial][Query Virtuoso Tutorials using SPARQL]]
* [[http://virtuoso.openlinksw.com/wiki/main/Main/SIOCRefDocs][Query Virtuoso Documentation using SPARQL]]
---+++Related
* [[InteractiveSparqlQueryBuilderTutorials][iSPARQL Tutorials]]
* [[InteractiveSparqlQueryBuilderBasicTutorial1][Basic iSPARQL Tutorial with query built from a blank canvas and pre-typed Nodes]]
* [[InteractiveSparqlQueryBuilderBasicTutorial2][Basic iSPARQL Tutorial with query built from a blank canvas and Nodes dragged from the Toolbar]]
* [[InteractiveSparqlQueryBuilderBasicTutorial][Basic iSPARQL Tutorial]]
* [[InteractiveSparqlQueryBuilderQueryTutorialConstruct][iSPARQL Querying Tutorial with SPARQL Query type "CONSTRUCT"]]
* [[InteractiveSparqlQueryBuilderQueryTutorialDescribe][iSPARQL Querying Tutorial with SPARQL Query type "DESCRIBE"]]
* [[InteractiveSparqlQueryBuilderQueryTutorialDescribeGoogleMapView][iSPARQL Querying Tutorial "DESCRIBE" with Google Maps View Results]]
* [[InteractiveSparqlQueryBuilderQueryTutorialInsert][iSPARQL Querying Tutorial with SPARQL Query type "INSERT"]]
* [[InteractiveSparqlQueryBuilderQueryTutorialDelete][iSPARQL Querying Tutorial with SPARQL Query type "DELETE"]]
* [[OATWikiWebIndex][OpenLink AJAX Toolkit (OAT)]]
CategorySPARQL CategoryRDF CategoryOpenSource CategoryOAT CategoryDocumentation CategoryTutorial