Home | Uploading | Viewing Data | Search | Making Public | Lists | Sample Attributes | Chemical Analysis Attributes | Image Attributes | XML Output | To MetPetDB


XML Output for Http Query Strings

Users can communicate with the MetPetDB database by sending http queries. The URL format changes depending on the query, but the response is always in xml. The base URL is http://samana.cs.rpi.edu/metpetweb/searchIPhone.svc? There are several query strings that, along with valid parameters will produce the desired output. Sample XML output can be viewed by clicking on any of the following URLs:

Queries returning samples and all attributes:

The following two queries are basic database queries that return all the samples in the specified search region along with all of their attributes.

http://samana.cs.rpi.edu/metpetweb/searchIPhone.svc?north=42.449964&south=41.550036&east=-72.394514&west=-73.605486

This query takes the upper and lower latitude and longitude bounds and creates a geographic search box. The "north" query string represents the upper-bound latitude, "south" represents the lower-bound latitude, "east" represents the upper-bound longitude, and "west" represents the lower-bound longitude. In the iphone app, these numbers are derived from a center point, which is either the user's current location or an input coordinate, and a search radius that is provided by the user. All of the information about all the samples in this box is returned in the output for this query. All of the samples returned are within the <set> tags and for each sample, all relevant information is within the <sample> tags. The following are some sample attributes and their XML tags:

Sample name (a ":" indicates that the sample came from a publication):

<number>

<string>102-1:1979-006302</string>

</number>

Unique sample id number (this is the sample number in the database, and while it is generally not seen by users, it is required for many of the queries described on this page):

<id>

<long>405</long>

</id>

Rock type (the actual rock type is within the <rockType> tags and the id indicates the database id of that type):

<rockType> <edu.rpi.metpetdb.client.model.RockType>

<id>3</id> <rockType>Schist</rockType>

</edu.rpi.metpetdb.client.model.RockType> </rockType>

Minerals contained in the sample:

<minerals>

<string>Apatite (x)</string> <string>Muscovite (x)</string> <string>Chlorite (x)</string> <string>Quartz (x)</string> <string>Magnetite (x)</string> <string>Biotite (x)</string> <string>Plagioclase (x)</string> <string>Garnet (x)</string> <string>Hornblende (x)</string>

</minerals>

Metamorphic grades contained in the sample:

<metamorphicGrades>

<string>Amphibolite</string>

</metamorphicGrades>

Public/private status (if the data is public the <boolean> tag will be true):

<publicData>

<boolean>true</boolean>

</publicData>

Longitude and Latitude (respectively) of the sample:

<x>-73.43169403076172</x> <y>42.0546989440918</y>

Sample Owner (if the sample is published, the owner will be PUBLICATION, otherwise it will be a name):

<owner>

<string>PUBLICATION</string>

</owner>

http://samana.cs.rpi.edu/metpetweb/searchIPhone.svc?searchRegion=BritishColumbia

The output for this query is the same as the previously described query, but the query string and the parameters are different. The query string is searchRegion, and the parameter is one of the search regions in the database. These search regions must match exactly what is in the database or no samples will be returned. To view the valid search regions, use the url query string (described below) regions=t. The output will be all the samples in the database that are in the specified region. The xml tags for each sample will be identical to those above.

Sample Information Queries

With the exception of the "large image" query, all of the following queries use the unique id number of a sample and return information about that particular sample.

http://samana.cs.rpi.edu/metpetweb/searchIPhone.svc?subsampleInfo=342

Using the unique id number of a sample, this query will return a summary of the subsample and chemical analysis information for the sample. In the example above, the sample id is 342. The XML tags include:

The number of subsamples associated with the sample:

<subsamples> <int>1</int>

The number of images associated with the sample (this includes sample and subsample images):

<imageCount>

<int>16</int>

</imageCount>

The number of chemical analyses associated with the sample:

<analysisCount>

<int>0</int>

</analysisCount>

Boolean that indicates whether there is a bulk rock analysis available for the sample:

<bulkRock>

<boolean>false</boolean>

</bulkRock>

http://samana.cs.rpi.edu/metpetweb/searchIPhone.svc?thumbnails=342

Using the unique id number of a sample, this query will return a list of image checksum numbers. These checksums represent the thumbnail versions of all the sample AND subsample images for a sample. To view the thumbnail image, append any thumbnail checksum number to the following URL: http://samana.cs.rpi.edu/metpetweb//image/?checksum=

Example: http://samana.cs.rpi.edu/metpetweb//image/?checksum=04cfebb70d2e2e03cb7fa8115a1ec027bfd7326e1391514925

The XML tags include: The checksum number for the thumbnail:

<image>

<string>0442d83d64744a7c72d8e694b3259cd09675a2ecf905adb6f2</string>

</image>

The unique id number of the image (this is used to obtain the larger mobile-sized image):

<imageID>

<long>228</long>

</imageID>

http://samana.cs.rpi.edu/metpetweb/searchIPhone.svc?comments=342

Using the unique id number of a sample, this query will return a list of all the comments that have been made about that sample. If there are no comments for the sample you are searching for, the XML output will be <comments />.

http://samana.cs.rpi.edu/metpetweb/searchIPhone.svc?large_image=214

The parameter for this query is an image id number, NOT a sample id number. Given the id of an image, the checksum for the mobile sized image in the database will be returned. To view this image, append the checksum to the following url: http://samana.cs.rpi.edu/metpetweb//image/?checksum=

Example:http://samana.cs.rpi.edu/metpetweb//image/?checksum=04de072b0f5cb440c3eba1b900f46461512a94693c35d02bd7

The XML output includes:

The checksum of the mobile-sized image:

<path>

<string>04de072b0f5cb440c3eba1b900f46461512a94693c35d02bd7</string>

</path>

The filename of the image:

<filename>

<string>V15A-A-297x239(sps).tif</string>

</filename>

Other queries

http://samana.cs.rpi.edu/metpetweb/searchIPhone.svc?regions=t

One of the search options in the iphone app is to use a predefined search region and have all the samples within that region returned. This query will return all the regions in the database that contain samples. In XML format, each region is in a <string> tag.


Home | Uploading | Viewing Data | Search | Making Public | Lists | Sample Attributes | Chemical Analysis Attributes | Image Attributes | XML Output | To MetPetDB