wiki:multipleOperations

Version 9 (modified by nixdell, 8 years ago) (diff)

--

VIQUEN: A Visual Query Engine for RDF

Tutorial 3: Creating a query with multiple operations

In this tutorial, you will work through constructing a query that contains multiple different operations. These operations are chained together to represent the entire query.

Specifically, we are going to write a query which extracts all of the different types of parts of the skull: "regional part" and "constitutional part" . We are then going to replace the "regional part" property and "constitutional part" property with the more simple "part" property.

We assume that you have successfully completed tutorials 1 and 2, and have a working knowledge of how to add operations to the workspace and edit their parameters.

NOTE: This tutorial will not focus on how to use the execution environment or the visualization environment.
For information on how to use the execution environment, see part 2 of tutorial 1.
For information on how to use the visualization environment, see part 3 of tutorial 1.
For general information on the system, see the main VIQUEN documentation.

Step 1: Start VIQUEN

Navigate to the VIQUEN directory and launch the application. You should start with a new, empty query-building workspace.

Step 2: Add basic query nodes

Add a "Start" node to the workspace (if you do not know how to do this please try tutorial 2).
Add an "Input" node to the workspace and select the input data source to be the "fma" (if you do not know how to do this please try tutorial 2).
Add an edge which connects the "Start" node to the "Input" node (if you do not know how to do this please try tutorial 2).

Step 3: Adding an Extract Tree operation

We wish to add the operation that will extract all of the "regional_parts" and "constitutional_parts" of the "Skull".

Add an "Extract Tree" operation to the workspace (if you do not know how to do this review how to add nodes in tutorial 2).
Set the "From Graph" drop-down to be "fma".
Set the "Root" to be "fma:Skull".
Add another property to the table by clicking on the (+) button directly below the "Root" parameter. You should now have two properties in the table.
Set the first property to be "fma:regional_part" with the direction "outgoing".
Set the second property to be "fma:constitutional_part" with the direction "outgoing". Add an edge which connects the "Input" node to the "Extract Tree" node.

NOTE that for this operation we do not need a "WHERE" clause since we have no unknown variables.

Step 3: Adding a Replace operation

We wish to add the operation that will replace the "regional_part" property with the "part" property.

Add a "Replace Property" node to the workspace.
Since the results of the "Extract Tree" operation will be put into the default graph, the "Replace" operation should use the "default" graph.
Set the "From Graph" drop-down to be "default".
Set the "Replace Property" field to be "fma:regional_part".
Set the "New Property" field to be "fma:part".
Add an edge from the "Extract Tree" node to the "Replace Property" node.

NOTE that for this operation we do not need a "WHERE" clause since we have no unknown variables.

Step 4: Adding another Replace operation

We now want to add the operation that will replace the "constitutional_part" property with the "part" property.

Add a "Replace Property" node to the workspace.
Since the results of the "Extract Tree" operation will be put into the default graph, the "Replace" operation should use the "default" graph.
Set the "From Graph" drop-down to be "default".
Set the "Replace Property" field to be "fma:constitutional_part".
Set the "New Property" field to be "fma:part".
Add an edge from the first "Replace Property" node to this "Replace Property" node.

NOTE that for this operation we do not need a "WHERE" clause since we have no unknown variables.

Step 5: Finishing up

Add an "Output" node to the workspace. You do not need to change the output location unless you want to.
Add an edge which connects the last "Replace" node to the "Output" node (if you do not know how to do this please try tutorial 2).

Step 6: Compile and execute the query

Congratulations! You have finished formulating the query. Click on the "compile query" button to compile the query and open the execution environment. Run the query and visualize the results (if you do not know how to do this then please review tutorial 1 parts 2 and 3). HINT: This query should return 746 RDF triples.

For information on how to use the execution environment, see part 2 of tutorial 1.
For information on how to use the visualization environment, see part 3 of tutorial 1.
For general information on the system, see the main VIQUEN documentation.

Attachments