This guide walks through five SPARQL queries you can run against the Global.Church knowledge graph. Each example shows both a curl command and a JavaScript fetch equivalent.
All queries go through the API gateway at https://api.global.church/v0/sparql. You need an API key -- get one from the developer portal at platform.global.church/developer.
Authentication
Every request requires an Authorization header with your API key:
Code
Authorization: Bearer YOUR_API_KEY
The SPARQL endpoint accepts POST requests with Content-Type: application/sparql-query. Responses come back as application/sparql-results+json by default.
Query 1: Count All Triples
A simple health check -- how much data is in the graph?
Code
SELECT (COUNT(*) AS ?count) WHERE { ?s ?p ?o }
curl:
Code
curl -X POST \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/sparql-query" \ -d 'SELECT (COUNT(*) AS ?count) WHERE { ?s ?p ?o }' \ "https://api.global.church/v0/sparql"
What to expect: Up to 20 rows, each with an organization name and optionally a city and state. The graph contains 37,000+ organizations materialized from Supabase. Change "US" to any ISO 3166-1 alpha-2 country code.
Query 3: Find Unengaged People Groups
People groups with no known engagement activity from any organization.
Code
PREFIX gc: <https://ontology.global.church/core#>PREFIX jp: <https://ontology.global.church/joshuaproject#>SELECT ?pgName ?country WHERE { ?pg a gc:PeopleGroup ; gc:peopleName ?pgName ; gc:country ?country . FILTER NOT EXISTS { ?activity gc:engagesPeopleGroup ?pg }} LIMIT 20
What to expect: People group names and country codes where no engagement has been recorded. Note the open-world caveat: "no known engagement" means no engagement triple exists in the graph -- it could mean unengaged or simply unreported. The FILTER NOT EXISTS pattern is the standard way to find gaps in RDF data.
Query 4: Get Assessment Data for a People Group
Uses the 3-block pattern: PeopleGroup + Assessment + AssessmentResult. Assessment data (JP Scale, percent Christian, etc.) lives on gc:AssessmentResult, not directly on the people group.
What to expect: People group names with their Joshua Project progress scale value (1-5) and percentage of Christian adherents. This is the 3-block assessment pattern used throughout the knowledge graph -- assessment metrics are always on gc:AssessmentResult, linked to the people group via gc:resultForPeopleGroup. Both Joshua Project and IMB data follow this same pattern.
Query 5: Search Organizations with Coordinates
Find organizations that have latitude and longitude data.
What to expect: Organization names with their geographic coordinates. Not all organizations have coordinates -- many have only city/state/country. You can combine this with a FILTER to search within a bounding box for geographic proximity queries.
Query 6: Compare Assessment Sources for a People Group
Different organizations assess the same people group using different methodologies. This query retrieves JP and IMB assessments side by side, showing which methodology each used.
What to expect: Rows showing the same people group assessed by different organizations (Joshua Project, IMB), each with their assessment methodology name. JP results will have jpScale populated; IMB results will have gsec populated. This demonstrates how the 3-block assessment pattern preserves multiple perspectives with full provenance.
Response Format
All queries return SPARQL Results JSON. The structure looks like this:
Each binding is an object where keys match the SELECT variable names. Optional values (from OPTIONAL clauses) may be missing from individual bindings.
Rate Limits
The API gateway enforces 100 requests per minute per API key. For bulk data needs, consider requesting a higher limit or using the ingest API to contribute data directly.