iSPARQL Querying Tutorial with SPARQL Query type "CONSTRUCT".
In this tutorial we will show how to execute a SPARQL query with type "CONSTRUCT". A rich list of Virtuoso SPARQL Queries you can find in the References section.
Enter a query and execute
- Choose a SPARQL query from the References list.
For example, let's use the SPARQL query, which dumps all Weblog posts sender nick and name details.
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/> 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 } . }
- Go to iSPARQL demo page.
- Click "Ok" in the shown Login form.
By default should be shown user name demo and password demo.
-
- As result will be shown the iSPARQL home page, with opened tab "QBE" and default graph elements will be shown on the Canvas.
Click the "Clear Pane" icon form the toolbar in order to empty the Canvas.
-
- Change the "Data Source URI" field value from the QBE tab to: http://demo.openlinksw.com/dataspace as the query we selected is going to be executed against the database with this Graph.
-
- Go the Advanced tab.
- Change the "Graph" value also to: http://demo.openlinksw.com/dataspace and enter in the "SPARQL Query" text-area the query we have chosen above:
-
- Click the "Run Query" button from the Advanced tab.
- The Result sub-tab shown bellow the Advanced SPARQL Query Working Canvas will present by default in Navigator Visualization mode the results of executing our SPARQL Query.
-
- You can change the visualization also to:
-
Browser mode:
-
-
Raw Triples mode:
-
-
SVG Graph mode:
-
- Show all nodes drop-down list when chosen, offers distance arrange: selected up to distance: from 1(by default) to 4.
Select for ex.
the value "Selected up to distance 3".
-
- Equal distances drop-down list when chosen, offers depending on the value selected, either the result format page to have "Equal distances" (by default) or "All nodes at once".
-
-
Medium distance drop-down list when chosen, offers distance diapason depending on the value selected: "Mediaum distance" (by default), "Close distance" and "Far distance".
-
-
Planar drop-down list when chosen, offers model shape depending on the value selected: "Planar" (by default) or "Pseudo-spherical".
-
-
Labels only on one element drop-down list when chosen, offers nodes labels diapazon depending on the value selected: "Labels only on one element" (by default), "Up to distance from 1 to 4", "Labels on all elements".
-
- Random drop-down list when chosen, offers nodes positioning depending on the value selected: "Random" (by default) or "Circle". This dtop-down list is active when is chosen the drop-down list "All nodes at once".
- Show all nodes drop-down list when chosen, offers distance arrange: selected up to distance: from 1(by default) to 4.
Select for ex.
the value "Selected up to distance 3".
-
-
- Images mode.
-
Yahoo Map mode:
-
-
Browser mode:
- View the SPARQL Query with type "CONSTRUCT" as Graph model you can do by clicking the "Load Query to QBE" button.
-
References
List of Virtuoso SPARQL Queries
ODS SPARQL Queries
- ODS SIOC Reference
- ODS FOAF Reference
- ODS SKOS Reference
- ODS Atom OWL Reference
- ODS SIOC Query Tutorial
- WordPress SIOC Reference
- MedaWiki SIOC Reference
- PHPBB SIOC Reference
ODS Applications SPARQL Queries
Other Virtuoso SPARQL Queries