2008 Summer School

Search a Registry via the Standard Interface -- Exercises

The exercises presented here were prepared as part of the NVO Summer School.

Part 1: Advanced Searching via the new Standard Search Interface

The ivoaregistry Java package provides a Java API and a rudimentary command-line tool for searching registries through the IVOA standard search interface. To build the library and tool, change into the package directory and run ant:

on Linux/MacOS:
cd $NVOSS_HOME/java/src/ivoaregistry
ant
   on Windows:
cd %NVOSS_HOME%\java\src\ivoaregistry
ant

Exercise 1. Sample Advanced Queries

regsearch is the command line tool for searching registries via the standard interface. Currently, all the documentation is in-lined to the command script; thus, to view it, load src/scripts/regsearch into your favorite editor or browser.

To use the tool, it's helpful to store the registry endpoint into a variable. Note that one of the points of the standard interface is that you can use it to search any IVOA-compliant registry. In this exercise, we can use the NVO registry or the Astrogrid registry, so we'll set a variable for each:

on Linux/MacOS, csh:
set nvoreg=http://nvo.stsci.edu/vor10/ristandardservice.asmx
set agreg=http://msslxt.mssl.ucl.ac.uk:8080/astrogrid-regtest-1_0/services/RegistryQueryv1_0
on Linux/MacOS, sh:
nvoreg=http://nvo.stsci.edu/vor10/ristandardservice.asmx
agreg=http://msslxt.mssl.ucl.ac.uk:8080/astrogrid-regtest-1_0/services/RegistryQueryv1_0
on Windows:
set nvoreg=http://nvo.stsci.edu/vor10/ristandardservice.asmx
set agreg=http://msslxt.mssl.ucl.ac.uk:8080/astrogrid-regtest-1_0/services/RegistryQueryv1_0

In brief, the synopsis of this tool's usage is:

Usage: regsearch -e url [ options ] command [ args ... ]

where command is one of the following:

getidentityreturn the description of the registry
getresourcereturn the description of the resource specified by an identifier
searchbyadqlsearch for resources whose descriptions match ADQL constraints
searchbykeywordssearch for resources whose descriptions contain given keywords
idsbyadqlreturn just IDs of resources whose descriptions match ADQL constraints
idsbykeywordsreturn just IDs of resources whose descriptions contain given keywords

In this exercise, we will use the searchbyadql command. Let's try an example.

Find all resource that mention quasars in its description:
regsearch -e $agreg searchbyadql "content/description like '%galaxy%'"

Here some options you may find helpful or instructive:

-s listextract metadata from the returned records by listing their XPath identifiers in a comma-separated list; e.g. "identifier,title,capability/interface/accessURL"
-vprint out some extra messages about what's going on
-xshow the SOAP request and response messages

Try some more examples:

Find all registered organisations:
regsearch -e $agreg searchbyadql "@xsi:type like '%Organisation%'"

Find all registered organisations that work in radio astronomy:
regsearch -e $agreg searchbyadql "@xsi:type like '%Organisation%' and content/subject like '%radio%'"

Find all cone search services:
regsearch -e $agreg searchbyadql "capability/@xsi:type like '%ConeSearch%'"

 


The NVO Summer School is made possible through the support of the National Science Foundation.