-
-
Notifications
You must be signed in to change notification settings - Fork 146
[FEATURE] Backend REST API Routes for SKOS Vocabulary Explorer #421
Copy link
Copy link
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Summary
The frontend React UI for the Vocabulary Workspace is complete (see PR #420), but the FastAPI backend routes required to serve the data do not currently exist in semantica/explorer/routes/.
To support the UI, we need to implement the vocabulary.py router and append the corresponding Pydantic schemas to schemas.py.
Required Endpoints (semantica/explorer/routes/vocabulary.py)
GET /api/vocabulary/schemes- Returns: A list of available SKOS vocabularies/ontologies currently loaded in the graph.
GET /api/vocabulary/hierarchy- Params:
scheme(string URI) - Returns: A nested JSON tree representing the broader/narrower hierarchy of concepts for the selected scheme.
- Params:
POST /api/vocabulary/import- Accepts:
UploadFile(multipart/form-data containing.ttlor.rdffiles). - Action: Parses the file (likely via
rdflib) and ingests the SKOS concepts into the currentGraphSession.
- Accepts:
Required Schemas (semantica/explorer/schemas.py)
class VocabularyScheme(BaseModel):
uri: str
label: str
description: Optional[str] = None
class ConceptNode(BaseModel):
uri: str
pref_label: str
alt_labels: List[str] = Field(default_factory=list)
children: Optional[List['ConceptNode']] = NoneReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
In progress