Skip to content

Wrong variable name in subgraph_by_names #433

Description

@kwang2049

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions