%META:TOPICPARENT{name="InteractiveSparqlQueryBuilderTutorials"}%
---++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][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 sender, nick, and name details for all Weblog posts. You can find this SPARQL Query in the [[ODSFOAFRef][ODS FOAF Queries List]].
PREFIX sioc:
PREFIX sioct:
PREFIX foaf:
CONSTRUCT
{
?post foaf:maker ?maker .
?maker foaf:nick ?nick .
?maker foaf:name ?fname .
}
FROM
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 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. By default is View -> Navigator mode.
%BR%%BR%%BR%%BR%
1 You can change the visualization to:
* Raw Triples mode:
%BR%%BR%%BR%%BR%
* Grid View mode:
%BR%%BR%%BR%%BR%
* SVG Graph mode:
%BR%%BR%%BR%%BR%
* Equal distances drop-down menu offers
Equal distances (default) or All nodes at once.
%BR%%BR%%BR%%BR%
* Random drop-down menu, active only when "All nodes at once" is chosen, offers nodes positioning of Random (default) or Circle.
%BR%%BR%%BR%%BR%
* 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.
%BR%%BR%%BR%%BR%
* 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.
%BR%%BR%%BR%%BR%
* Planar drop-down menu adjusts model shape between Planar (default) and Pseudo-spherical.
%BR%%BR%%BR%%BR%
* 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.
%BR%%BR%%BR%%BR%
* Images mode.
* Google Maps v3 mode:
1 You can view your SPARQL Query with type "CONSTRUCT" as a Graph model by clicking the "Load Query to QBE" button.
%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]]
* [[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"]]
* [[InteractiveSparqlQueryBuilderQueryTutorialSlc][iSPARQL Querying Tutorial with SPARQL Query type "SELECT"]]
* [[OATWikiWebIndex][OpenLink AJAX Toolkit (OAT)]]
CategorySPARQL CategoryRDF CategoryOpenSource CategoryOAT CategoryDocumentation CategoryTutorial