Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Setting-up an EPN-TAP service mean to publish a table in a DACHS server describing data we want to display. This table is referencing each file with a maximum amount of information by filling parameters defined by the standards of EPN TAP called epn core view . The EPN TAP standards has mandatory parameters wich can (except a few of them) be left empty and optional parameters, finally other columns could be defined by users to provide specific information. VESPA is a way to interrogate registered services published in different DaCHS servers using {keywords or ADQL queries}.

This tutorial will provide a very simple example to help beginners to understand how they can set up an EPN-TAP service. In this purpose, we will set up a service called "Planets" providing informations on the solar system planets.

For this example, we want to provide these data on our service :

...

mean radius uncertainty

(km)

...

equatorial radius

(km)

...

equatorial radius

uncertainty

(km)

...

polar radius

(km)

...

polar

radius

uncertainty

(km)

...

rms

deviation

(km)

...

elevation

max

(km)

...

elevation

min

(km)

...

mass

(kg)

distance to

primary

(km)

...

sideral

rotation

period

(h)

...

Steps to follow:

First, a virtual machine hosting a DaCHS server must be setteled up, then metadata must be referrenced and a Comma Separated Values file containing useful features must be created. Then a Ressource Descriptor written in XML must be written. This resource descritor will read the csv file and fill the table on DaCHS server. Finally, the service must be registered on VESPA portal (not for this tuto).

  • Install the server on a virtual machine:

First, it is necessary to have settled-up an EPN-TAP server hosting the DaCHS server, following this tutorial: EPN-TAP Server Installation for VESPA Data Provider Tutorial#TAPServerInstallationforVESPADataProviderTutorial-6.AWStatsInstallationandConfigurationincludingApache .

  • Define granules :

To publish your own service, you have to define granules. Each granule can link to a file (with the optional parameter access_url). Each granule must have one unique identifier which is a primary key  for the table (the mandatory parameter for this identifier is granule_uid). Each different type of granule must have an identifier (parameter granule_gid).

In our example, each granule have the same type and correspond to one planet. There is no file to link for the granule, so no need to define a granule_uid.

  • Define the epn_core parameters

Once granules are defined, you have to browse the EPN TAP V2 parameters and their description to see what could be informed. In order to define clearly the organization of the final table, it is advised to make a scheme with the EPN-TAP parameters on one side an what you decide to put into each in the other side. A large part of the mandatory parameters could be left empty, other parameters  you want to add could be defined as table columns.

  • Create a csv file containing metadata

Metadatas which are varying from one granule to the other or cannot be post-treaded in the q.rd must be referenced in one column of a CSV file. This CSV file will further be read by the resource descriptor to fill the tables in  DaCHS. You can use your favourite programming language to create this csv file.

For this example, we give the link to the CSV, hand written, you can downolad it and the Resource Descriptor on github:

https://github.com/epn-vespa/DaCHS-for-VESPA/tree/master/q.rd_examples/planets

  • Building a resource descriptor

The resource descriptor in an XML written in gives Dachs informations to read the CSV an fill the metadata table, it is written in XML and follow DACHS Standards for EPN TAP.

Structure of q.rd file

...

It is most commonly divided in 3 parts, all the content is containes in one global tag <resource schema="...."> where the resource schema name must be the same as the name of the folder containing the q.rd . 

The first part is meta tags with diffecrent attributes which defines global characteristics of the table.

The meta attribute "subject" could and must be defined several times .

utype meta attribute has to be ivo://vopdc.obspm/std/EpnCore#schema-2.0

<resource schema="planets">
<meta name="title">Characteristics of Planets (demo)</meta>
<meta name="description" format="plain">
Main characteristics of planets. Data are included in the table, therefore most relevant parameters are non-standard in EPN-TAP. Data are retrieved from Archinal et al 2009 (IAU report, 2011CeMDA.109..101A) [radii] and Cox et al 2000 (Allen's astrophysical quantities, 2000asqu.book.....C) [masses, heliocentric distances, and rotation periods]. </meta>
<meta name="creationDate">2015-08-16T09:42:00Z</meta>
<meta name="subject">planet</meta>
<meta name="subject">mass</meta>
<meta name="subject">radius</meta>
<meta name="subject">period</meta>
<meta name="copyright">LESIA-Obs Paris</meta>
<meta name="creator.name">Stephane Erard</meta>
<meta name="publisher">Paris Astronomical Data Centre - LESIA</meta>
<meta name="contact.name">Stephane Erard</meta>
<meta name="contact.email">vo.paris@obspm.fr</meta>
<meta name="contact.address">Observatoire de Paris VOPDC, bat. Perrault, 77 av. Denfert Rochereau, 75014 Paris, FRANCE</meta>
<meta name="source">2000asqu.book.....C</meta>
<meta name="contentLevel">General</meta>
<meta name="contentLevel">University</meta>
<meta name="contentLevel">Research</meta>
<meta name="contentLevel">Amateur</meta>
<meta name="utype">ivo://vopdc.obspm/std/EpnCore#schema-2.0</meta>

Then, you start defining the table, in every EPN TAP services, the table id must be epn_core and he mixin must be //epntap2#table-2.0, spatial frame type must be chosen in EPN TAP parameters

You can list in the optional_columns tags, optional EPN TAP parameters you choose to inform.

...

After mixin definition,  you can start to define your own columns  from the CSV file with the tag <column>, where you should define the attributesname, type, tablehead, unit (if relevant), description, ucd (defines the type of data, see ucd  IVOA documentation ), verblevel is a rate under 30 defining the columns importance. After columns definition, the <table> tag is complete.

...

fhdhg

  • Publish and check the tables

You have to move the resource descriptor and the csv file into gavo directory, the resource descriptor must be renamed q.rd.

in your "planets" work directory:

cp planets_mixin.rd  /var/gavo/inputs/<<service_name>>/
cp Masses2.csv /var/gavo/inputs/<<service_name>>/data/Masses2.csv

then go to this directory

cd /var/gavo/inputs/planets/

and type these commands

sudo gavo val q.rd

sudo gavo imp q.rd

sudo gavo serve restart

Then, on your browser, type the adress  http://<<my_servername>>.<<my_domain>>:8000/  previsously setteled-up.

Click on the service name, you can now see your table informations. It is possible to send ADQL queries, to select the whole database, you can type:

SELECT * FROM planets.epn_core

To go further ...

add a link thumnail

programming