My graph has node types: Provider, Diagnosis, Procedure (and more). I want to derive or calculate node centrality for all nodes: degree, pagerank, and eigenvector centralities.
My starting methodology is as follows:
- create a graph projection
- apply the gds degree centrality on the graph projection to get the centrality for each node.
Here is what I'm having trouble with:
`query ='''CALL gds.graph.project('mygraph', myNodes, myLinks)'''`
where my myNodes is:
'MATCH (n) where n:Provider or n.Diagnosis return id(n) as id',
where myLinks is:
` match (s:Provider)-[r:PROVIDES_DIAGNOSIS]-(t:Diagnosis) where r.some_ratio > 0 return id(s) as src, id(t) as trg, r.some_ratio as weight',
Then I want to apply degree.stream:
CALL gds.degree.stream( 'mygraph')
YIELD nodeId, score
RETURN gds.util.asNode(nodeId).provider_id as provider, score
order by score desc'''
Here is the error message ```
{message: Failed to invoke procedure `gds.graph.project`: Caused by: java.lang.IllegalArgumentException: Invalid node projection, one or more labels not found: 'match (n) where n:Diagnosis or n:Provider return id(n) as id'}
```query = """ CALL gds.graph.project(
'mygraph',
'match (n) where n:Diagnosis or n:Provider return id(n) as id',
'MATCH(n:Provider)-[r]-(m:Diagnosis) where r.claims_ratio_float > 0 RETURN id(n) as source, id(m) as target, r.claims_ratio_float as weight',
{relationshipProperties: 'weight'}
)"""
result = session.run(query)`
The query is incorrect, but I can't figure a fix to this query.