Mercurial > code > home > repos > homeauto
view service/mqtt_to_rdf/conf/rules.n3 @ 1662:7a61113fd17d
new childResource function for making new URIs
author | drewp@bigasterisk.com |
---|---|
date | Sun, 19 Sep 2021 20:31:39 -0700 |
parents | d3b295c28a26 |
children | 5871ef3a380e |
line wrap: on
line source
@prefix : <http://projects.bigasterisk.com/room/> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix fr: <http://bigasterisk.com/foaf/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix math: <http://www.w3.org/2000/10/swap/math#> . :airQualityIndoor a :AirQualitySensor; rdfs:label "air_quality_indoor" . :airQualityOutdoor a :AirQualitySensor; rdfs:label "air_quality_outdoor" . { ?s a :AirQualitySensor; rdfs:label ?name . } => { [ a :MqttStatementSource; :mqttTopic (?name "sensor" "bme280_temperature" "state") ] . [ a :MqttStatementSource; :mqttTopic (?name "sensor" "bme280_pressure" "state") ] . [ a :MqttStatementSource; :mqttTopic (?name "sensor" "bme280_humidity" "state") ] . [ a :MqttStatementSource; :mqttTopic (?name "sensor" "ccs811_eco2_value" "state") ] . [ a :MqttStatementSource; :mqttTopic (?name "sensor" "ccs811_total_volatile_organic_compound" "state") ] . [ a :MqttStatementSource; :mqttTopic (?name "sensor" "particulate_matter_10m_concentration" "state") ] . [ a :MqttStatementSource; :mqttTopic (?name "sensor" "particulate_matter_25m_concentration" "state") ] . [ a :MqttStatementSource; :mqttTopic (?name "sensor" "particulate_matter_100m_concentration" "state") ] . } . { ?msg a :MqttMessage; :topic (?sensorName "sensor" "bme280_temperature" "state"); :bodyFloat ?valueC . ?valueC math:greaterThan -999 . ?valueC :asFarenheit ?valueF . } => { :airQualityTODOIndoorTemperature :temperatureF ?valueF . :influxMeasurements :measurement [ :meas "temperatureF"; :pointsAtLeastEvery 30; :tag [:key "host"; :value ?sensorName], [:key "location"; :value "TODOfrontRoomShelf"]] . } . ################################################################# :frontDoorLockStatus a :MqttStatementSource; :mqttTopic ("frontdoorlock" "status"). { ?msg :body "online" . } => { ?msg :onlineTerm :Online . } . { ?msg :body "offline" . } => { ?msg :onlineTerm :Offline . } . { ?msg a :MqttMessage ; :topic ( "frontdoorlock" "status" ); :onlineTerm ?onlineness . } => { :frontDoorLockStatus :connectedStatus ?onlineness . } .