Skip to content
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

Implement New Weaviate Repository #61

Merged
merged 6 commits into from
Aug 28, 2024
Merged

Implement New Weaviate Repository #61

merged 6 commits into from
Aug 28, 2024

Conversation

mehmetcanay
Copy link
Member

Implemented the new weaviate repository functions for the API endpoints.

closes #59

@mehmetcanay mehmetcanay added the enhancement New feature or request label Aug 22, 2024
@mehmetcanay mehmetcanay self-assigned this Aug 22, 2024
@@ -123,17 +129,26 @@ async def get_all_concepts():


@app.put("/concepts/{id}", tags=["concepts"])
async def create_or_update_concept(id: str, terminology_id: str, name: str):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless the request param name matches the param name, this should not work afaik

Test for e.g./concepts/some_id

Copy link
Member Author

@mehmetcanay mehmetcanay Aug 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, I missed it. Fixed in the next push.

@@ -143,33 +158,58 @@ async def get_all_mappings():


@app.put("/concepts/{id}/mappings", tags=["concepts", "mappings"])
async def create_concept_and_attach_mapping(id: str, terminology_id: str, concept_name: str, text: str):
async def create_concept_and_attach_mapping(concept_id: str, concept_name: str, terminology_name, text: str):
try:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And fixed here too.

api/routes.py Outdated
raise HTTPException(status_code=404, detail=f"Concept with id {concept_id} not found")
result = repository.client.query.get(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this logic should be part of datastew imo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, we can have functions like get_terminology(terminology_name: str) and get_concept(concept_id: str). Should I start implementing it?

api/routes.py Outdated Show resolved Hide resolved
@tiadams tiadams merged commit af31783 into main Aug 28, 2024
7 checks passed
@tiadams tiadams deleted the refactor-api-endpoints branch August 28, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update datastew version to use new weaviate repository
2 participants