Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue 312] Initial quantity distribution endpoint #319

Merged
3 commits merged into from
Jul 11, 2023

Conversation

ghost
Copy link

@ghost ghost commented Jul 11, 2023

All documents

curl --location 'http://localhost:9000/individual/analytics/quantityDistribution?field=tags&filters=class&class.filter=Document%20OR%20type%3AcreativeWork&class.opKey=EXPRESSION&label=UN%20SDG'
{
    "label": "UN SDG",
    "field": "tags",
    "distribution": [
        {
            "label": "7 Affordable and Clean Energy",
            "count": 6134
        },
        {
            "label": "3 Good Health and Well-Being",
            "count": 6039
        },
        {
            "label": "13 Climate Action",
            "count": 2775
        },
        {
            "label": "15 Life on Land",
            "count": 1780
        },
        {
            "label": "4 Quality Education",
            "count": 1605
        },
        {
            "label": "14 Life Below Water",
            "count": 1224
        },
        {
            "label": "2 Zero Hunger",
            "count": 1073
        },
        {
            "label": "16 Peace, Justice and Strong Institutions",
            "count": 821
        },
        {
            "label": "11 Sustainable Cities and Communities",
            "count": 682
        },
        {
            "label": "6 Clean Water and Sanitation",
            "count": 540
        },
        {
            "label": "12 Responsible Consumption and Production",
            "count": 378
        },
        {
            "label": "10 Reduced Inequalities",
            "count": 361
        },
        {
            "label": "9 Industry, Innovation and Infrastructure",
            "count": 293
        },
        {
            "label": "8 Decent Work and Economic Growth",
            "count": 265
        },
        {
            "label": "5 Gender Equality",
            "count": 197
        },
        {
            "label": "1 No Poverty",
            "count": 49
        },
        {
            "label": "17 Partnerships for the Goals",
            "count": 16
        }
    ]
}

Documents filtered by organization

curl --location 'http://localhost:9000/individual/analytics/quantityDistribution?field=tags&filters=class%2CauthorOrganization&class.filter=Document%20OR%20type%3AcreativeWork&class.opKey=EXPRESSION&label=UN%20SDG&authorOrganization.filter=Energy%20Institute&authorOrganization.opKey=EQUALS'
{
    "label": "UN SDG",
    "field": "tags",
    "distribution": [
        {
            "label": "7 Affordable and Clean Energy",
            "count": 3223
        },
        {
            "label": "13 Climate Action",
            "count": 959
        },
        {
            "label": "15 Life on Land",
            "count": 231
        },
        {
            "label": "14 Life Below Water",
            "count": 169
        },
        {
            "label": "11 Sustainable Cities and Communities",
            "count": 163
        },
        {
            "label": "3 Good Health and Well-Being",
            "count": 159
        },
        {
            "label": "6 Clean Water and Sanitation",
            "count": 155
        },
        {
            "label": "12 Responsible Consumption and Production",
            "count": 151
        },
        {
            "label": "2 Zero Hunger",
            "count": 115
        },
        {
            "label": "4 Quality Education",
            "count": 77
        },
        {
            "label": "9 Industry, Innovation and Infrastructure",
            "count": 68
        },
        {
            "label": "16 Peace, Justice and Strong Institutions",
            "count": 44
        },
        {
            "label": "8 Decent Work and Economic Growth",
            "count": 33
        },
        {
            "label": "10 Reduced Inequalities",
            "count": 32
        },
        {
            "label": "5 Gender Equality",
            "count": 4
        },
        {
            "label": "1 No Poverty",
            "count": 1
        }
    ]
}

@ghost ghost requested review from jcreel, kaladay and rmathew1011 July 11, 2023 15:43
@ghost ghost linked an issue Jul 11, 2023 that may be closed by this pull request
Copy link

@kaladay kaladay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.
The names are a bit long but I don't know what can be done about that.

@ghost ghost merged commit 860d135 into june-2023-sprint-staging Jul 11, 2023
12 checks passed
@ghost ghost deleted the 312-quantity-distribution-api branch July 17, 2023 13:01
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10. Texas A&M Research in UN SDG, Last 10 Year - Backend API
2 participants