#215 Improved VSX object identification

Enhancement
closed
6
2016-04-30
2010-09-18
David Benn
No

At the 2nd Citizen Sky workshop, a participant was unable to obtain data on some objects. That led to Chris Watson looking at the VSX data access code suggesting improvements to catch more data. Zapper may also be able to make use of this. Here's an excerpt from Chris's 6 Sep 2010 email:

...here are the MySQL
queries that VSX performs when doing an identity search across aliases
(cross-ids). As I mentioned, VSX's database schema was designed to
mirror the GCVS tabular format. Back when I designed VSX, I didn't
know as much as I know now. So the kinds of queries VSX needs to do
are pretty funky, in order to do it right, and catch everything that
an identity search should.

So, the query used depends on whether or not the identity being
searched for is ONE WORD or MORE THAN ONE WORD.

ONE WORD QUERY (where ? is the one-word ident)

SELECT o_auid
FROM vsx_crossids
WHERE ((x_crossID LIKE ?)
OR (x_catAcronym LIKE ?)
OR (x_catName LIKE ?)
OR (CONCAT(x_catAcronym, ' ', x_catName) LIKE ? AND x_catAcronym
IS NOT NULL AND x_catName IS NOT NULL)
OR (CONCAT(x_catName, x_comp1) LIKE ? AND x_catName IS NOT NULL
AND x_comp1 IS NOT NULL))
AND x_deleted = 0

GREATER-THAN-ONE-WORD QUERY

SELECT o_auid
FROM vsx_crossids
WHERE ((x_crossID LIKE ?0)
OR (x_catAcronym LIKE ?1 AND x_catName LIKE ?2)
OR (CONCAT(x_catAcronym, ' ', x_catName) LIKE ?0 AND x_catAcronym
IS NOT NULL AND x_catName IS NOT NULL)
OR (CONCAT(x_catAcronym, ' ', x_catName, x_comp1) LIKE ?0 AND
x_catAcronym IS NOT NULL AND x_catName IS NOT NULL AND x_comp1 IS NOT
NULL)
OR (CONCAT(x_catName, x_comp1) LIKE ?0 AND x_catName IS NOT NULL
AND x_comp1 IS NOT NULL)
OR (x_catAcronym = 'GCVS' AND x_catName LIKE ?0))
AND x_deleted = 0

In that one, things get a little tricky. The ?0 "variable" is the full
ident, no matter how many words it happens to be. The ?1 variable is
the FIRST whitespace-delimited word of the full ident, and the ?2
variable is all of the other words in the full ident, space-delimited.
What's happening here is we're trying to find a possible match
against the acronym and catalog name portions of the full ident,
because they are stored in VSX in two columns.

Discussion

  • David Benn

    David Benn - 2013-04-27

    Another approach is to use a http get request. Here's an excerpt from an email from Chris Watson in 2010 in response to me asking about VSX http requests and VOTable.

    In order perform an HTTP GET to VSX and force it to give you
    VOTable-format XML as the response, you have to hit it with a request
    for a specific "fuseaction". Below are three relevant examples of
    doing this in searching VSX for a primary name ("SS Cyg"), a cross-id
    ("HD 206697"), or an AUID ("000-BCP-220").

    http://www.aavso.org/vsx/index.php?view=query.votable&ident=SS+Cyg

    http://www.aavso.org/vsx/index.php?view=query.votable&ident=HD+206697

    http://www.aavso.org/vsx/index.php?view=query.votable&ident=000-BCP-220

    The "ident" query string argument is the key, obviously. Although
    there is a full compliment of keys and values that are supported by
    this VOTable access (stuff like cone searches, mag. range searches,
    var. type searches...basically anything you see in the VSX search
    form), searching for an identification ("ident" arg) is probably the
    easiest and most straight-forward way to grab the details of a
    specific star out of VSX.

    I'm just noticing that VSX supports VOTable Format Definition version
    1.0. VOTable, I think is all the way up to Version 1.2 now, but I
    haven't done anything other work to bring it up to date any further.

     
  • David Benn

    David Benn - 2016-04-30
    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks