codeforamerica / cfapi

The Code for America API. Tracks and motivates activity and participation across the civic technology movement.
http://codeforamerica.org/api
MIT License
113 stars 52 forks source link

Enhance api hierarchy #332

Closed milovanderlinden closed 6 years ago

milovanderlinden commented 6 years ago

Currently, Code For All is implemented at the level of brigades. I think this is not completely correct. I know that the cfapi is written from code-for-america as main object, but honestly, code-for-all shoul be a top level object as code-for-all has partners for all the individual countries who have brigades/chapters nationally. The hierarchy is therefor:

For this to work; brigades should get a parent object being a partner (f.i. code-for-america, code-for-germany) it would then be possible to browse brigades per specific country.

Would it be possible to implement such a hierarchy?

tdooner commented 6 years ago

Hey @milovanderlinden, I'm curious if you saw the tags array that I added previously to the brigade-information repo? I think it could be used to implement a hierarchy like this, and also be more flexible for unforeseen structures.

For example, the "Brigade" tag indicates that the group is a brigade, and then there are tags for "Code for America" and "Code for Japan" as well. The API allows you to filter by tags so you could easily retrieve, say, a list of brigades tagged with "Official" and "Code for America". (That is what our current brigade website does.)

milovanderlinden commented 6 years ago

I could work from that, but it is not the most flexible solution. I would have to interpret all the free text and somehow relate them to organizations. It would be easier if I could be sure that a tag is an id to another organization.

milovanderlinden commented 6 years ago

So say, I want all chapters for Code For Germany. How could I achieve that via the API? And If I want all governing partners for Code For All? And all affiliate partners?

tdooner commented 6 years ago

You can get all the OK Lab groups like this: http://api.codeforamerica.org/api/organizations?tags[]=OK%20Lab

If you want all the top-level organizations, you can use the "Code for All" tag, which currently is only applied to the national (or continental) level organizations.

I'm not sure what you mean by "affiliate partners" -- do you have an example?

I know that this is unstructured, but I think we will have a problem if we try to impose too much hierarchy. For instance, consider Code for Africa. What do we do with them? Do we need to add another level so that Code for South Africa can be underneath them? There might also be regional brigades, for example some of us are talking about making a "Code for California" group. It gets messy very quickly.

milovanderlinden commented 6 years ago

It is not true that the "code for all tag" shows only national or continental partners. I am using the organizations.geojson on this page http://code-for-all.github.io/codeforall.org/partners/ and it shows for instance; Code For Mexico City, Hacking Monterrey, Code Namu, Code for Tomorrow and Open Brasil. It seems Code For All is currently used for anything not Code For America.

I am one of the folks "doing" Code For Europe. We have the same thing going as Code For Africa. I think the Code For All board would have to come up with an extra tag for instance for continental, regional, international and local. The policy (if I am correct) is that people interested in Code For All should be redirected to their national initiative and if not available; learn how to set one up. But I will bring this to the Code For All slack for discussion. Of course you can misuse tags for multidimensional relations, but I would like to try to at least have some convention accepted.

Governing partners: http://code-for-all.github.io/codeforall.org/partners/governing-partner Affiliate partners: http://code-for-all.github.io/codeforall.org/partners/affiliate-partner

milovanderlinden commented 6 years ago

Let's close this issue for now. I don't want to mess up your development and I think this is more of an issue that needs to be solved by the Code For All board then a technical issue. Technically it is arbitrary. Thanks for thinking with me!

tdooner commented 6 years ago

Maybe a bit more of a convention around these tags would be helpful -- for instance by removing the "Code for All" tag from those brigades. Or, if they are affiliate partners, then by adding tags for "Affiliate Partner" and "Governing Partner".