# Presentation: 563801

## Building a caGrid Node

## Getting Started

**This course is self-paced, but is also hands-on. Therefore, you will need to download an accompanying code base to complete the exercises associated with this course.**
**The code base can be downloaded from:**
- _[http://pir.georgetown.edu/~suzek/caBIG_Bootcamp_July2008/gridPIR_Training.zip](http://pir.georgetown.edu/~suzek/caBIG_Bootcamp_July2008/gridPIR_Training.zip)_
** ****From the download:**
- 1) Copy gridPIR_Training.zip to "C:\“ on your machine
- 2) Unzip gridPIR_Training.zip (overwrite existing files if needed)
**** Do not proceed with this course, until you have downloaded and unzipped the above files. You will not be able to complete the exercises without this zip file.****

## Session Goals

- By the end of this session, you will be able to:
- Use Introduce to create a node on the Grid
- More specifically:
- Install a public data service on caGrid (no security)
- Deploy a data service using caCORE SDK-generated artifacts and the Introduce toolkit
- Use caGrid Data Services
- Use caGrid Metadata Service APIs
- Use caGrid for Semantic Interoperability

## Lessons

- Lesson 1: Installing caGrid for Data Service Deployment
- Lesson 2: Deploying a caGrid Data Service
- Lesson 3: Using caGrid Data Services
- Lesson 4: Using caGrid Metadata Service APIs
- Lesson 5: Using caGrid for Semantic Interoperability

## Lesson 1: Installing caGrid for Data Service Deployment

**Notes:**
Session III we cover

caGrid Node Installation (prerequsite)
Data Service Deployment on caGrid
Using caGrid data service API
Using caGrid Metadata APIs

## Lesson 1: Installing caGrid for Data Service DeploymentOverview

**In this Lesson, we will cover:**
- caGrid Overview
- Steps involved in caGrid installation
**There will be an exercise to install caGrid 1.2 on a Windows machine**

## Lesson 1: Installing caGrid for Data Service Deployment Outline

- Overview
- caGrid
- caGrid Infrastructure
- Step-by-step caGrid Installation for Data Service Deployment

## Lesson 1: Installing caGrid for Data Service Deployment What is caGrid?

- Development project of Architecture Workspace
- Service oriented infrastructure that supports caBIG
- An architecture that allows building a grid of your own
- Enables collaborating institutions to share information and analytical resources efficiently and securely

## Lesson 1: Installing caGrid for Data Service Deployment caGrid Community Involvement

- caGrid itself provides no real “data” or “analysis” to caBIGTM; its the enabling infrastructure which allows the community to develop
- Analytical Services
- Data Services
- Community members add value to the grid as applications, services (data/analytical), and processes
- caGrid provides the necessary core services, APIs, and tooling
- Community members develop end user applications/clients which consume the resources provided on the grid

**Notes:**
The real “value” of the grid comes from bringing this information to the “end user”

## Lesson 1: Installing caGrid for Data Service Deployment caGrid Infrastructure

**Client and service APIs are object oriented**, and operate over well-defined and **curated data types**
**Objects are defined in UML** and converted into ISO/IEC 11179 Administered Components, which are in turn registered in the **Cancer Data Standards Repository (caDSR)**
**Object definitions are drawn from controlled terminology **and the vocabulary is registered in the **Enterprise Vocabulary Services (EVS),** and their relationships are thus semantically described
**Objects** **are serialized to XML **that adhere to XML schemas registered in the **Global Model Exchange (GME)**

**Notes:**
Up here you see three of the core services.
Down hear you see the Grid Service 

## Lesson 1: Installing caGrid for Data Service Deployment caGrid Infrastructure – cont’d

**Service and the hosting center metadata** is registered in **Index Service**

## Lesson 1: Installing caGrid for Data Service Deployment caGrid Installation: Before starting  

- Dowload caGrid 1.2 Installer
- _[http://gforge.nci.nih.gov/frs/download.php/3738/caGrid-installer-1.2.zip](http://gforge.nci.nih.gov/frs/download.php/3738/caGrid-installer-1.2.zip)_
- Setting environment variables
- JAVA_HOME : Location of  Java JDK 1.5.X
- ANT_HOME: Location of Ant 1.6.5
- CATALINA_HOME: Location of Tomcat ver. 5.0.28
- GLOBUS_LOCATION: Location of Globus Toolkit ver. 4.0.3
- 	If not available, caGrid Installer installs Ant, Globus Toolkit and/or Tomcat
- Unzip caGrid-installer-1.2.zip
- Run caGrid installer:
**java -jar caGrid-installer-1.2.jar**

## Lesson 1: Installing caGrid for Data Service Deployment caGrid Installation: License Agreement

## Lesson 1: Installing caGrid for Data Service Deployment caGrid Installation: Installation Types

- Choose any combination of installation types to install one or more caGrid components
- For data service deployment, choose options “Install caGrid” and “Configure Container”
- Not a “secure” installation since our data service is public; additional steps such as securing container is required for a secure caGrid node

## Lesson 1: Installing caGrid for Data Service Deployment caGrid Installation: Service Container

- Choose Tomcat or Globus as service containers

## Lesson 1: Installing caGrid for Data Service Deployment caGrid Installation: Prerequisites

- Install (or reinstall) prerequisite software

- Ant

- Tomcat

- Globus Toolkit

## Lesson 1: Installing caGrid for Data Service Deployment caGrid Installation: Location

- Provide the directory where caGrid will be installed

## Lesson 1: Installing caGrid for Data Service Deployment caGrid Installation: Target Grid 

- Each target grid basically uses different URLs for caGrid core services. For instance service URLs for OSU Training Grid are:
- cagrid.master.index.service.url=http://training03.cagrid.org:6080/wsrf/services/DefaultIndexService
- cagrid.master.cadsr.service.url=http://training02.cagrid.org:6080/wsrf/services/cagrid/CaDSRService
- cagrid.master.gme.service.url=http://training02.cagrid.org:6080/wsrf/services/cagrid/GlobalModelExchange
- cagrid.master.gridgrouper.service.url=https://training03.cagrid.org:6443/wsrf/services/cagrid/GridGrouper
- cagrid.master.dorian.service.url=https://dorian.cagrid.org:6443/wsrf/services/cagrid/Dorian

- Choose one of the available grids:
- NCICB Development
- NCICB Production
- NCICB QA
- OSU Development
- OSU Training
- and more

## Lesson 1: Installing caGrid for Data Service Deployment caGrid Installation: Container Configuration

- Securing container is needed to host secure services.
- Secure services are those that require clients to use one of the Globus Security Infrastructure (GSI) authentication mechanisms.

## Lesson 1: Installing caGrid for Data Service Deployment caGrid Installation: Completion

## Lesson 1: Installing caGrid for Data Service Deployment Additional Information

- caGrid Wiki:
- _[http://www.cagrid.org/mwiki/index.php?title=CaGrid](http://www.cagrid.org/mwiki/index.php?title=CaGrid)_
- caBIGTM Architecture WS caGrid Web Page:
- _[https://cabig.nci.nih.gov/workspaces/Architecture/caGrid/](https://cabig.nci.nih.gov/workspaces/Architecture/caGrid/)_

## Lesson 1: Installing caGrid for Data Service Deployment Exercise

- Install a caGrid 1.2 on your local machine using instructions located** **at:
- 	_[https://gforge.nci.nih.gov/docman/view.php/196/13043/01_Installing_caGrid.doc](https://gforge.nci.nih.gov/docman/view.php/196/13043/01_Installing_caGrid.doc)_

## Lesson 2: Deploying a caGrid Data Service

**Notes:**
Data Service Deployment on caGrid

## Lesson 2: Deploying a caGrid Data ServiceOverview

**In this Lesson, we will cover:**
- Steps involved in deployment/creation of caGrid Data Service using caCORE SDK 3.2.1 generated artifacts
- Selecting type of service and template
- Selecting domain model
- Selecting the schema
- Providing metadata (hosting site/POC etc)
- Deploying the service
**There will be exercises to create and deploy gridPIR on local caGrid node**

## Lesson 2: Deploying a caGrid Data Service Outline

- Overview
- Major steps for deployment
- Introduce Toolkit
- Step-by-step deployment of a Data Service; gridPIR

## Lesson 2: Deploying a caGrid Data Service caGrid Data Service Deployment – Major steps

**Provide client and service APIs that are object oriented**
**Provide objects that are defined in UML** and registered in the Cancer Data Standards Repository (caDSR)
**Provide object definitions drawn from controlled terminology and vocabulary** registered in the Enterprise Vocabulary Services (EVS)
**Provide XML schemas used for XML serialization of objects **that are registered in the Global Model Exchange (GME)

## Lesson 2: Deploying a caGrid Data Service caGrid Data Service Deployment – Major steps

**Provide  service metadata about the service and the center **where service is deployed

## Lesson 2: Deploying a caGrid Data Service Service Metadata (Domain Model Portion)

-  <ns135:**UMLAttribute** **dataTypeName**="CHARACTER" **description**="UniProtKB primary accession number." **name**="uniprotkbPrimaryAccession" **publicID**="2322254" **version**="1.0">
-      <ns135:SemanticMetadata **conceptCode**="C25402" **conceptDefinition**="A control number unique .....” **conceptName**="Accession Number" order="1"/>
- 	.....
-       <ns135:**ValueDomain longName**="Protein UniProtKB Primary Accession Number Genomic Identifier">
-       <ns135:**enumerationCollection**/>
-      </ns135:ValueDomain>
-  </ns135:UMLAttribute>

**Notes:**
Just to shed some light on what ServiceMetadata looks like
The aggregated information is stored as service metadata. Here is the domain model portion of the service data.
For an attribute it stores data type, CDE information, concept information and value domain information.

## Lesson 2: Deploying a caGrid Data Service Introduce: Grid Service Authoring Toolkit 

- An open-source and extensible toolkit
- Supports easy development and deployment of WS/WSRF compliant Grid services by hiding low level details of the Globus Toolkit
- Enables the implementation of strongly-typed Grid services
- Facilitates caGrid data service development using caCORE SDK artifacts through pluggable service styles

## Lesson 2: Deploying a caGrid Data Service Grid-enablement of Protein Information Resource (gridPIR)

- A _data service_ to provide comprehensive and fully annotated protein related information for genomic and proteomic cancer research
- Developed using model driven approach and _caCORE SDK 3.2.1 _
- All data is public so _no security layer_ implemented

**Notes:**
Following screenshots may change with newer version of Introduce/caGrid but idea of deployment will remain the same.

## Lesson 2: Deploying a caGrid Data Service Introduce: Create a caGrid Service

**ant introduce **

- Modify an existing service

- Deploy an existing service

- Browse Data Types from caDSR or GME

## Lesson 2: Deploying a caGrid Data Service Introduce: Enter service information

**Lesson 2: Deploying a caGrid Data Service ****Introduce: Enter service information**

- An analytical service exposes operation(s) with input/output objects
- A data service exposes objects that presents the data resource

## Lesson 2: Deploying a caGrid Data Service Introduce: Data Service Configuration

**Lesson 2: Deploying a caGrid Data Service ****Introduce: Data Service Configuration**

- Different Service Styles (including caCORE SDK) supported.
- gridPIR is generated using caCORE SDK v3.2.1

- Optional extensions for Bulk Data Transfer or Web Services Enumeration

## Lesson 2: Deploying a caGrid Data Service Introduce: caCORE SDK-generated Client Selection  

**Two options for client selection:**
**Option 1:** **Use remote API** if data service caCORE-like system (API) and caGrid Data Service are on the _different_ machines
**Option 2:** **Use local API** if both caCORE-like system (API) and caGrid Data Service are deployed on _the same_ machine

## Lesson 2: Deploying a caGrid Data Service Introduce: Remote API Selection (Option 1)

**Library folder (including client jar) generated by caCORE SDK**

**Notes:**
Local API if the service and caCORE SDK generated API are on the same machine.

## Introduce: Remote API Selection(Option 1) (cont’d)

**Lesson 2: Deploying a caGrid Data Service **
**Introduce: Remote API Selection****(Option 1) (cont’d)**

**Treat all queries case-insensitive**

**Use Common Security Module**

**Enter URL for remote caCORE-like gridPIR API (publicly accessible)**

**Notes:**
CSM 
Authentication - Validating and verifying a user’s credentials to allow access to an application. 
Authorization - Granting access to data, methods, and objects. 

## Lesson 2: Deploying a caGrid Data Service Introduce: Local API Selection (Option 2)

**Lesson 2: Deploying a caGrid Data Service ****Introduce: Local API Selection ****(Option 2)**

**Library (including client jar) and configuration folders are generated by caCORE SDK**

## Lesson 2: Deploying a caGrid Data Service Introduce: Local API Selection (Option 2)(cont’d)

**Treat all queries case-insensitive**

## Lesson 2: Deploying a caGrid Data Service Introduce: Choose objects (model) service exposes

**Lesson 2: Deploying a caGrid Data Service ****Introduce: Choose objects (model) service exposes**

**4. Add selected packages**

**1. Fetch models from caDSR**

**2. Select gridPIR model v1.2**

**3. Select package from gridPIR model **

**Notes:**
Fetching from caDSR is one of several options.

## Lesson 2: Deploying a caGrid Data Service Introduce: Choose XML Schema 

**Find schemas from GME (if registered) **
**OR**
**Resolve schemas manually**

## Lesson 2: Deploying a caGrid Data Service Introduce: Choose XML Schema – Manual Resolution (cont’d)

**Lesson 2: Deploying a caGrid Data Service ****Introduce: Choose XML Schema – Manual Resolution (cont’d)**

**XSD generated by caCORE SDK**

## Lesson 2: Deploying a caGrid Data Service Introduce: Enter Service Description

**1. Select Metadata Tab**

**2. Select ServiceMetadata row**

**3. Edit Property**

## Lesson 2: Deploying a caGrid Data Service Introduce: Enter Service Metadata (cont’d)

- Enter:
-   POC
-   Hosting Center
-   Address

## Lesson 2: Deploying a caGrid Data Service Introduce: Deploy gridPIR Data Service

- Deploy an existing service

## Lesson 2: Deploying a caGrid Data Service Introduce: Select Data Service Location in the File System

- Compiled service stubs

- Metadata files

- Library files

- XML schemas

- Source code for service stubs

## Lesson 2: Deploying a caGrid Data Service Introduce: Select Data Service Location in the File System

**Container information**

**Register to Index Service?**

**URL for Index Service**

## Lesson 2: Deploying a caGrid Data Service Verify Deployment

**URL for deployed service**

## Lesson 2: Deploying a caGrid Data Service Additional Information

- caGrid Wiki:
- _[http://www.cagrid.org/mwiki/index.php?title=CaGrid](http://www.cagrid.org/mwiki/index.php?title=CaGrid)_
- Introduce Toolkit Wiki:
- _[http://www.cagrid.org/mwiki/index.php?title=Introduce](http://www.cagrid.org/mwiki/index.php?title=Introduce)_
- caGrid Data Services Wiki:
- _[http://www.cagrid.org/mwiki/index.php?title=Data_Services](http://www.cagrid.org/mwiki/index.php?title=Data_Services)_
- caBIGTM Architecture WS caGrid Web Page:
- _[https://cabig.nci.nih.gov/workspaces/Architecture/caGrid/](https://cabig.nci.nih.gov/workspaces/Architecture/caGrid/)_

## Lesson 2: Deploying a caGrid Data Service Exercise

- Deploy a caGrid data service for gridPIR on your local machine using instructions located at:
- 	_[https://gforge.nci.nih.gov/docman/view.php/196/13044/02_Creating_caGrid_Node.doc](https://gforge.nci.nih.gov/docman/view.php/196/13044/02_Creating_caGrid_Node.doc)_
- 	and
- 	_[https://gforge.nci.nih.gov/docman/view.php/196/13045/03_Deploying_caGrid_Node.doc](https://gforge.nci.nih.gov/docman/view.php/196/13045/03_Deploying_caGrid_Node.doc)_

## Lesson 3: Using caGrid Data ServicesOverview

**In this Lesson, we will cover:**
- Ways to query data services
- Creating and running queries in caBIG Query Language (CQL)
**There will be exercise to create and run CQL queries using command line against gridPIR production.**

## Lesson 3: Using caGrid Data Services Outline

- Overview
- CQL
- Using caGrid Portal
- Using Generic Data Service Client
- CQL examples using gridPIR Data Service

## Lesson 3: Using caGrid Data Services Executing a Data Service Query 

- Query

- Results

**Notes:**
For any data service user sends a CQL Query document to the data service. This invokes the exposed query method on service, translated to native query language such as SQL/HQL
Results are transformed/serialized into a CQL result file. User processes the results

## Lesson 3: Using caGrid Data Services caBIG Query Language (CQL)

**CQL Query**: A simple wrapper element at the head of every CQL query document., contains the target.

**Target** : The Target element is of the type Object, and describes the data type which the query will return.

**Object**: Contains the required attribute ‘name.’ This attribute’s value defines the caDSR class of the object. When the Object is the top level target of a CQL query, it identifies the data type that will be returned by the caGrid Data Service. The Object allows for a choice between three child elements. The possible child elements are Attribute, Association, and Group. Objects may have at most one of these child elements. Groups also have an attribute ‘**logicOperator**,’ an enumeration of the values “**AND**” and “**OR**.”

## Lesson 3: Using caGrid Data Services caGrid Portal

_**[http://cagrid-portal.nci.nih.gov/](http://cagrid-portal.nci.nih.gov/)**_

## Lesson 3: Using caGrid Data Services caGrid Portal

**Discovery**

**Data Service Query**

**Portal Allows**
**Discovery **
**Exploration of:**
- Domain Models
- Service Contexts
- Semantic Metadata
- Host Centers
**Data Queries**
**Example:**Query on Gene Objects

**Lesson 3: Using caGrid Data Services ****caGrid Portal**

**Notes:**
Portal allows discovery and queries

Lets query GridPIR for some gene objects, first select the object gene

## Lesson 3: Using caGrid Data Services caGrid Portal

**Lesson 3: Using caGrid Data Services ****caGrid Portal**

**Notes:**
Animation on slide

## Lesson 3: Using caGrid Data Services caGrid Portal

**Lesson 3: Using caGrid Data Services ****caGrid Portal**

## Lesson 3: Using caGrid Data Services caGrid Portal

- See Query and Results as XML

**Lesson 3: Using caGrid Data Services ****caGrid Portal**

## Lesson 3: Using caGrid Data ServicesGeneric Data Service Client

**Can be used for caGrid data services that are based on caCORE-like systems since such services expose only the query method in its public API**
**For services that have additional methods other than query, specific clients generated by the Introduce Toolkit needs to be used**
**Typically query involves three steps**
- Initialization
- Creating and submitting a CQL query
- Processing the results

## Lesson 3: Using caGrid Data Services Generic Data Service Client: Initializing the Client

**For gridPIR Data Service:**
- String serviceURL="http://141.161.25.20:8080/wsrf/services/cagrid/GridPIR";
- DataServiceClient client=new DataServiceClient(serviceURL);

## Lesson 3: Using caGrid Data Services Generic Data Service Client: Creating a CQL Query

**Option 1: Create CQLQuery object programmatically:**** **
**	**
**//**CQL query to retrieve all BRCA1 genes
**	**
- CQLQuery query = new CQLQuery();
- Object target = new Object();
- target.setName(**Gene**.class.getName());
- Attribute nameAttribute = new Attribute(“**name**", **Predicate.EQUAL_TO**, “**BRCA1**");
- target.setAttribute(nameAttribute);
- query.setTarget(target);

## Lesson 3: Using caGrid Data Services Generic Data Service Client: Creating a CQL Query

**Option 2: Load CQLQuery object from an XML file or string:**
**// from a string **
- CQLQuery query2 = (CQLQuery) Utils.deserializeObject( new StringReader(“
- <ns1:CQLQuery xmlns:ns1="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
-  <ns1:Target name="**edu.georgetown.pir.domain.Gene**">
-    <ns1:Attribute name="**name**" predicate="**EQUAL_TO**" value="**brca1**"/>
-  </ns1:Target>
- </ns1:CQLQuery>
- "), CQLQuery.class);
**// from a file **
- CQLQuery query3 = (CQLQuery) Utils.deserializeObject( new FileReader(cqlFile), CQLQuery.class);

## Lesson 3: Using caGrid Data Services Generic Data Service Client: Submitting the CQL Query

**Results are returned as CQLQueryResults object:**
- 	try {
- 	**CQLQueryResults results = client.query(query);**
- } catch (QueryProcessingExceptionType ex) {
- 	// handle processing exception
- } catch (MalformedQueryExceptionType ex) {
- 	// handle malformed query
- } catch (RemoteException ex) {
- 	 // handle remote exception
- }

## Lesson 3: Using caGrid Data Services Generic Data Service Client: Processing the Results

**Option 1:** Results can be iterated as single items using a specialized implementation of the standard Java Iterator interface CQLQueryResultsIterator:
- Iterator iter = new **CQLQueryResultsIterator**(results,
**GridPIRClient.**class.getResourceAsStream("client-config.wsdd"));
- while (iter.hasNext()) {
- 	**Gene** gene = (Gene) iter.next();
- 	System.out.println(g.**getName**());
- }** **

## Lesson 3: Using caGrid Data Services Generic Data Service Client: Processing the Results

**Option 2: ** Results can be serialized to a string (or file for future processing) :
- StringWriter w = new StringWriter();
- Utils.**serializeObject**(
-  results,
-  new QName("http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLResultSet", "CQLResultSet“),
-  w);
- System.out.println(w.getBuffer());

## Find Gene objects for gene name "BRCA1“:

<ns1:CQLQuery xmlns:ns1="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
 <ns1:Target name="edu.georgetown.pir.domain.Gene">
   <ns1:Attribute name="name" predicate="EQUAL_TO" value="brca1"/>
 </ns1:Target>
</ns1:CQLQuery>

- <ns1:CQLQuery xmlns:ns1="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
-  <ns1:Target name="**edu.georgetown.pir.domain.Gene**">
-    <ns1:Attribute name="**name**" predicate="**EQUAL_TO**" value="**brca1**"/>
-  </ns1:Target>
- </ns1:CQLQuery>

**Lesson 3: Using caGrid Data Services**** ****CQL Example 1 : Search Criteria and Target are from the Same Class**

## Results:

**Lesson 3: Using caGrid Data Services**** ****CQL Example 1: Search Criteria and Target are from the Same Class**

## Find Protein objects for Breast cancer 1 gene (BRCA1):

<ns1:CQLQuery xmlns:ns1="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
 <ns1:Target name="edu.georgetown.pir.domain.Protein">
     <ns1:Association name="edu.georgetown.pir.domain.Gene“ roleName="geneCollection">
        <ns1:Attribute name="name" predicate="EQUAL_TO" value="brca1"/>
     </ns1:Association>
 </ns1:Target>
</ns1:CQLQuery>

- <ns1:CQLQuery xmlns:ns1="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
-  <ns1:Target name="**edu.georgetown.pir.domain.Protein**">
-      <ns1:Association name="**edu.georgetown.pir.domain.Gene**“ roleName="**geneCollection**">
-         <ns1:Attribute name="**name**" predicate="**EQUAL_TO**" value="**brca1**"/>
-      </ns1:Association>
-  </ns1:Target>
- </ns1:CQLQuery>

**Lesson 3: Using caGrid Data Services ****CQL Example 2 : Query involving Two Associated Classes**

## Results:

**Lesson 3: Using caGrid Data Services ****CQL Example 2 : Query involving Two Associated Classes**

## Results include BRCA1 from “African clawed frog”, “Green puffer” and many more

What if we want to restrict it to Human BRCA1?

- What if we want to restrict it to Human BRCA1?

**Lesson 3: Using caGrid Data Services ****CQL Example 2 : Query involving Two Associated Classes**

## Find Protein objects for Human Breast cancer 1 (BRCA1):

<ns1:CQLQuery xmlns:ns1="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
 <ns1:Target name="edu.georgetown.pir.domain.Protein">
    <ns1:Group logicRelation="AND">
     <ns1:Association name="edu.georgetown.pir.domain.Gene"  roleName="geneCollection">
        <ns1:Attribute name="name" predicate="EQUAL_TO" value="brca1"/>
     </ns1:Association>
     <ns1:Association name="edu.georgetown.pir.domain.Organism“ roleName="organismCollection">
        <ns1:Attribute name="scientificName" predicate="EQUAL_TO" value="homo sapiens"/>
     </ns1:Association>
    </ns1:Group>
 </ns1:Target>
</ns1:CQLQuery>

- <ns1:CQLQuery xmlns:ns1="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
-  <ns1:Target name="**edu.georgetown.pir.domain.Protein**">
-     <ns1:Group logicRelation="**AND**">
-      <ns1:Association name="**edu.georgetown.pir.domain.Gene**"  roleName="**geneCollection**">
-         <ns1:Attribute name="**name**" predicate="**EQUAL_TO**" value="**brca1**"/>
-      </ns1:Association>
-      <ns1:Association name="**edu.georgetown.pir.domain.Organism**“ roleName="**organismCollection**">
-         <ns1:Attribute name="**scientificName**" predicate="**EQUAL_TO**" value="**homo sapiens**"/>
-      </ns1:Association>
-     </ns1:Group>
-  </ns1:Target>
- </ns1:CQLQuery>

**Lesson 3: Using caGrid Data Services****CQL Example 3 : Query involving Three Classes**

## Lesson 3: Using caGrid Data Services CQL Example 3 : Query Involving Three Classes

- Results**:**

## Lesson 3: Using caGrid Data Services CQL Example 3 : Query Involving Three Associated Classes

- From Example 2, results include BRCA1 from “African clawed frog”, “Green puffer” and many more
- Is there a way to find what other organisms have a gene named BRCA1?

## Lesson 3: Using caGrid Data Services CQL Example 4 : Query an Information Space Traversal Path 

- Find organisms that contain a gene named BRCA1:
- <ns1:CQLQuery xmlns:ns1="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
-  <ns1:Target name="**edu.georgetown.pir.domain.Organism**">
-    <ns1:Association name="**edu.georgetown.pir.domain.Protein**" roleName="**proteinCollection**">
-      <ns1:Association name="**edu.georgetown.pir.domain.Gene**" roleName="**geneCollection**">
-        <ns1:Attribute name="**name**" predicate="**EQUAL_TO**" value="**brca1**"/>
-      </ns1:Association>
-    </ns1:Association>
-  </ns1:Target>
- </ns1:CQLQuery>

## Results:

**Lesson 3: Using caGrid Data Services ****CQL Example 4 : Query an Information Space Traversal Path **

## Lesson 3: Using caGrid Data Services Additional Information	

**caGrid Data Services Wiki:**
**	**_**[http://www.cagrid.org/mwiki/index.php?title=Data_Services](http://www.cagrid.org/mwiki/index.php?title=Data_Services)**_
**caGrid Data Service Client API Wiki:**
**	**_**[http://www.cagrid.org/mwiki/index.php?title=Data_Services:Client_API](http://www.cagrid.org/mwiki/index.php?title=Data_Services:Client_API)**_** **
**CQL Wiki:**
**	**_**[http://www.cagrid.org/mwiki/index.php?title=Data_Services:CQL](http://www.cagrid.org/mwiki/index.php?title=Data_Services:CQL)**_** **

## Lesson 3: Using caGrid Data Services Exercise

- Query gridPIR data service using instructions located at:
- _[https://gforge.nci.nih.gov/docman/view.php/196/13046/04_Using_caGrid_Data_Service.doc](https://gforge.nci.nih.gov/docman/view.php/196/13046/04_Using_caGrid_Data_Service.doc)_
- BONUS: Write/run one additional CQL query to search for proteins that has a “Zinc Finger Region”

## Lesson 4: Using caGrid Metadata Service APIsOverview

**In this Lesson, we will cover:**
- Metadata APIs including caDSR/EVS/Discovery
- Metadata Utils
**There will be exercises to run/modify command line versions of each API call**

## Lesson 4: Using caGrid Metadata Service APIs Outline

- Overview
- caGrid Metadata Service APIs
- caDSR Service API
- EVS Service API
- Discovery API
- MetadataUtils

## Lesson 4: Using caGrid Metadata Service APIs caGrid Data Service Metadata Overview - gridPIR

- UML Modeling

- Semantic Annotation using EVS concepts

- caDSR Load/CDE Creation

- EVS Concept Codes

- CDE Public ID/version

- UML Class/attribute

- CDE Long Name

**Notes:**
You will see in the afternoon and heard in Silver Level Compatibility 
Every system needs to have a UML model descriptive enough
All the attributes and classes for this system is annotated using terms/concepts from Enterprise Vocabulary System
The information model is registered in cancer data standards reporsitory and transformed to common data elements. 
For now consider each class/attribute/data type tuple corresponds to a CDE. Each CDE has a public ID.

## Lesson 4: Using caGrid Metadata Service APIs Metadata Services on caGrid - caDSR

## Lesson 4: Using caGrid Metadata Service APIs caDSR Grid Service API Client

**Provides access to information in the caDSR such as semantically annotated UML model as registered in caDSR**
**Has capability to generate caGrid standard metadata instances such as domain models **

## Lesson 4: Using caGrid Metadata Service APIs caDSR Grid Service API Client - Operations

**Provides access to the UML-like view of caDSR registered items:**
*findAllProjects*
*findPackagesInProject*
*findClassesInPackage*
*findAttributesInClass*
**Enables clients to generate caGrid standard Data Service metadata:**
*generateDomainModelForProject*
*generateDomainModelForPackage*
*generateDomainModelForClasse*s
*generateDomainModelForClassesWithExcludes*
**Provides clients the ability to augment a *****ServiceMetadata***** (standard caGrid service metadata) skeleton instance with the information extracted from caDSR**
*annotateServiceMetadata*

## Lesson 4: Using caGrid Metadata Service APIs caDSR Grid Service API Client – Retrieving List of Projects from caDSR

**//caDSR service on production caGrid**
**String serviceURL=**_**[http://cagrid-service.nci.nih.gov:8080/wsrf/services/cagrid/CaDSRService](http://cagrid-service.nci.nih.gov:8080/wsrf/services/cagrid/CaDSRService)**_**;**
**// create a caDSRServiceClient instance**
**CaDSRServiceClient client = new CaDSRServiceClient(serviceURL);**
**// get list of projects from caDSR**
**Project[] projects = client.****findAllProjects()****;**
**//processing results**
**for (int i = 0; i < projects.length; i++) {**
**	****Project p = projects[i];**
**	****System.out.println(i+" Short name:"+p.****getShortName****()+" / Long name:"+p****.getLongName****());**

**Notes:**
As any other service API client needs an instance needs to be created

## Result:

**Lesson 4: Using caGrid Metadata Service APIs ****caDSR Grid Service API Client – Retrieving List of Projects from caDSR**

## Lesson 4: Using caGrid Metadata Service APIs caDSR Grid Service API Client – Retrieve Classes/Attributes Registered for gridPIR

** ****// Retrieve the list of classes for a registered model **
**UMLClassMetadata[] classArray= client.**_**findClassesInProject(gridPIRProject)**_**;**
**        **
**// Retrieve the list of attributes for a class**
**UMLAttributeMetadata[] attributeArray= client.****findAttributesInClass(gridPIRProject,classArray[i]);**
**// Retrieve the value domain for an attribute**
**ValueDomain valueDomain=client.****findValueDomainForAttribute(gridPIRProject,attributeArray[j]);**
**        ****	****	****	****	****      ****	****	****	****	****	**

## Lesson 4: Using caGrid Metadata Service APIs caDSR Grid Service API Client – Retrieving Classes/Attributes Registered for gridPIR

**Result:**

## Lesson 4: Using caGrid Metadata Service APIs Metadata Services on caGrid – Enterprise Vocabulary Services (EVS)

## Lesson 4: Using caGrid Metadata Service APIs EVS Grid Service API Client

**Provides information on vocabularies and terms/ concepts presented by the NCI Metathesaurus/ Thesaurus **

## Lesson 4: Using caGrid Metadata Service APIs EVS Grid Service API Client - Methods

**Provides a list of programmatically accessible vocabularies**
*getVocabularyNames*
**Provides access to concepts/terms from the vocabularies **
*searchDescLogicConcept*
**Provides complete *****History***** for concepts; the evolution of the concept as they are created, merged, modified, split, or retired. **
*getHistoryRecords*
**Provides access to concepts that are supported by the NCI Metathesaurus**
*searchMetaThesaurus*
*searchSourceByCode*

## Lesson 4: Using caGrid Metadata Service APIs EVS Grid Service API Client – Retrieve EVS Vocabulary List

**//URL for production grid EVS Grid Service **
**String serviceURL="**_**[http://cagrid-service.nci.nih.gov:8080/wsrf/services/cagrid/EVSGridService](http://cagrid-service.nci.nih.gov:8080/wsrf/services/cagrid/EVSGridService)**_**";**
**// create a EVSServiceCLient instance**
**EVSGridServiceClient client=new EVSGridServiceClient(serviceURL);**
**//retrieve list of vocabularies service provides**
**DescLogicConceptVocabularyName****[] vocabularyNames=client.****getVocabularyNames()****;**
**//list the names of vocabularies**
**for(int i=0;i<vocabularyNames.length;i++){        ****	****	****	****	****System.out.println(i+": "+vocabularyNames[i].****getVocabularyName****());**
**}**

**Notes:**
As any other service API client needs an instance needs to be created

## Result:

**Lesson 4: Using caGrid Metadata Service APIs ****EVS Grid Service API Client – Retrieve EVS Vocabulary List**

## Lesson 4: Using caGrid Metadata Service APIs EVS Grid Service API Client – Retrieve EVS Concept Code for a Term

**//Set the search criteria **
**EVSDescLogicConceptSearchParams****  evsSearchParams = new EVSDescLogicConceptSearchParams();**
**	**
**	****//searching in NCI_Thesaurus**
**	****evsSearchParams.****setVocabularyName("NCI_Thesaurus");**
**	****//searching the concept code for term protein**
**     ****evsSearchParams.****setSearchTerm(“protein”);**
**	**
**	****//set maximum number of returned terms/concepts to 10   evsSearchParams.****setLimit(10);        ****	****	**
**	****//run query against the EVS grid service**
**	****DescLogicConcept****[] descLogicConcepts = client.****searchDescLogicConcept(evsSearchParams);**
**  ****	**
**	****//process results**

## Result:

**Lesson 4: Using caGrid Metadata Service APIs ****EVS Grid Service API Client – Retrieve EVS Concept Code for a Term**

## Lesson 4: Using caGrid Metadata Service APIs Metadata Services on caGrid – Index Service

**Notes:**
We would like to discover services on the grid.  Who is providing the information I am looking for?

## Lesson 4: Using caGrid Metadata Service APIs Discovery API Client

**Provides methods to query the **_**Index Service**_** and used to discover services of interest**

**Notes:**
As any other service API client needs an instance needs to be created

## Lesson 4: Using caGrid Metadata Service APIs Discovery API Client - Methods

**Searches based on service level metadata**
*E.g. discoverServicesByResearchCenter *
**Searches based on semantic annotation**
*E.g. discoverDataServicesByModelConceptCode*
**Searches based on operation metadata (for analytical services)**
*E.g. discoverServicesByOperationName*
**Searches based on information model metadata (for data services)**
*E.g. discoverDataServicesByExposedClass*
**Searched based on XPath leveraging Service Metadata XML**
*discoverByFilter (String xpathPredicate)  *

**Notes:**
Examples give me all services hosted by Lombardi Comprehensive Cancer Center

Examples give me all services providing Gene information

Examples who is exposing a certain class

## Lesson 4: Using caGrid Metadata Service APIs Discovery API Client – Discovering Services using a Keyword

**//Index service on production caGrid**
**String serviceURL="**_**[http://cagrid-index.nci.nih.gov:8080/wsrf/services/DefaultIndexService](http://cagrid-index.nci.nih.gov:8080/wsrf/services/DefaultIndexService)**_**";**
**// create a DiscoveryClient  instance**
**DiscoveryClient client = new DiscoveryClient(serviceURL);**
**//discover services by keyword**
**EndpointReferenceType[] endPointReferenceArr = client.****discoverServicesBySearchString(“Protein”)****;**
**//list URLs for returned services**
**for (int i=0; i < endPointReferenceArr.length; i++){**
**System.out.println("Address: "+****endPointReferenceArr[i].getAddress()****);**
**}**

**Notes:**
As any other service API client needs an instance needs to be created

## Lesson 4: Using caGrid Metadata Service APIs Discovery API Client – Discovering Services using a Keyword

**Result:**

## Lesson 4: Using caGrid Metadata Service APIs Metadata API - MetadataUtils

**Used to access and manipulate instances of service metadata **
**Complements the Discovery API;**
- Once a service is discovered MetadataUtils’s methods can be used to access and inspect the full metadata for the service

## Metadata API – MetadataUtils Methods

**Retrieves the service metadata or domain model from the specified service.**
*getServiceMetadata *
**Writes/reads the XML representation of the service metadata to/from the specified writer/reader:**
*serializeServiceMetadata*
*deserializeServiceMetadata *
**Writes/reads the XML representation of the domain model to/from the specified writer/reader:**
*serializeDomainModel *
*deserializeDomainModel*

**Notes:**
Domain model can be retrieved from caDSR as well. However Metautils helps accessing the really exposed model. Same model can be used by many services.

## Metadata API – MetadataUtils - Example

**//discover services by concept code used to annotate the model such as C17021 (Protein) **
**EndpointReferenceType[] endPointReferenceArr = client.****discoverServicesByModelConceptCode(“C17021”)****;**
**for (int i=0; i < endPointReferenceArr.length; i++){**
**	**** ****//retrieve service metadata for the service**
**ServiceMetadata**** serviceMetadata=****MetadataUtils.getServiceMetadata(endPointReferenceArr[i]);**
**//print host center information**
**System.out.println("Hosting Center: "+****serviceMetadata.getHostingResearchCenter().getResearchCenter().getDisplayName()****);**
**	**
**	****//retrieve domain model for the service**
**	****DomainModel**** domainModel=****MetadataUtils.getDomainModel(endPointReferenceArr[i]);**
**	**
**	****//print domain model name**
**	****System.out.println("Domain Model/Project Short Name: ****	****"+****domainModel.getProjectShortName());**
**	**
**	****System.out.println("Address: "+endPointReferenceArr[i].getAddress());**
**}**

## Metadata API – MetadataUtils - Example

**Result:**

## Lesson 4: Using caGrid Metadata Service APIs Additional Information	

- caGrid Wiki:
- _[http://www.cagrid.org/mwiki/index.php?title=CaGrid](http://www.cagrid.org/mwiki/index.php?title=CaGrid)_
- caBIGTM Architecture WS caGrid 1.0 Web Page:
- _[https://cabig.nci.nih.gov/workspaces/Architecture/caGrid1-0](https://cabig.nci.nih.gov/workspaces/Architecture/caGrid1-0)_
- caBIGTM Architecture WS caGrid Web Page:
- _[https://cabig.nci.nih.gov/workspaces/Architecture/caGrid/](https://cabig.nci.nih.gov/workspaces/Architecture/caGrid/)_

## Lesson 4: Using caGrid Metadata Service APIs Exercise

- Use caGrid Service APIs by following instructions located at:
- _[https://gforge.nci.nih.gov/docman/view.php/196/13047/05_Using_caGrid_APIs.doc](https://gforge.nci.nih.gov/docman/view.php/196/13047/05_Using_caGrid_APIs.doc)_

## Lesson 5: Using caGrid for Semantic InteroperabilityOutline

**Background**
**A Scientific User Scenario**
**caBIGTM Translation of the User Scenario**
**caGrid Services In Action **
**Conclusion**

## Lesson 5: Using caGrid for Semantic Interoperability Background: Metadata Overview

- UML Modeling

- Semantic Annotation using EVS concepts

- caDSR Load/CDE Creation

- EVS Concept Codes

- CDE Public ID/version

- UML Class/attribute

- CDE Long Name

**Notes:**
You will see in the afternoon and heard in Silver Level Compatibility 
Every system needs to have a UML model descriptive enough
All the attributes and classes for this system is annotated using terms/concepts from Enterprise Vocabulary System
The information model is registered in cancer data standards reporsitory and transformed to common data elements. 
For now consider each class/attribute/data type tuple corresponds to a CDE. Each CDE has a public ID.

## Lesson 5: Using caGrid for Semantic Interoperability Background: caGrid Infrastructure

- All the metadata is exposed via caGrid core service APIs:
**EVS:** Vocabularies/concepts
**caDSR:** Model Components/Common Data Elements
**Index Service**: Service metadata including annotated domain model to discover services

**Notes:**
EVS – What vocabularies are available? What is the concept code for a “term”? What synonyms for this term?
caDSR – What are the classes/attributes/associations registered for service X? What are the CDEs for service X? 
Index Service – What is the model exposed? Where the service is located? What is the end-point for the service? It is the yellow pages for caGrid

## Lesson 5: Using caGrid for Semantic Interoperability A Scientific User Scenario

**A researcher is studying human BRCA1 gene and wants to find information available in public resources on protein encoded by this gene**

## Lesson 5: Using caGrid for Semantic Interoperability A Scientific User Scenario – Details

**A researcher is studying **_**human BRCA1 gene**_** and wants to **_**find**_** information available in public **_**resources**_** on **_**protein**_** encoded by this **_**gene**_**.**
**Reading carefully:**
**Multiple “****resources”**
**“****Gene” ****and ****“Protein” ****concepts**
**A specific “****human****” gene with name ****“BRCA1”****  **

**Notes:**
How can one find multiple resources?
How can one find info on things like “Gene”/”Protein”? 
How can one query resources with restrictive criteria?

## Lesson 5: Using caGrid for Semantic Interoperability caBIGTM Translation of the User Scenario

**Discover caGrid Data Services providing Protein information**
- Use caGrid Discovery Client
**Find how to combine the information from these Data Services**
- Find semantically equivalent data elements (Common Data Elements) from different data services
**Identify/query the Protein corresponding to BRCA1 gene**
- Run caBIGTM Query Language (CQL) queries using caGrid Data Service Client
**Collect information on the **_**same**_** protein from different resources**
- Run multiple or federated CQL queries against different Data Services leveraging Common Data Elements

## Lesson 5: Using caGrid for Semantic Interoperability Discover caGrid Data Services Providing Protein Information

**Some possible ways to use caGrid Discovery Client:**
- Search by “search string” “Protein”
- Not specific enough: Service descriptions may mention “Protein”
- Search by EVS Concept Code for “Protein”
- Code usually more specific: Less likely to find service description that contain an EVS Concept Code “C99999”

## Lesson 5: Using caGrid for Semantic Interoperability Find EVS Concept Code for Protein

**EVSGridServiceClient** client=new EVSGridServiceClient(*serviceURL_EVS*);
- //set search parameters for EVS query
- EVSDescLogicConceptSearchParams  evsSearchParams = new EVSDescLogicConceptSearchParams();
- //set vocabulary to be used
- evsSearchParams.setVocabularyName("NCI_Thesaurus");
- evsSearchParams.setSearchTerm(_“_**Protein**_”_);
- evsSearchParams.setLimit(10);
- DescLogicConcept[] descLogicConcepts = client.searchDescLogicConcept(evsSearchParams);

**Notes:**
We are using EVSGridServiceClient (you will see in Session 3)

## Lesson 5: Using caGrid for Semantic Interoperability Find EVS Concept Code for Protein

**ant runcaGridSemanticDemo -Dstep=step1 –Dterm=protein**

## Lesson 5: Using caGrid for Semantic Interoperability Discover caGrid Data Services Providing Protein Information

- //instantiate a client
**DiscoveryClient** client = new DiscoveryClient(serviceURL_Index);
- //search services end point exposing a model annotated concept code
- EndpointReferenceType[] endPointReferenceArr=
- 	client.discoverDataServicesByModelConceptCode**(“C17021”);**

**Notes:**
We are using DiscoveryClient to interact with Index Service and discover a service for a given criteria. It is a “Concept Code” in this case.

## Lesson 5: Using caGrid for Semantic Interoperability Discover caGrid Data Services Providing Protein Information

- Pick two services for next step

**ant runcaGridSemanticDemo -Dstep=step2 –Dterm=protein**

## Lesson 5: Using caGrid for Semantic Interoperability Find How to Combine the Information from these Data Services

**DataServiceClient** client_caBIO=new DataServiceClient(*serviceURL_caBIO*);
**DataServiceClient** client_gridPIR=new DataServiceClient(*serviceURL_gridPIR*);
- //Download domain models from Data Services
- DomainModel domainModel_caBIO;
- DomainModel domainModel_gridPIR;
- domainModel_caBIO=**MetadataUtils.getDomainModel**(client_caBIO.getEndpointReference());
- domainModel_gridPIR=**MetadataUtils.getDomainModel**(client_gridPIR.getEndpointReference());
-         }

**Notes:**
Retrieve the model exposed by services.

## Lesson 5: Using caGrid for Semantic Interoperability Find How to Combine the Information from these Data Services

- Find **semantically equivalent attributes** using **Common Data Elements (CDEs)**
- //Parse all the Data Elements from first model (NOT SHOWN)
- //Parse all the Data Elements from second domain model and return common CDEs
-     umlClassArr=exposedUMLClassCollection2.getUMLClass();
-     for (int i=0;i<umlClassArr.length;i++){
-         UMLClassUmlAttributeCollection attributeCollection = (UMLClassUmlAttributeCollection) umlClassArr[i].getUmlAttributeCollection();
-         UMLAttribute [] umlAttributeArr=attributeCollection.getUMLAttribute();
-         for (int j=0;j<umlAttributeArr.length;j++){
- 	        MyDataElement dataElement=
- 		new MyDataElement(umlClassArr[i],umlAttributeArr[j]);
-         if(dataElementMap.containsKey(dataElement.getPublicIDVersion())){
-         MyDataElement sourceDataElement=
- 		(MyDataElement)dataElementMap.get(dataElement.getPublicIDVersion());
-         MyDataElementMap myDataElementMap=new 		MyDataElementMap(sourceDataElement,dataElement);
-         	commonDataElementList.add(myDataElementMap);
-         	}
-         }
-      }

**Notes:**
DON’T READ IT. Just to prove it is programmatically possible to do so.

Get an intersection of two models and find semantically equivalent attributes using Common Data Elements (CDEs).

## Lesson 5: Using caGrid for Semantic Interoperability Find How to Combine the Information from these Data Services

- gridPIR’s Gene.name and caBIO’s Gene.symbol are semantically equivalent

**ant runcaGridSemanticDemo -Dstep=step3**

**Notes:**
More on next slide....

## Lesson 5: Using caGrid for Semantic Interoperability Find How to Combine the Information from these Data Services

- Find **semantically equivalent attributes** using **Common Data Elements (CDEs)**

- CDE: 2223841v3.0

**gridPIR**

- CDE: 2342468v1.0

**caBIO**

## Lesson 5: Using caGrid for Semantic Interoperability Identify/Query the Protein Corresponding to BRCA1 Gene

- <?xml version="1.0" encoding="UTF-8"?>
- <ns1:CQLQuery xmlns:ns1="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
-  <ns1:Target name="**edu.georgetown.pir.domain.Protein**">
-    <ns1:Group logicRelation="**AND**">
-     <ns1:Association name="**edu.georgetown.pir.domain.Gene**" roleName="**geneCollection**">
-    	<ns1:Attribute name="**name**" predicate="**EQUAL_TO**" value="**brca1**"/>
-     </ns1:Association>
-     <ns1:Association name="**edu.georgetown.pir.domain.Organism**" 			 	roleName="**organismCollection**">
-       <ns1:Attribute name="**scientificName**" predicate="**EQUAL_TO**" value="**homo sapiens**"/>
-     </ns1:Association>
-     </ns1:Group>
-  </ns1:Target>
- </ns1:CQLQuery>

**Notes:**
We are using caBIG Query Language (you will see in Session 3)

## Lesson 5: Using caGrid for Semantic Interoperability Identify/Query the Protein Corresponding to BRCA1 Gene

**DataServiceClient** client_gridPIR=new DataServiceClient(*serviceURL_gridPIR*);
**CQLQuery** query_gridPIR = (CQLQuery) Utils.*deserializeObject*(
-             new StringReader(
- 		"<ns1:CQLQuery 		xmlns:ns1=\"http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery\">"+
-             	"<ns1:Target name=\"edu.georgetown.pir.domain.Protein\">"+
- 		.......
- 		"</ns1:Target>"+
-                "</ns1:CQLQuery>"
-              ),
-             CQLQuery.class
- );
**CQLQueryResults** results_gridPIR=client_gridPIR.**query**(query_gridPIR);

**Notes:**
We are using DataServiceClient (you will see in Session 3)

## Lesson 5: Using caGrid for Semantic Interoperability Identify/Query the Protein Corresponding to BRCA1 Gene

- Protein Object with uniprotkbEntryName BRCA1_HUMAN

**ant runcaGridSemanticDemo -Dstep=step4**

## Lesson 5: Using caGrid for Semantic Interoperability Collect Information on the Same Protein from Different Resources

- We know
- “**Protein.uniprotCode**”** **in **caBIO** is semantically equivalent to** “Protein.uniprotkbEntryName**” in **gridPIR :**
- “**BRCA1_HUMAN**”  protein from **gridPIR** corresponds to** Human BRCA1 Gene**

**gridPIR**

- CDE: 2342468v1.0

**caBIO**

**Notes:**
What we know so far?

## Lesson 5: Using caGrid for Semantic Interoperability Collect Information on the Same Protein from Different Resources

**gridPIR**

**caBIO**

**Join caBIO and gridPIRand access to more info**

**Annotations**

**Genomic Info**

**Notes:**
Use two differently named attributes to “join”/intersect two different models to gather more information.

## Lesson 5: Using caGrid for Semantic Interoperability Collect Information on the Same Protein from Different Resources

**caBIO**

- <ns1:CQLQuery xmlns:ns1="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
-  <ns1:Target name="**gov.nih.nci.cabio.domain.NucleicAcidSequence**">
-    <ns1:Association name="**gov.nih.nci.cabio.domain.Gene**" roleName="**geneCollection**">
-      <ns1:Association name="**gov.nih.nci.cabio.domain.Protein**" roleName="**proteinCollection**">
-        <ns1:Attribute name="**uniProtCode**" predicate="**EQUAL_TO**" value="**brca1_human**"/>
-      </ns1:Association>
-    </ns1:Association>
-  </ns1:Target>
- </ns1:CQLQuery>

## Lesson 5: Using caGrid for Semantic Interoperability Collect Information on the Same Protein from Different Resources

**gridPIR**

- <ns1:CQLQuery xmlns:ns1="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
-  <ns1:Target name=“**edu.georgetown.pir.domain.ZincFingerRegion**">
-    <ns1:Association name="**edu.georgetown.pir.domain.Protein**" roleName=“**proteinCollection**">
- 	<ns1:Attribute name="**uniprotkbEntryName**" predicate="**EQUAL_TO**" value="**brca1_human**"/>
- </ns1:Association>
-  </ns1:Target>
- </ns1:CQLQuery>

## Lesson 5: Using caGrid for Semantic Interoperability Collect Information on the Same Protein from Different Resources

**Lesson 5: ****Using caGrid for Semantic Interoperability ****Collect Information on the Same Protein from Different Resources**

**ant runcaGridSemanticDemo -Dstep=step5**

**Nucleic Acid Sequence from caBIO **

**Zinc Finger Region from gridPIR **

## Building a caGRID NodeConclusion

**Using caBIGTM silver level compatible caGrid Services supported by semantic metadata, one can:**
- Discover information resources (Standard Vocabularies) – **Semantic annotation is important**
- Query resources using a standard language CQL (Standard APIs) – **API/model correspondence is important**
- Identify ways to combine information from multiple resources (CDEs) – **CDE reuse is very important**

**Notes:**
See how the guidelines and steps in demo are related.