Suppose a conservator asks, “Did the temperature change by more than 5 °C in the last hour?” The answer depends on which sensor produced each reading and when it was taken. A language model can interpret the question. The database and a small rule evaluator can handle the measurement, the time window and the arithmetic.
That division of labour is the idea behind HeriKGQA, a preprint I co-authored with Lingxiao Kong, Vasileios Arampatzakis, Vasileios Sevetlidis and Zeyd Boukhers. The system powers the ARGUS chatbot. Here is a small example you can use to check whether a sensor question-answering system preserves the identity of each reading.
Two steady sensors, one apparent jump
Take four synthetic readings from two sensors at the same site. Both sensors report degrees Celsius.
| Time (UTC) | Sensor | Temperature (°C) |
|---|---|---|
| 10:00 | A | 10.0 |
| 10:05 | B | 18.0 |
| 10:30 | A | 10.2 |
| 10:35 | B | 18.1 |
If you drop the sensor IDs and take the range across all four readings, you get 18.1 − 10.0 = 8.1 °C. That measures the spread across both sensors. It can exceed an alarm threshold even when the temperature at each sensor is stable.
For this example, define the rule as “flag the site if any sensor’s one-hour temperature range exceeds 5 °C.” For each sensor s, calculate Rs = max(Ts) − min(Ts) over the window. Sensor A has a range of 0.2 °C and sensor B a range of 0.1 °C. The largest range is 0.2 °C, so the toy rule does not trigger. This example uses a range. A rule expressed in degrees per hour would require a rate and an elapsed time.
Keep the sensor and time window in the query
Assume the graph links each observation to its sensor through SOSA and each sensor to its site through a local property. The following SPARQL fragment uses illustrative IRIs. It fixes the site, property and time window and returns an aggregate per sensor. The application supplies those parameters after resolving the user’s question against known sites, properties and rules.
PREFIX sosa: <http://www.w3.org/ns/sosa/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX ex: <https://example.org/heritage/>
SELECT ?sensor (COUNT(?obs) AS ?n) (MAX(?c) - MIN(?c) AS ?rangeC)
WHERE {
?obs sosa:madeBySensor ?sensor ;
sosa:observedProperty ex:airTemperatureC ;
sosa:resultTime ?time ;
sosa:hasSimpleResult ?reading .
?sensor ex:atSite ex:site1 .
BIND(xsd:decimal(?reading) AS ?c)
FILTER(BOUND(?c))
FILTER(?time >= "2026-11-12T10:00:00Z"^^xsd:dateTime &&
?time <= "2026-11-12T11:00:00Z"^^xsd:dateTime)
}
GROUP BY ?sensor
HAVING (COUNT(?obs) >= 2)
In this illustration, values are already in Celsius and the input has one observation per sensor and timestamp. In a deployment, normalise units and handle duplicate timestamps and data quality before applying the rule. The counting condition suppresses groups with fewer than two usable observations. The caller must still compare the returned sensor IDs with the sensors expected for the site. A missing group has insufficient evidence. If another sensor already exceeds the threshold there is evidence for an alert, but a site-wide “no alert” needs adequate coverage of the expected sensors.
What the benchmark tells us
In the preprint, HeriKGQA achieved 99.0% accuracy across 500 benchmark questions built from readings at five heritage sites. The strongest baseline in the comparison achieved 80.8%. Removing the grounding layer brought overall accuracy to 86.8% and accuracy on anomaly questions from 99% to 66%. Those figures describe the paper’s evaluation with its data and implemented rules. For a new site, test at least three cases: stable sensors with different baselines, a real threshold crossing and a missing sensor with too little data for a verdict.
Read the preprint · Explore the code, data snapshot and benchmark

