Cuesta College is at latitude 35.331276, longitude -120.742235, in San Luis Obispo County, California.
That’s a description. Can a graph do anything with it? Can it tell you which campuses are near each other, or confirm that a campus is really in the state its address names?
It depends on how the location is written. This is the thirteenth and final experiment in a series that uses one public dataset, NCES IPEDS 2024, to show how languages and models change what a knowledge graph says. Experiment 12 put an LLM in front of the graph. This one puts the graph on a map. The code, data and results are all on GitHub.
Two ways to write a location
Every one of the 45 institutions comes with a point, a county, a locale code and a region. We wrote them two ways, on the same campus node. Each heading links to the full example on GitHub.
schema.org: describe the location
The college has a location: a Place with coordinates, a postal address and links to its county and state. This is what a page’s JSON-LD carries.
"location": {
"@type": "Place",
"geo": { "@type": "GeoCoordinates", "latitude": 35.331276, "longitude": -120.742235 },
"address": { "@type": "PostalAddress", "addressLocality": "San Luis Obispo", "addressRegion": "CA" },
"containedInPlace": { "@type": "AdministrativeArea", "name": "San Luis Obispo County" }
}
GeoSPARQL: make it a geometry
GeoSPARQL is the Open Geospatial Consortium’s standard for spatial data in RDF. The same campus becomes a feature with a geometry, written in a text format called WKT. States and regions are features too, with polygon geometries.
<.../id/ipeds/113193/campus> a geo:Feature ;
geo:hasGeometry <.../id/ipeds/113193/geometry> .
<.../id/ipeds/113193/geometry> a sf:Point ;
geo:asWKT "<http://www.opengis.net/def/crs/OGC/1.3/CRS84> POINT(-120.742235 35.331276)"^^geo:wktLiteral .
Look closely at the two examples. schema.org says latitude, then longitude. The WKT point says longitude, then latitude. That difference comes back later.
We loaded US state boundaries beside the campuses, asked four spatial questions in SPARQL and checked every answer against plain Python over the CSVs.
See it: the map and the graph, side by side
In the visualization below, filter the map and the graph by region and locale, draw pairs of campuses within 10 to 100 km, and compare how each model writes a campus.
Open the visualization in a new tab
Results: four questions
Every SPARQL answer matched the plain-Python answer.
Q1. Which rural and town institutions offer fully online programs? The sample has one rural campus and four town campuses. Three of the five offer at least one program completely online. American Public University System, in a town locale, offers 200.
This question needs no geometry. The locale code is an attribute. We included it because it’s the kind of question people expect a map to answer, and the honest answer is that this sample is mostly urban: 31 city campuses, 9 suburban, 4 town and 1 rural.
Q2. Which campuses are within N km of each other?
| Distance | Pairs of campuses |
|---|---|
| 10 km | 6 |
| 25 km | 17 |
| 50 km | 25 |
| 100 km | 30 |
The closest pair is NYU and St. Francis College, 4.4 km apart. Arizona State and the University of Phoenix are 7.3 km apart.
We also asked “what’s within N km of a point?” two ways: with GeoSPARQL’s distance function, and with a schema.org-only query that filters latitude and longitude inside a box. Plain SPARQL has no trigonometry, so a box is the best it can do. The box agreed in 10 of 12 tests. At 300 km from Times Square, it added three schools that are really 329 to 351 km away, because the corners of a box reach about 41% farther than a circle.
Q3. Which state contains each campus?
| Boundaries | Campuses in the state their address names |
|---|---|
| Full resolution | 45 of 45 |
| Simplified copy | 44 of 45 |
At full resolution, every campus is where its address says. On the simplified boundaries, St. Francis College, in Brooklyn near the East River, falls in no state at all.
Q4. Where do online students live? Across the 41 schools with a breakdown, 78.4% of students enrolled exclusively online live in a different state from their school. That number is mostly four institutions: Western Governors, Southern New Hampshire, University of Phoenix and American Public University System. Without them, the share is 31.0%.
Where location goes wrong
Swapped axes fail silently. We rebuilt the graph with each point written latitude first and reran the same queries. No campus fell in any state: 0 of 45. Twenty campuses disappeared from the distance results. The other 25 became valid points near Antarctica, and the queries calculated distances between them as if that’s where they were. Two pairs came back as being within 50 km when they’re really 142 and 267 km apart.
Nothing in the output said anything had gone wrong. No error, no warning.
Simplified boundaries move coastlines. Simplifying the shoreline by about 2 km is invisible on a national map. It was still enough to put a waterfront campus in the water.
A point is the headquarters, not the audience. Western Governors University’s point is in Salt Lake County, Utah. But 199,614 of its 210,208 exclusively online students live in other states. A distance query treats it as a Utah school. That’s true of its address and not of its students.
Describing a location vs. reasoning about one
schema.org‘s location vocabulary is descriptive. GeoCoordinates holds two numbers, and containedInPlace holds a link someone typed. A consumer can display them or copy them into a map. Nothing in the vocabulary says how to compute with them. That’s enough for what schema.org is for: telling search engines and LLMs what an entity is and where it is.
GeoSPARQL adds geometry as a datatype and a set of functions over it: distance, within, contains, intersects. That lets a query derive facts no one stated, such as “these two campuses are 7.3 km apart,” and check the ones someone did.
The two fit together. Publish the descriptive layer on the page, keep the geometric layer in the graph behind it and use the second to verify the first.
GeoSPARQL has a real cost, though. The points were trivial. The polygons had to be found, licensed, simplified and checked, and simplifying them changed an answer. Engine support was the bigger problem. We couldn’t find a ready-made Python engine for these functions, so we implemented four of them ourselves as a limited subset. The queries are standard and should run unchanged on a full engine.
Why this matters for local-intent search
Searches like “nursing programs near me” or “community college in Fort Worth” are local. Search engines and LLMs answer them by matching the searcher’s location against what they believe about each institution: its coordinates, address, county and the places it says it serves.
A few practical takeaways:
- Check your coordinates. Swapped or stale coordinates give those systems conflicting signals, and as this experiment showed, nothing will warn you.
- Make your location facts agree. The address on the page, the coordinates in the markup and your directory listings should all point at the same place.
- Verify containment on good boundaries. Or store the answer, such as the state and county, as a fact, and use polygons only to check it.
- Don’t let one point stand in for an online audience. For an online program, “near me” is really about where the school can enroll students, and a single
geopoint can’t express that.
Pro tip: Plot your markup’s coordinates on a map once. A campus in the ocean, or in the wrong hemisphere, is obvious to a person and invisible to a validator.
Simply put, a location in structured data is a claim like any other. It’s worth checking against something independent.
Where the series lands
Thirteen experiments, one dataset. Looking back across them, the same result kept showing up: the files parsed, the queries ran, and the answer still depended on a modeling decision somebody made. Where a number is attached. Which vocabulary carries the context. Whether a category is a class or a concept. Which way round the coordinates go.
None of those are syntax errors, and no validator catches them by default. They’re the reason I think of structured data as infrastructure, not a hack. The format is the easy part.
Run it yourself
Everything behind this post is in the Experiment 13 folder on GitHub. That includes the build script, the SPARQL queries for all four questions, the simplified state boundaries, the full results and the visualization. The run takes about nine seconds and downloads nothing.
The full series, with all 13 experiments, is in the kgn-ipeds-experiments repository.
