MissionalDigerati / joshua_project_api

An API for connecting to the Joshua Project data.
GNU General Public License v3.0
6 stars 2 forks source link

Feature Request: Limit Columns returned #10

Open cforbesywam opened 9 years ago

cforbesywam commented 9 years ago

This is more of a feature request not an issue. It would be better if there was a way to limit the columns (not rows) returned. For example suppose I only need the ROP3 and PeopleName - it would be better if there was a way to specify this in the query so we are not transferring a bunch of data that is not needed this will saved on CPU cycles as well as network bandwidth.

People may not need to want all the data at once. Especially the long text fields like Profile Text, Resources, etc.

codemis commented 9 years ago

Thanks for the suggestion! This would be a great improvement to the API.

joshuaproject commented 9 years ago

I have a function to handle this I built with another api.

On Fri, Dec 5, 2014 at 4:05 PM, Johnathan Pulos notifications@github.com wrote:

Thanks for the suggestion! That is would be a great improvement to the API.

— Reply to this email directly or view it on GitHub https://github.com/MissionalDigerati/joshua_project_api/issues/10#issuecomment-65869027 .

Eric DeGrove Joshua Project

mgayheart commented 9 years ago

IMB would find this enhancement useful too! We have held off on moving ahead with using the api to help with people group photos in www.peoplegroups.org because of the overhead of pulling across all of the columns.

mgayheart commented 9 years ago

An example implementation of limiting columns (powered by ArcGIS Server) can be seen in these two queries: http://api.imb.org/arcgis/rest/services/LIVE/PeopleGroupsOrg/MapServer/0/query?where=ROP3=%27102365%27&returnGeometry=false&outFields=*&f=pjson vs. http://api.imb.org/arcgis/rest/services/LIVE/PeopleGroupsOrg/MapServer/0/query?where=ROP3=%27102365%27&returnGeometry=false&outFields=ROP3,PplNm&f=pjson

The outFields parameter determines which fields are returned. A handy query interface can be found by removing the url parameters like this: http://api.imb.org/arcgis/rest/services/LIVE/PeopleGroupsOrg/MapServer/0/query

Keep up the good work!

joshuaproject commented 9 years ago

I am adding this feature as we speak to v2 of the api.

On Wed, Jan 7, 2015 at 10:26 AM, Michael Gayheart notifications@github.com wrote:

An example implementation of limiting columns (powered by ArcGIS Server) can be seen in these two queries:

http://api.imb.org/arcgis/rest/services/LIVE/PeopleGroupsOrg/MapServer/0/query?where=ROP3=%27102365%27&returnGeometry=false&outFields=*&f=pjson vs.

http://api.imb.org/arcgis/rest/services/LIVE/PeopleGroupsOrg/MapServer/0/query?where=ROP3=%27102365%27&returnGeometry=false&outFields=ROP3,PplNm&f=pjson

The outFields parameter determines which fields are returned. A handy query interface can be found by removing the url parameters like this: http://api.imb.org/arcgis/rest/services/LIVE/PeopleGroupsOrg/MapServer/0/query

Keep up the good work!

— Reply to this email directly or view it on GitHub https://github.com/MissionalDigerati/joshua_project_api/issues/10#issuecomment-69057260 .

Eric DeGrove Joshua Project

codemis commented 9 years ago

@joshuaproject Thanks for the offer, but I slated some time later this week to add it. If you prefer to do it, just let me know. You can send me a pull request when your done.

douwepausma commented 7 months ago

Has this every been implemented? I can't find it in the documentation. I only need the PercentChristianity and am trying to reduce load times :) Thanks!

codemis commented 7 months ago

Hi @douwepausma . Thank you for following up on this. We originally had a version 2 of the API where this feature was implemented. However, the version 2 API was very unwieldy and was causing issues with the main website. So that API has been discontinued. The version 1 API is up, but does not currently support this feature. I will send the request to @joshuaproject and maybe we can complete it in one of our sprints. I will let you know if it gets completed.

cforbesywam commented 7 months ago

Hi Guys, Yes that would be good. We (ywam.org) started using a mix of standard API and GraphQL. GraphQL is fast and fairly easy to set up and it's easy to define exactly what data fields you get back from a specific query. Using a tool like that should really help with performance as it dynamically builds the queries so even at the sql response level you are only getting the data back that you actually need. Which should help not hurt preformance.