I am trying to build a Apache Jena reasoner node over the below rdf data instance.
I want to write a rule such that the inference api can tell if certain sensor values were out of range. e.g. print statement whose sensor measurement (value of hasValue
) was not in range 100 to 400.
How do I write a rule using Apache Jena inference api. I tried reading the docs here: https://jena.apache.org/documentation/inference/index.html but I am getting more confused with the amount of details given.
Should I use RDFS reasoner or OWL reasoner? How do I develop the code exactly for my use case?
@prefix iot-context: <http://www.example.org/iot-context#> .
@prefix iot_lite_ins: <http://purl.oclc.org/NET/UNIS/iot-lite/iot-liteInstance#> .
@prefix measurement-iri: <http://www.example.org/iot-instance#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
iot_lite_ins:temperatureSensorA iot-context:hasMeasurement measurement-iri:measurement_123 .
measurement-iri:measurement_123 a iot-context:measurement ;
iot-context:hasTimeStamp "2022-01-28T11:50:00.352485"^^xsd:dateTime ;
iot-context:hasValue 456 .
I have another rdf schema defining what sensor is located in what region (having lat
and long
values in graph). How can I write a rule which answers: Was sensor value out of range in region abc
(having lat
= 11 and long
= 22).