Get current state from a person?


#1

Hello,

I’m relatively new here and have enjoyed exploring the data. I’m working on some updates to an app where we pull in a series of legislative information about a person (their name, photo, office(s) where they work, and more. I’m having trouble getting the following information about a person specifically, the state where they are a legislator.

To do so, first I look up the person:

{
  person(id:"ocd-person/70b66c63-35f1-416d-9816-79d5752481a6"){
    name
    currentMemberships (classification: ["legislature", "upper", "lower"] ) {
   	 label
   	 personName
      organization {
        id
        name
        classification
      }
    }
  }
}

From there I can look up information about the organization and find that there is a parent organization for the CA state legislator:

{
  organization(id:"ocd-organization/e70e812e-44d2-46b0-9eae-2f3b9a1d5150") {
    name
    id
    classification
    extras
    parent {
      name
      id
    }
  }
}

And while I can see in this example the name is “California State Legislature”, is there a way for me to find out that this organization is actually based in California? It seems like that may be available through ‘Division’ or ‘Jurisdiction’ but I don’t see a way to filter jurisdictions this way.

If there is a more efficient way of getting to this information, any help would be appreciated!


#2

It seems like you need to navigate from person to jurisdiction, and AFAICT, there’s no way to do that. Most folks are working in a context where the user implicitly or explicitly starts with a state that they’re interested in.

On the other hand, you later say “I don’t see a way to filter jurisdictions this way” which makes me wonder if I’m misunderstanding. If so, you might want to check out my post


#3

Thanks Ed, I am trying to navigate from a person to see which one of the 50 US states (or DC) they represent, and I think that would be via jurisdiction, but it sounds like there isn’t any straight forward way to do that…

What I meant by this:

I don’t see a way to filter jurisdictions this way

Was that I thought maybe I could query ‘all’ jurisdictions and filter by a related person somehow, but I don’t think that’s possible either.

So, maybe I have to query to get every chamber of every state, and then get every legislator in every one of those chambers. I can save those locally and then search through them for the legislator I want and work backwards from there.

Not terribly efficient but possible in theory. If you or anyone has any more efficient ideas though, I’d love to test them out.


#4

Yes, getting all the legislators for all the states is, AFAIK, necessary for this kind of query at this time.


#5

If you want to file a feature request, here’s where to do it: