Skip to content
Snippets Groups Projects
Commit 24fe671d authored by Tim Repke's avatar Tim Repke
Browse files

expose NQL grammar

parent 56692a3f
No related branches found
No related tags found
1 merge request!56Master
import httpx import httpx
from nacsos_data.db.crud.items.query.parse import GRAMMAR
from pydantic import BaseModel from pydantic import BaseModel
from fastapi import APIRouter, Depends from fastapi import APIRouter, Depends
import sqlalchemy.sql.functions as func import sqlalchemy.sql.functions as func
...@@ -79,6 +80,11 @@ async def term_expansion(term_prefix: str, ...@@ -79,6 +80,11 @@ async def term_expansion(term_prefix: str,
] ]
@router.get('/nql/grammar', response_model=str)
async def nql_grammar() -> str:
return GRAMMAR
class QueryResult(BaseModel): class QueryResult(BaseModel):
n_docs: int n_docs: int
docs: list[AcademicItemModel] docs: list[AcademicItemModel]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment