Published using Google Docs
OE_13_IEQ Management System_Queries.docx
Updated automatically every 5 minutes

PREFIX owl: <http://www.w3.org/2002/07/owl#>

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

PREFIX iem: <https://tw.rpi.edu/ontology-engineering/oe2022/indoor-environment-manager/>

PREFIX ind: <https://tw.rpi.edu/ontology-engineering/oe2022/indoor-environment-manager-individuals/>

 

# With the latest additions to our main ontology, some of these queries now require nontrivial reasoning. This means that they must be executed in “Snap SPARQL Query” instead of Protégé’s built-in SPARQL query feature. Additionally, we’re still investigating a problem with running Pellet on our ontology, so we recommend that you activate HermiT before executing a query.

 

# This query shouldn’t return any results because in the relevant competency question, the current environment is already ideal. Therefore, no actions need to be suggested or taken.

SELECT DISTINCT ?roomComponent ?newState WHERE {

          ?roomComponent iem:isComponentOf ind:Question2Room .

          ?roomComponent iem:hasAvailableAction ?action .

          ?action iem:causesNewState ?newState .

          ?action iem:produces ?resultantEnvironment .

          ?resultantEnvironment iem:hasAirTemperatureSign ?airTemperatureSign .

          ind:Question2EnvironmentTarget iem:hasAirTemperatureSign ?airTemperatureSign .

}

 

# This query looks for two different actions: one to change the air speed and one to change the relative humidity. Each action must be available for a particular room component that’s, in turn, part of the room individual that’s associated with the relevant competency question. The actions are selected by ensuring that they produce respective resultant environments with the same environment attribute delta signs as the target environment.

SELECT DISTINCT ?airSpeedRoomComponent ?airSpeedNewState ?relativeHumidityRoomComponent ?relativeHumidityNewState WHERE {

          ?airSpeedRoomComponent iem:isComponentOf ind:Question4Room .

          ?airSpeedRoomComponent iem:hasAvailableAction ?airSpeedAction .

          ?airSpeedAction iem:causesNewState ?airSpeedNewState .

          ?airSpeedAction iem:produces ?airSpeedResultantEnvironment .

          ?airSpeedResultantEnvironment iem:hasAirSpeedSign ?airSpeedSign .

          ind:Question4EnvironmentTarget iem:hasAirSpeedSign ?airSpeedSign .

          

          ?relativeHumidityRoomComponent iem:isComponentOf ind:Question4Room .

          ?relativeHumidityRoomComponent iem:hasAvailableAction ?relativeHumidityAction .

          ?relativeHumidityAction iem:causesNewState ?relativeHumidityNewState .

          ?relativeHumidityAction iem:produces ?relativeHumidityResultantEnvironment .

          ?relativeHumidityResultantEnvironment iem:hasRelativeHumiditySign ?relativeHumiditySign .

          ind:Question4EnvironmentTarget iem:hasRelativeHumiditySign ?relativeHumiditySign .

}

 

# This query looks for a single action to change the air speed. The action must be available for a particular room component that’s, in turn, part of the room individual that’s associated with the relevant competency question. The action is selected by ensuring that it produces a resultant environment with the same air speed environment attribute delta sign as the target environment. The query also requires that the resultant environment have a “good” air quality level, which is inferred by the reasoner from the fact that opening a window must produce a resultant environment with the same air quality level as the relevant outdoor environment.

SELECT DISTINCT ?airSpeedRoomComponent ?airSpeedNewState WHERE {

          ?airSpeedRoomComponent iem:isComponentOf ind:Question5Room .

          ?airSpeedRoomComponent iem:hasAvailableAction ?airSpeedAction .

          ?airSpeedAction iem:causesNewState ?airSpeedNewState .

          ?airSpeedAction iem:produces ?airSpeedResultantEnvironment .

          ?airSpeedResultantEnvironment iem:hasAirQualityLevel iem:AirQualityLevelGood .

          ?airSpeedResultantEnvironment iem:hasAirSpeedSign ?airSpeedSign .

          ind:Question5EnvironmentTarget iem:hasAirSpeedSign ?airSpeedSign .

}

 

# This query corresponds with competency question 6. Given a specific room, it returns the occupants whose corresponding comfort ranges include the environment values and who therefore currently feel comfortable. Since there are no currently comfortable occupants in competency question 6, this query intentionally returns no results.

SELECT ?occupant WHERE {

          ?occupant iem:occupies ind:Question6Room .

          ?occupant iem:hasAirTemperatureComfortRangeLowerBound ?airTemperatureLowerBound .

          ?occupant iem:hasRelativeHumidityComfortRangeLowerBound ?relativeHumidityLowerBound .

          ?occupant iem:hasAirTemperatureComfortRangeUpperBound ?airTemperatureUpperBound .

          ?occupant iem:hasRelativeHumidityComfortRangeUpperBound ?relativeHumidityUpperBound .

          ind:Question6EnvironmentCurrent iem:hasAirTemperatureValue ?airTemperatureValue .

          ind:Question6EnvironmentCurrent iem:hasRelativeHumidityValue ?relativeHumidityValue .

          FILTER(?airTemperatureValue <= ?airTemperatureUpperBound) .

          FILTER(?airTemperatureValue >= ?airTemperatureLowerBound) .

          FILTER(?relativeHumidityValue <= ?relativeHumidityUpperBound) .

          FILTER(?relativeHumidityValue >= ?relativeHumidityLowerBound) .

}

 

# This query corresponds with competency question 7. Given a specific room, it returns the occupants whose corresponding comfort ranges include the environment values and who therefore currently feel comfortable.

SELECT ?occupant WHERE {

          ?occupant iem:occupies ind:Question7Room .

          ?occupant iem:hasAirSpeedComfortRangeLowerBound ?airSpeedLowerBound .

          ?occupant iem:hasAirTemperatureComfortRangeLowerBound ?airTemperatureLowerBound .

          ?occupant iem:hasRelativeHumidityComfortRangeLowerBound ?relativeHumidityLowerBound .

          ?occupant iem:hasAirSpeedComfortRangeUpperBound ?airSpeedUpperBound .

          ?occupant iem:hasAirTemperatureComfortRangeUpperBound ?airTemperatureUpperBound .

          ?occupant iem:hasRelativeHumidityComfortRangeUpperBound ?relativeHumidityUpperBound .

          ind:Question7EnvironmentCurrent iem:hasAirTemperatureValue ?airTemperatureValue .

          ind:Question7EnvironmentCurrent iem:hasAirSpeedValue ?airSpeedValue .

          ind:Question7EnvironmentCurrent iem:hasRelativeHumidityValue ?relativeHumidityValue .

          FILTER(?airTemperatureValue <= ?airTemperatureUpperBound) .

          FILTER(?airTemperatureValue >= ?airTemperatureLowerBound) .

          FILTER(?airSpeedValue <= ?airSpeedUpperBound) .

          FILTER(?airSpeedValue >= ?airSpeedLowerBound) .

          FILTER(?relativeHumidityValue <= ?relativeHumidityUpperBound) .

          FILTER(?relativeHumidityValue >= ?relativeHumidityLowerBound) .

}