---
# System prepended metadata

title: Untitled

---



## Goal


**Need**
How to see which community members fall under persona

## Graphic

![](https://i.imgur.com/VOe1eWd.png)


## Prereqs

// we need to make some changes to the `Community` subgraph for this to work:
- Persona needs to be connected to relevant **outcome** tokens with a `HAS_OUTCOME_TOKEN` edge, i.e. ```(persona)-[r:_HAS_OUTCOME_TOKEN]->(token)```. You can identify eligible tokens with the clause `where t.address in persona._outcomeTokens`
- Persona needs to be connected to relevant **_requirementTokens** with a `HAS_REQUIREMENT_TOKEN` edge
- Same with the rest of the properties that contain wallet or token addresses: ```i.e. (persona)-[:_HAS_MOODBOARD_TOKEN]->(token) where token.address in persona._moodBoardTokens```. Same for `_moodBoardWallets`
- The `_HAS_TOKEN` edge between communities and the `Element:Token` nodes needs to be changed to `HAS_MEMBERSHIP_TOKEN`


## Query
I haven't tested this on working data yet, but should work!
Will edit once I finish the others.

```
match
    (p:_Persona {_communityId: "porComff45a3"})
with 
    p
match
    (wallet:Wallet)-[:HOLDS]->(member:Token)-[:_HAS_MEMBERSHIP_TOKEN]-(element:_Element {_communityId: "porComff45a3"})
where
    not (wallet)-[:_HAS_CONTEXT]->(:_IncentiveFarming)
with
    p, count(distinct(wallet)) as total_members
match
    (clean:Wallet)-[:HOLDS]->(outcome:Token)-[:_HAS_OUTCOME_TOKEN]-(persona:_Persona {_communityId: "porComff45a3"})
where not 
    (clean)-[:_HAS_CONTEXT]->(:_IncentiveFarming)
with
    count(distinct(clean)) as aligned_clean, p, total_members
match
    (farmer:Wallet)-[:HOLDS]->(member:Token)-[:_HAS_OUTCOME_TOKEN]-(p:_Persona {_communityId: "porComff45a3"})
where
     (farmer)-[:_HAS_CONTEXT]->(:_IncentiveFarming)
with
    aligned_clean, total_members,  count(distinct(farmer)) as farmers
with
    aligned_clean, total_members, farmers, total_members - (aligned_clean - farmers) as awaiting_activation
return
    {
        total: total_members,
        aligned: aligned_clean,
        farmers: farmers,
        awaiting_activation: awaiting_activation
        
    }
```
