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

Wrong variable name in subgraph_by_names #433

Open
kwang2049 opened this issue Feb 7, 2023 · 0 comments
Open

Wrong variable name in subgraph_by_names #433

kwang2049 opened this issue Feb 7, 2023 · 0 comments

Comments

@kwang2049
Copy link
Collaborator

The argument variable should be named something like names but nids:

@router.post(
"/{kg_name}/subgraph/query_by_node_name",
summary="summary",
description="Get the subgraph of a given List of node-names and the number of hops",
responses={
200: {
#"model": DatastoreStats,
"description": "The subgraph as a set of nodes and edges",
},
404: {"description": "The subgraph could not be retrieved"},
},
#response_model=DatastoreStats,
)
async def subgraph_by_names(
kg_name: str = Path(..., description="The knowledge graph name"),
nids: set = Body(..., description="List of node names."),
hops: int = Body(2, description="Number of hops to retrieve."),
conn=Depends(get_kg_storage_connector),
):
# Need to handle if wrong kg_name was gave as an input
subgraph = await conn.extract_subgraph_by_names(kg_name, nodes=nids, hops=hops)
if subgraph is not None:
return subgraph
else:
raise HTTPException(status_code=404)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant