# TAP service documentation

## Introduction

In addition to this website with a user-friendly interface, MP3C makes data available through the Table Access Protocol (TAP) hosted at the OCA DaCHS data center. This is particularly useful if you need to perform more complex queries than what the website offers, to retrieve data in various formats, or to directly access data programmatically or through VO-compatible software such as TOPCAT.

## TAP service location

The TAP service can be queried by submitting queries in ADQL language, with a syntax similar to SQL. One way to submit queries is to use the following online form: ADQL form.

### Using TAP with TOPCAT

Using TAP in TOPCAT lets you quickly execute queries, and get in return data that can easily be displayed in tabular format, or plotted.

Queries must be submitted to the OCA TAP service. After opening TOPCAT, click on the “VO” menu, then “Table Access Protocol (TAP) Query”. In the “Select Service \ By Table Properties” tab, search for “mp3c” and double-click on the “OCA DC TAP” service (ivo://oca/tap). Alternatively, you can manually fill, in that same tab, the “TAP URL” field with “https://dachs.oca.eu/tap” and click on “Use Service”. A list of available tables should appear in a new window. The most relevant tables are those in the “mp3c_main” database schema, but useful metadata are also stored in “tap_schema”.

## Database information

To list the available tables, execute:

SELECT * FROM tap_schema.tables WHERE schema_name='mp3c_main'

Information on the columns of a specific table, such as the best values table, can be obtained with:

SELECT * FROM tap_schema.columns
WHERE table_name='mp3c_main.best'

When using the service, we recommend that you take note at least of the database version. It is available, among other metadata, in the version table:

SELECT * FROM mp3c_main.version

## Tables overview

All tables that need to reference a minor body have a “bid” (body ID) column. This is an internal identifier that is consistent across all tables. Be careful that body IDs may change from a version of the database to another. The “body” table links body IDs to a primary body designation (such as “Ceres”). Since a body may have multiple designations, we also list all of them in the “name” table.

For example, the primary designation for body with internal ID of 1 can be obtained by executing

SELECT name FROM mp3c_main.body WHERE bid=1

which returns “Ceres”. In addition, all designations for body with body ID of 1 are retrieved with:

SELECT name FROM mp3c_main.name WHERE bid=1

This should give you: Ceres, 00001, 1801AA, 1899OF, 1943XB, I01A00A, I99O00F, J43X00B.

The remaining tables are:

• best: Best values. The table has one row per body.
• prop_*: Each of these tables represent a physical quantity (diameter, albedo...) or a group of physical quantities that are measured together (e.g. $$a_{\text p}$$, $$e_{\text p}$$ and $$\sin i_{\text p}$$ for the prop_proper_elements table). In these tables, each measurement is associated with a bibliographic reference. For convenience, besides the “bid” column, the body corresponding to a measurement is also referenced through its primary designation in the “name” column. This table may have multiple rows for a given body.
• mpcorb: Data from the Minor Planet Center.

## Examples of queries

### All best albedos

Return names and best albedo of bodies with a known albedo:

SELECT name, albedo FROM mp3c_main.best
JOIN mp3c_main.body USING (bid)
WHERE albedo IS NOT NULL

### Best albedos for bodies with diameter greater than

Return names and best albedo of bodies with a known albedo and a best diameter greater than 20 km:

SELECT name, albedo FROM mp3c_main.best
JOIN mp3c_main.body USING (bid)
WHERE albedo IS NOT NULL AND diameter>20

### Proper elements for bodies with best family

Return proper orbital parameters for bodies that have their best family set to Baptistina:

SELECT a_p, e_p, i_p FROM mp3c_main.best
WHERE parent_name='Baptistina'

### Proper elements for bodies with mention of a family

Return proper orbital parameters for bodies with at least a family measurement set to Baptistina:

SELECT a_p, e_p, i_p FROM mp3c_main.best
WHERE bid IN (SELECT DISTINCT bid FROM mp3c_main.prop_family WHERE parent_name='Baptistina')

### MPC orbital parameters for bodies with best family

Return orbital parameters from MPC for bodies that have their best family Baptistina:

SELECT a, e, sin_i FROM mp3c_main.best
JOIN mp3c_main.mpcorb USING (bid)
WHERE parent_name='Baptistina'

### Family V-shaped plot

Return data to plot the V-shape of family Erigone:

SELECT a_p, inverse_diameter FROM mp3c_main.best
WHERE parent_name='Erigone'