Visualization Knowledge Query Language (VKQL) Workshop
description
Transcript of Visualization Knowledge Query Language (VKQL) Workshop
![Page 1: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/1.jpg)
Visualization Knowledge Query Language (VKQL) Workshop
Nicholas Del RioUniversity of Texas at El Paso
Computer Science
![Page 2: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/2.jpg)
Workshop Objectives
• Understand notion and purpose of visualization queries
• Understand why writing queries may be easier that writing visualization programs
• Learn the VKQL syntax and practice posing queries
![Page 3: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/3.jpg)
Workshop Summary
1. Generating Visualizations Imperatively2. Visualization Query3. VKQL Syntax and Examples4. Activity 1: Manual Inspection of Query5. Activity 2: Copy and Pasting Examples6. Conclusion
![Page 4: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/4.jpg)
Velocity Model Visualization
• A set of isosurfaces– extracted from a seismic velocity model– Covers a region in southern New Mexico
8 km/s
3 km/s
Dept
h
![Page 5: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/5.jpg)
Visualizing the Velocity Model
• Generated by custom Java application– relied on Visualization Toolkit (VTK) for rendering– VTK was developed for rendering 3D visualizations– VTK is supported by Sandia, Los Alamos, ARL, and others
• Writing a custom visualization application:– may rely on third party package to support rendering– may need to perform some transformations on input
dataset before rendering
![Page 6: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/6.jpg)
Visualization Toolkits
• Visualization Toolkit (VTK) was used to render the velocity visualization
• VTK is a toolkit that provides functions such as:– Filtering– Gridding/interpolating– Mapping (i.e., transform data into views like isosurfaces)– Rendering the views
• Functions are referred to as operators– Generic mapping tools (GMT): 60 operators– VTK: hundreds of operators
![Page 7: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/7.jpg)
Visualization Pipeline Model• VTK requires that users write pipelines– the output of an operator feeds into the operator next in
the pipeline sequence– first operator in pipeline is usually data reader– final operator in pipeline is usually renderer
• Thus the Java program that visualizes the velocity model can be seen as a pipeline of VTK operators
• It is up to the users to write these pipelines…
![Page 8: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/8.jpg)
VTK Java Pipeline For Velocity Model
vtkImageReader rdr = new vtkImageReader();rdr.SetFileName(inputDatasetFilePath);rdr.SetDataScalarTypeToUnsignedShort();rdr.SetDataByteOrderToLittleEndian();rdr.SetFileDimensionality(3);rdr.SetDataOrigin(0,0,0);rdr.SetDataSpacing(1,1,1);rdr.SetDataExtent(0,230,0,25,0,68);rdr.SetNumberOfScalarComponents(1);rdr.FileLowerLeftOn();rdr.Update();
vtkContourFilter contours = new vtkContourFilter();contours.SetInput(rdr.GetOutput());contours.GenerateValues(35,0.0,9000.0);
vtkPolyDataMapper contMapper = new vtkPolyDataMapper();contMapper.SetInput(contours.GetOutput());contMapper.SetScalarRange(0.0,9000.0);
vtkActor contActor = new vtkActor();contActor.SetMapper(contMapper);contActor.RotateX(105);
vtkRenderer ren1 = new vtkRenderer();ren1.AddActor(contActor);ren1.AddActor2D(outlineActor);ren1.SetBackground(1,1,1);
vtkRenderWindow renWin = new vtkRenderWindow();renWin.SetOffScreenRendering(1);renWin.AddRenderer(ren1);renWin.SetSize(300,300);renWin.Render();
vtkJPEGWriter img = new vtkJPEGWriter();img.SetInputConnection(renWin.GetOutputPort());img.SetFileName(outputDatasetFilePath);img.SetQuality(100);
![Page 9: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/9.jpg)
Pipeline of Visualization Operators
vtkImageReader rdr = new vtkImageReader();rdr.SetFileName(inputDatasetFilePath);rdr.SetDataScalarTypeToUnsignedShort();rdr.SetDataByteOrderToLittleEndian();rdr.SetFileDimensionality(3);rdr.SetDataOrigin(0,0,0);rdr.SetDataSpacing(1,1,1);rdr.SetDataExtent(0,230,0,25,0,68);rdr.SetNumberOfScalarComponents(1);rdr.FileLowerLeftOn();rdr.Update();
vtkContourFilter contours = new vtkContourFilter();contours.SetInput(rdr.GetOutput());contours.GenerateValues(35,0.0,9000.0);
vtkPolyDataMapper contMapper = new vtkPolyDataMapper();contMapper.SetInput(contours.GetOutput());contMapper.SetScalarRange(0.0,9000.0);
vtkActor contActor = new vtkActor();contActor.SetMapper(contMapper);contActor.RotateX(105);
vtkRenderer ren1 = new vtkRenderer();ren1.AddActor(contActor);ren1.AddActor2D(outlineActor);ren1.SetBackground(1,1,1);
vtkRenderWindow renWin = new vtkRenderWindow();renWin.SetOffScreenRendering(1);renWin.AddRenderer(ren1);renWin.SetSize(300,300);renWin.Render();
vtkJPEGWriter img = new vtkJPEGWriter();img.SetInputConnection(renWin.GetOutputPort());img.SetFileName(outputDatasetFilePath);img.SetQuality(100);
Op 1
Op 2
Op 3
Op 5
Op 6
Op 7
Op 8
![Page 10: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/10.jpg)
Different Types of Operators
vtkImageReader rdr = new vtkImageReader();rdr.SetFileName(inputDatasetFilePath);rdr.SetDataScalarTypeToUnsignedShort();rdr.SetDataByteOrderToLittleEndian();rdr.SetFileDimensionality(3);rdr.SetDataOrigin(0,0,0);rdr.SetDataSpacing(1,1,1);rdr.SetDataExtent(0,230,0,25,0,68);rdr.SetNumberOfScalarComponents(1);rdr.FileLowerLeftOn();rdr.Update();
vtkContourFilter contours = new vtkContourFilter();contours.SetInput(rdr.GetOutput());contours.GenerateValues(35,0.0,9000.0);
vtkPolyDataMapper contMapper = new vtkPolyDataMapper();contMapper.SetInput(contours.GetOutput());contMapper.SetScalarRange(0.0,9000.0);
vtkActor contActor = new vtkActor();contActor.SetMapper(contMapper);contActor.RotateX(105);
vtkRenderer ren1 = new vtkRenderer();ren1.AddActor(contActor);ren1.AddActor2D(outlineActor);ren1.SetBackground(1,1,1);
vtkRenderWindow renWin = new vtkRenderWindow();renWin.SetOffScreenRendering(1);renWin.AddRenderer(ren1);renWin.SetSize(300,300);renWin.Render();
vtkJPEGWriter img = new vtkJPEGWriter();img.SetInputConnection(renWin.GetOutputPort());img.SetFileName(outputDatasetFilePath);img.SetQuality(100);
Op 1
Op 2
Op 3
Op 5
Op 6
Op 7
Op 8
Transformer
View Mapper
Renderer
Transformer
Transformer
Transformer
Transformer
![Page 11: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/11.jpg)
Operators are Parameterized
vtkImageReader rdr = new vtkImageReader();rdr.SetFileName(inputDatasetFilePath);rdr.SetDataScalarTypeToUnsignedShort();rdr.SetDataByteOrderToLittleEndian();rdr.SetFileDimensionality(3);rdr.SetDataOrigin(0,0,0);rdr.SetDataSpacing(1,1,1);rdr.SetDataExtent(0,230,0,25,0,68);rdr.SetNumberOfScalarComponents(1);rdr.FileLowerLeftOn();rdr.Update();
vtkContourFilter contours = new vtkContourFilter();contours.SetInput(rdr.GetOutput());contours.GenerateValues(35,0.0,9000.0);
vtkPolyDataMapper contMapper = new vtkPolyDataMapper();contMapper.SetInput(contours.GetOutput());contMapper.SetScalarRange(0.0,9000.0);
vtkActor contActor = new vtkActor();contActor.SetMapper(contMapper);contActor.RotateX(105);
vtkRenderer ren1 = new vtkRenderer();ren1.AddActor(contActor);ren1.AddActor2D(outlineActor);ren1.SetBackground(1,1,1);
vtkRenderWindow renWin = new vtkRenderWindow();renWin.SetOffScreenRendering(1);renWin.AddRenderer(ren1);renWin.SetSize(300,300);renWin.Render();
vtkJPEGWriter img = new vtkJPEGWriter();img.SetInputConnection(renWin.GetOutputPort());img.SetFileName(outputDatasetFilePath);img.SetQuality(100);
Op 1
Op 2
Op 3
Op 5
Op 6
Op 7
Op 8
P1
P2
P5
P6
P7
P8
P9
P3
P4
![Page 12: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/12.jpg)
Declarative Requests
• Many user skills needed to visualize data• Aside from cognitive aspects of visualization, a large
part of the problem is engineering• Stems from fact that we generate visualizations
imperatively (i.e., write code)
Can we provide a means for users to generate visualizations declaratively
(i.e., generate what visualization they want without having to write code)?
![Page 13: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/13.jpg)
Workshop Summary
1. Generating Visualizations Imperatively2. Visualization Query3. VKQL Syntax and Examples4. Activity 1: Manual Inspection of Query5. Activity 2: Copy and Pasting Examples6. Conclusion
![Page 14: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/14.jpg)
Visualization Query
(AND (hasView ?VIS isosurfaces)(hasContent ?VIS http://vel.3d)(hasFormat ?VIS floatArray)(hasType ?VIS velocityData)(viewedBy ?VIS mozilla-firefox)(hasValue numContours 36))
Desired View URL of Data to visualize
Semantic Type of datasetWDO types (UTEP)
Format of dataset
Parameter Argument Viewer
• The velocity model visualization was actually a result of a visualization query
Requested Visualization
![Page 15: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/15.jpg)
Visualization Queries and SQL
• Visualization queries mirror SQL queries– query request is specified declaratively– request is then translated into a query plan– query plan computes the result requested by the query
• Information specified in visualization queries is used to derive pipelines rather than query plans
• The pipeline in turn generates the visualization requested in the query
![Page 16: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/16.jpg)
Information Needed to Write Queries
• At a minimum you need to know:– The type of your dataset (e.g., gravity, seismic)– The format it is stored in (e.g., netCDF)– The URL of your dataset
• With only above info, all possible visualizations will be returned (wildcard)
• For more control, you need to know:– What view you want (i.e., chart, isolines, volume)– The appropriate values for operator parameters
![Page 17: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/17.jpg)
Workshop Summary
1. Generating Visualizations Imperatively2. Visualization Query3. VKQL Syntax and Examples4. Activity 1: Manual Inspection of Query5. Activity 2: Copy and Pasting Examples6. Conclusion
![Page 18: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/18.jpg)
VKQL Syntax• A conjunction of Prolog statements that
contain:– hasView( -DATA, ?VIEW)– hasContent(-DATA, +URL),– hasType(-DATA, +TYPE),– hasFormat(-DATA, +FORMAT)– [hasValue(+PARAM, +VALUE)]
Variable Name MeaningDATA The requested visualizationVIEW The view (e.g., 2D plot, isolines, volume)URL URL of information to be visualizedTYPE Semantic Type of Data (e.g., gravity, 3DVelocity)FORMAT Format of data (e.g., netCDF, ascii-tabular)PARAM An operator parameterVALUE Argument passed to PARAM
Symbol Meaning
- Unbound
? Optional
+ Required
![Page 19: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/19.jpg)
Workshop Summary
1. Generating Visualizations Imperatively2. Visualization Query3. VKQL Syntax and Examples4. Activity 1: Manual Inspection of Query5. Activity 2: Copy and Pasting Examples6. Conclusion
![Page 20: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/20.jpg)
Activity 1: Manual Inspection of Query
• Navigate to: http://trust.utep.edu/visko/vkql-examples/• Refer to the first query specified on the page:
1. What viewer is the query requesting the system to target?2. What view is the query requesting the system to generate?3. What is the type and format of the dataset being visualized?4. Are there any parameter bindings? If so what is the
parameter bound to?
![Page 21: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/21.jpg)
Workshop Summary
1. Generating Visualizations Imperatively2. Visualization Query3. VKQL Syntax and Examples4. Activity 1: Manual Inspection of Query5. Activity 2: Copy and Pasting Examples6. Conclusion
![Page 22: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/22.jpg)
Submitting VKQL Queries
• VKQL queries can be entered and executed at: http://trust.utep.edu/visko/vkql/
• You can build queries by selecting values from combo boxes
• You can type queries manually in a text box without any guidance or copy and paste an existing query
![Page 23: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/23.jpg)
Activity 2: Pasting Examples
• Navigate to: http://trust.utep.edu/visko/vkql-examples/
• Copy query for: Gridded Time with Rotation• Paste and Submit Query in Query Submission Page• Try manually changing the values assigned to:– xRotation– yRotation– zRotation
• Resubmit with new bindings
![Page 24: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/24.jpg)
Workshop Summary
1. Generating Visualizations Imperatively2. Visualization Query3. VKQL Syntax and Examples4. Activity 1: Manual Inspection of Query5. Activity 2: Copy and Pasting Examples6. Conclusion
![Page 25: Visualization Knowledge Query Language (VKQL) Workshop](https://reader036.fdocuments.net/reader036/viewer/2022062315/568165be550346895dd8bc1a/html5/thumbnails/25.jpg)
Conclusion
• Writing queries may be easier to request for visualization generation than writing imperative code
• VKQL Queries can be constructed a few ways using the VKQL Query Submit interface
• VKQL Queries can target more than a single toolkit for generation