# Presentation: 498376

## SQL HQL:Because SQL Was Already Taken

- Tom Narock
- Todd King
- Jan Merka

## NASA VxO Data Environment

-  Astronomical Community Forms VO

**Notes:**
VxO concept began with the work of the astronomical community.  This work inspired space physics.

## NASA VxO Data Environment

-  Astronomical Community Forms VO

-  Solar Community Forms VSO

**Notes:**
VSO was first space physics VxO and brought NVO concepts to our community.

## NASA VxO Data Environment

-  Astronomical Community Forms VO

-  Solar Community Forms VSO
-  Beginnings of a VHO effort

**Notes:**
A Heliospheric effort followed and development of VxOs continued as grass roots effort. One discipline inspired the other and we had a formal NASA initiative to build 6 discipline specific VxOs.

## NASA VxO Data Environment

- VSO

- VHO

- VMO/G
- VMO/U

- VITMO

- ViRBO

**Notes:**
The current picture. Emphasis on diversity and discipline specific aspects. Hopes of having them communicate with each other but no formal means of accomplishing this -- yet.

## NASA VxO Data Environment

- VSO

- VHO

- VMO/G
- VMO/U

- VITMO

- ViRBO

**Notes:**
Trying to work with all the different interfaces is analogous to the square peg - round hole problem.

## NASA VxO Data Environment

- VSO

- VHO

- VMO/G
- VMO/U

- VITMO

- ViRBO

**Notes:**
We want to avoid the brute force approach.  Also want to avoid the ripple effect. If we try to work with each of 
The varying interfaces then a change in one will ripple out to others - and everyone has to make changes. Too costly to maintain.

## Query Language Solution

- Heliophysics Query Language - HQL
- Standardize How to ask Questions
- Develop Software to Implement Query Language
- Leave VxO Interfaces Intact - Translate between Query Language and VxO interface

**Notes:**
We think a query language is the better approach. Definition of HQL and our 3 steps to accomplishing it.  Last point is discussed in detail on next slide.

## Query Language Solution

- Leave VxO Interfaces Intact - Translate between Query Language and VxO interface

- VxO 1

- VxO 2

- Query
- Language
- Interface

- Query
- Language
- Interface

- Conversion to VxO query mechanism

- Conversion to VxO query mechanism

**Notes:**
Emphasis on last point from previous slide.  Interfaces are unique for a reason - they service a specific community.  We don’t want to change this.  Rather we’d like a small piece of software that can interpret queries (yellow box) and then we work with VxOs to translate query to their native query mechanism (orange box). This way VxO interface to world is always the same.  They may upgrade orange box but yellow is always the same.

## International Collaboration to Develop Space Physics data model

Can Serve as Standard for how to ask questions

Converted to OWL-DL ontology for query language

- Can Serve as Standard for how to ask questions
- Converted to OWL-DL ontology for query language

**Notes:**
Existing efforts such as SPASE can help us define what the common way to ask questions is.  An ontology makes this much easier so had to create one from SPASE schema (1.2)

## Approach

- Formalize an XML Schema using SPASE
- Transport using SOAP or REST
- Compare query with VxO to see if it can be answered
- Return standardized response

**Notes:**
All of the building blocks are present.  We now need to put them together into the foundations of a query language.  This is our approach for developing HQL via SOAP.  Would also like, at some point, to have other implementations such as REST.

## Query Message

**<HQL>**
**      ****<ResourceType    **
**               ****xsi:type="xsd:string">NumericalData</ResourceType>**
**      ****<Qterm ID=“0”>**
**            ****<SPASE     **
**                     ****xsi:type="xsd:string">Heliosphere.NearEarth</SPASE>**
**            ****<SPASE xsi:type="xsd:string">MagneticField</SPASE>**
**      ****</Qterm>**
**      ****<Qterm ID=“1”>**
**            ****<SPASE xsi:type="xsd:string">Component.Z</SPASE>**
**            ****<SPASE xsi:type="xsd:string">GSE</SPASE>**
**            ****<QueryUnits xsi:type="xsd:string">nT</QueryUnits>**
**            ****<LT xsi:type="xsd:int">0</LT>**
**      ****</Qterm>**
** ****</HQL>**

**Notes:**
An example HQL query.  Discussed in detail on next two slides.

## Query Message

**<HQL>**
**      ****<ResourceType    **
**               ****xsi:type="xsd:string">NumericalData</ResourceType>**
**      ****<Qterm ID=“0”>**
**            ****<SPASE     **
**                     ****xsi:type="xsd:string">Heliosphere.NearEarth</SPASE>**
**            ****<SPASE xsi:type="xsd:string">MagneticField</SPASE>**
**      ****</Qterm>**
**      ****<Qterm>**
**            ****<ID xsi:type="xsd:int">1</ID>**
**            ****<SPASE xsi:type="xsd:string">Component.Z</SPASE>**
**            ****<SPASE xsi:type="xsd:string">GSE</SPASE>**
**            ****<QueryUnits xsi:type="xsd:string">nT</QueryUnits>**
**            ****<LT xsi:type="xsd:int">0</LT>**
**      ****</Qterm>**
** ****</HQL>**

- Divide query into components and are able to distinguish which parts we can and can not answer

**Notes:**
Use qterms to break the message up into manageable pieces.  This way a VxO can answer what it can and ignore the rest.  Allows the query language to ask both simple and complex questions.

## Query Message

**<HQL>**
**      ****<ResourceType    **
**               ****xsi:type="xsd:string">NumericalData</ResourceType>**
**      ****<Qterm ID=“0”>**
**            ****<SPASE     **
**                     ****xsi:type="xsd:string">Heliosphere.NearEarth</SPASE>**
**            ****<SPASE xsi:type="xsd:string">MagneticField</SPASE>**
**      ****</Qterm>**
**      ****<Qterm>**
**            ****<ID xsi:type="xsd:int">1</ID>**
**            ****<SPASE xsi:type="xsd:string">Component.Z</SPASE>**
**            ****<SPASE xsi:type="xsd:string">GSE</SPASE>**
**            ****<QueryUnits xsi:type="xsd:string">nT</QueryUnits>**
**            ****<LT xsi:type="xsd:int">0</LT>**
**      ****</Qterm>**
** ****</HQL>**

- Ask for data using standardized terms

**Notes:**
Use of SPASE terms standardizes the way we ask for things.

## Processing Query

- OWL-S

- SPASE ontology

- VxO

- Provides Description of VxO capabilities in SPASE terms

- OWLS-MX

- Software Library uses ontology to compare query with VxO OWL-S file(s)

- Klusch, M. et. al. 2006.

**Notes:**
How the processing actually works.  OWL-S file is an XML description of what SPASE terms the VxO can handle (essentially a config file).  Each qterm is compared to the capabilities of the VxO via the ontology and open source software (OWLS-MX). This determines if the VxO can answer that qterm.

## Implementing Query

- If OWLS-MX finds match we pass information to be translated and executed
- If not - Qterm is flagged in response message

**Notes:**
If the VxO can answer the qterm it is left in a standarized format for the VxO to translate and execute.  If not it’s flagged in the response message but otherwise ignored.

## Current Status

- Nearly Complete Prototype Implementation
- Will be validating using VHO and VMO
- Will collaborate with other VxOs

**Notes:**
Have almost finished a working prototype of this demonstrating that it can work.  Since we have access to both VHO and two VMOs we can use them to validate the use of HQL.  Will continue to keep other VxOs and SPASE involved along the way.

## Current Status

- Nearly Complete Prototype Implementation
- Will be validating using VHO and VMO
- Will collaborate with other VxOs

- The least flexible component of any system is the user.
- -Lowell Jay Arthur

**Notes:**
Have to keep in mind your users!! Communication with other VxOs is key.

## Future Directions

- OWLS-MX capable of working with more than one ontology simultaneously
- Allows for use of additional data models in addition to SPASE
- This can allow for query language to be used by non-SPASE speaking VxOs

**Notes:**
One nice benefit of this software is that it’s capable of using multiple data models simultaneously.  Thus we could indicate we are using a different data model and query non-SPASE VxOs.  An area to explore as this moves forward.

## Take Home Message

- This is not a final solution
- Start a dialogue within our community and explore what other groups are doing