-
Notifications
You must be signed in to change notification settings - Fork 0
Add TAP Server Prototype with ADQL Parser and LSDB Integration #40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
9c8be76
to
2f15fff
Compare
@copilot Use the |
Integrated
The server successfully processes both simple queries and complex cone searches with CONTAINS/POINT/CIRCLE. |
c62925b
to
364dcfa
Compare
tap_server/tap_server.py
Outdated
if 'FROM' in query.upper(): | ||
try: | ||
from_part = query.upper().split('FROM')[1].split('WHERE')[0].split('LIMIT')[0] | ||
table_name = from_part.strip().split()[0] | ||
except: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot This looks a little awkward. Refactor to use a regex to validate and extract all the parts of the string at once, and add comments showing example good and bad cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored in commit 9b7f96d. The table name extraction now uses a regex pattern with SQL keyword validation. Added comments showing good examples ("FROM ztf_dr14", "FROM gaia_dr3.gaia") and bad examples ("FROMAGE", "FROM WHERE") that properly return 'results' as default.
Co-authored-by: gitosaurus <6794831+gitosaurus@users.noreply.github.com>
Co-authored-by: gitosaurus <6794831+gitosaurus@users.noreply.github.com>
364dcfa
to
79035f8
Compare
Co-authored-by: gitosaurus <6794831+gitosaurus@users.noreply.github.com>
Verify that a simple happy case works.
TAP Server Prototype - Complete Implementation ✅
Successfully created a prototype TAP (Table Access Protocol) server following the IVOA TAP v1.1 specification.
📁 Components
tap_server.py
- Flask-based TAP server using bin/adql_to_lsdb for query processingexample_client.py
- Python client demonstrating server usageREADME.md
- Comprehensive documentation with examplesrequirements.txt
- Dependencies (Flask, queryparser-python3, pandas)__init__.py
- Package initialization🎯 Features Implemented
bin/adql_to_lsdb.adql_to_lsdb()
function to convert ADQL queries/sync
endpoint (synchronous queries)/capabilities
endpoint (IVOA VOSI format)/tables
endpoint (schema metadata)🚀 Usage
Start the server:
cd tap_server python tap_server.py
Query with curl:
Cone search query:
✅ Testing Results
All functionality tested and verified:
bin/adql_to_lsdb.adql_to_lsdb()
function/sync
endpoint accepts and processes ADQL queries/capabilities
endpoint returns VOSI format/tables
endpoint returns schema metadata📊 TAP Protocol Compliance
Implements IVOA TAP v1.1 specification:
/sync
🔮 Future Work
/async
endpoint)The prototype successfully integrates with
bin/adql_to_lsdb
and converts ADQL queries to LSDB operations!Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.