From 9d03b0bde1d2e30cfad035faa73e6ed2df021567 Mon Sep 17 00:00:00 2001 From: kimakan <45099849+kimakan@users.noreply.github.com> Date: Mon, 27 May 2024 09:33:15 +0200 Subject: [PATCH] add docu page for the supported adql features --- .../query/templates/query/documentation.html | 115 ++++++++++++++++++ daiquiri/query/urls.py | 3 +- daiquiri/query/views.py | 5 + 3 files changed, 122 insertions(+), 1 deletion(-) create mode 100644 daiquiri/query/templates/query/documentation.html diff --git a/daiquiri/query/templates/query/documentation.html b/daiquiri/query/templates/query/documentation.html new file mode 100644 index 000000000..f33da48b0 --- /dev/null +++ b/daiquiri/query/templates/query/documentation.html @@ -0,0 +1,115 @@ +{% extends 'core/wide.html' %} +{% load static %} +{% load compress %} +{% load i18n %} + + +{% block wide %} + +

{% trans 'Support for the ADQL queries at ' %} {{settings.SITE_TITLE }}

+

The current implementation supports the ADQL version + 2.1. + While our service adheres to the ADQL standard, it's important to note + that the standard allows for some flexibility in the implementation of + ADQL datatypes and functions. Here, we describe how we've implemented + the ADQL datatypes and functions in our service, outlining the + differences from the official ADQL standard. +

+

Datatypes

+

Our services do not explicitly return ADQL datatypes for + point, + circle, and + polygon + (for example, there is no point as a xtype). Instead, they + return an array that fully adheres to the standard. For instance, there is + a double/float array of size 2 for a point, + size 3 for a circle, and size '*' for a polygon. +

+

Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
POINTFully supported
CIRCLESupported syntax:
+ CIRCLE(25.4, -20.0, 10.0)
+ CIRCLE('ICRS', 25.4, -20.0, 10.0)(deprecated)
+ CIRCLE(POINT(25.4, -20.0), 10.0)
+ CIRCLE(t1.ra, t1.dec, t1.radius)
+ CIRCLE(POINT(t1.ra, t1.dec), t1.radius)
+ Not supported:
+ CIRCLE(t1.center, t1.radius) where + t1.center is a reference to a column that + contains a POINT value. +
BOXThis function is deprecated in ADQL 2.1.
+ Supported syntax:
+ BOX(25.4, -20.0, 10.0, 10.0)
+ BOX('ICRS', 25.4, -20.0, 10.0, 10.0)
+ References to the columns are not supported! +
POLYGON Supported syntax:
+ POLYGON(10.0, -10.5, 20.0, 20.5, 30.0, 30.5)
+ POLYGON('ICRS', 10.0, -10.5, 20.0, 20.5, 30.0, 30.5) (deprecated) +
AREA Supported for the implemented geometric types + POINT, CIRCLE, + BOX and POLYGON +
DISTANCESupports the two and four parameters version.
+ DISTANCE(POINT(ra, dec), POINT(13.66, -58.3))
+ DISTANCE(ra, dec, 13.66, -58.3)
+ where ra and dec are column references.
+ Not supported are references to the columns of + type POINT. +
CONTAINSDoes not support references to the columns containing + values of the types POINT, CIRCLE or POLYGON. + The values must be created explicitly in the query. The examples + for the supported syntax are
+ CONTAINS(POINT(25.0, -19.5), CIRCLE(25.4, -20.0, 10.0))
+ CONTAINS(POINT(ra, dec), CIRCLE(25.4, -20.0, 10.0))
+ CONTAINS(POINT(25.0, -19.5), CIRCLE(ra, dec, 10.0)) +
INTERSECTSDoes not support references to the columns containing + values of the types POINT, CIRCLE or POLYGON. + The values must be created explicitly in the query. The examples + for the supported syntax are
+ INTERSECTS(CIRCLE(25.4, -20.0, 1), + POLYGON(20.0, -15.0, + 20.0, -5.0, + 10.0, -5.0, + 10.0, -15.0)) +
+ INTERSECTS(CIRCLE(ra, dec, 1), + POLYGON(20.0, -15.0, + 20.0, -5.0, + 10.0, -5.0, + 10.0, -15.0)) + +
+{% endblock %} diff --git a/daiquiri/query/urls.py b/daiquiri/query/urls.py index 0080d24f7..66161f361 100644 --- a/daiquiri/query/urls.py +++ b/daiquiri/query/urls.py @@ -1,7 +1,7 @@ from django.urls import include, path from rest_framework import routers -from .views import ExamplesView, JobsView, QueryView +from .views import ExamplesView, JobsView, QueryView, QueryDocumentationView from .viewsets import (DropdownViewSet, ExampleViewSet, FormViewSet, PhaseViewSet, QueryJobViewSet, QueryLanguageViewSet, QueueViewSet, StatusViewSet, DownloadViewSet) @@ -23,6 +23,7 @@ path(r'', QueryView.as_view(), name='query'), path(r'jobs/', JobsView.as_view(), name='jobs'), path(r'examples/', ExamplesView.as_view(), name='examples'), + path(r'documentation/', QueryDocumentationView.as_view(), name='documentation'), # rest api path(r'api/', include(router.urls)), diff --git a/daiquiri/query/views.py b/daiquiri/query/views.py index 4e4760917..d04d709a7 100644 --- a/daiquiri/query/views.py +++ b/daiquiri/query/views.py @@ -32,3 +32,8 @@ def get_context_data(self, **kwargs): 'Example': get_model_field_meta(Example) } return context + + +class QueryDocumentationView(TemplateView): + + template_name = 'query/documentation.html'