Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing syntax errors in multizone simple office semantic model. #709

Open
wants to merge 16 commits into
base: issue591_addSemanticTags
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ testcase2/doc/build/
parser/*.fmu
parser/*.mo
parser/*.json
m2j_output
12 changes: 0 additions & 12 deletions testcases/bestest_air/models/BESTESTAir/BaseClasses/Case600FF.mo
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,8 @@ model Case600FF
annotation (__Buildings(semantic(
metadataLanguage="Brick 1.3 text/turtle"
"bldg:<cdl_instance_name> a brick:Zone_Air_Temperature ;
ref:hasExternalReference bldg:<cdl_instance_name>_Reference ;
qudt:hasQuantityKind quantitykind:Temperature ;
qudt:hasUnit qudt:K .
bldg:<cdl_instance_name>_Reference a ref:BOPTestReference ;
ref:name literal:<cdl_instance_name>_y ;
ref:description literal:description ;
ref:unit literal:K ;
ref:isWritable false .
")),Placement(transformation(extent={{120,-10},{140,10}})));

Buildings.Utilities.IO.SignalExchange.Read reaCO2RooAir(
Expand All @@ -281,13 +275,7 @@ model Case600FF
annotation ( __Buildings(semantic(
metadataLanguage="Brick 1.3 text/turtle"
"bldg:<cdl_instance_name> a brick:Zone_CO2 ;
ref:hasExternalReference bldg:<cdl_instance_name>_Reference ;
qudt:hasUnit qudt:PPM.
bldg:<cdl_instance_name>_Reference a ref:BOPTestReference ;
ref:name literal:<cdl_instance_name>_y ;
ref:description literal:description ;
ref:unit literal:ppm ;
ref:isWritable false .
")),Placement(transformation(extent={{130,-40},{150,-20}})));

Modelica.Blocks.Interfaces.RealOutput CO2RooAir(unit="ppm") "Room air CO2 concentration"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,9 @@ model FanCoilUnit_T
__Buildings(semantic(
metadataLanguage="Brick 1.3 text/turtle"
"bldg:<cdl_instance_name> a brick:Supply_Air_Flow_Sensor ;
ref:hasExternalReference bldg:<cdl_instance_name>_Reference ;
qudt:hasQuantityKind quantitykind:MassFlowRate ;
qudt:hasUnit qudt:KiloGM-PER-SEC .
bldg:<cdl_instance_name>_Reference a ref:BOPTestReference ;
ref:name literal:<cdl_instance_name>_y ;
ref:description literal:description;
ref:unit literal:kg_per_s;
ref:isWritable false.")),
")),
Placement(transformation(extent={{40,110},{60,130}})));
Modelica.Blocks.Interfaces.RealInput TSup "Temperature of supply air"
annotation (Placement(transformation(extent={{-180,20},{-140,60}})));
Expand All @@ -57,14 +52,9 @@ model FanCoilUnit_T
__Buildings(semantic(
metadataLanguage="Brick 1.3 text/turtle"
"bldg:<cdl_instance_name> a brick:Electric_Power_Sensor ;
ref:hasExternalReference bldg:<cdl_instance_name>_Reference ;
qudt:hasQuantityKind quantitykind:ElectricPower ;
qudt:hasUnit qudt:W .
bldg:<cdl_instance_name>_Reference a ref:BOPTestReference ;
ref:name literal:<cdl_instance_name>_y;
ref:description literal:description;
ref:unit literal:W;
ref:isWritable false.")),
")),
Placement(transformation(extent={{70,170},{90,190}})));

Buildings.Utilities.IO.SignalExchange.Read reaPHea(
Expand All @@ -75,14 +65,9 @@ model FanCoilUnit_T
__Buildings(semantic(
metadataLanguage="Brick 1.3 text/turtle"
"bldg:<cdl_instance_name> a brick:Heating_Thermal_Power_Sensor ;
ref:hasExternalReference bldg:<cdl_instance_name>_Reference ;
qudt:hasQuantityKind quantitykind:Power ;
qudt:hasUnit qudt:W .
bldg:<cdl_instance_name>_Reference a ref:BOPTestReference ;
ref:name literal:<cdl_instance_name>_y ;
ref:description literal:description;
ref:unit literal:kg_per_s;
ref:isWritable false.")),
")),
Placement(transformation(extent={{70,150},{90,170}})));

Buildings.Utilities.IO.SignalExchange.Read reaPFan(
Expand All @@ -94,13 +79,8 @@ model FanCoilUnit_T
__Buildings(semantic(
metadataLanguage="Brick 1.3 text/turtle"
"bldg:<cdl_instance_name> a brick:Electric_Power_Sensor ;
ref:hasExternalReference bldg:<cdl_instance_name>_Reference ;
qudt:hasQuantityKind quantitykind:ElectricPower ;
qudt:hasUnit qudt:W.
bldg:<cdl_instance_name>_Reference a ref:BOPTestReference ;
ref:name literal:<cdl_instance_name>_y;
ref:unit literal:W;
ref:isWritable false.
bldg:<cdl_instance_name> boptestrules:pointOf brick:Supply_Fan .
")),
Placement(transformation(extent={{70,130},{90,150}})));
Expand Down Expand Up @@ -149,17 +129,9 @@ model FanCoilUnit_T
__Buildings(semantic(
metadataLanguage="Brick 1.3 text/turtle"
"bldg:<cdl_instance_name> a brick:Supply_Air_Temperature_Setpoint ;
ref:hasExternalReference bldg:<cdl_instance_name>_Reference ;
qudt:hasQuantityKind quantitykind:Temperature ;
qudt:hasUnit qudt:K .
bldg:<cdl_instance_name>_Reference a ref:BOPTestReference ;
ref:activate literal:<cdl_instance_name>_activate ;
ref:name literal:<cdl_instance_name>_u ;
ref:isWritable true;
ref:description literal:description ;
ref:max literal:max ;
ref:min literal:min ;
ref:unit literal:K.")),
")),
Placement(transformation(extent={{-120,30},{-100,50}})));
Buildings.Utilities.IO.SignalExchange.Overwrite oveFan(description=
"Fan control signal as air mass flow rate normalized to the design air mass flow rate",
Expand All @@ -171,16 +143,7 @@ model FanCoilUnit_T
__Buildings(semantic(
metadataLanguage="Brick 1.3 text/turtle"
"bldg:<cdl_instance_name> a brick:Fan_Command ;
ref:hasExternalReference bldg:<cdl_instance_name>_Reference ;
qudt:hasUnit qudt:UNITLESS.
bldg:<cdl_instance_name>_Reference a ref:BOPTestReference ;
ref:activate literal:<cdl_instance_name>_activate ;
ref:name literal:<cdl_instance_name>_u ;
ref:isWritable true;
ref:description literal:description ;
ref:max literal:max ;
ref:min literal:min ;
ref:unit literal:1.
bldg:<cdl_instance_name> boptestrules:pointOf brick:Supply_Fan.
")),
Placement(transformation(extent={{-120,-50},{-100,-30}})));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,8 @@ model Thermostat_T
annotation (__Buildings(semantic(
metadataLanguage="Brick 1.3 text/turtle"
"bldg:<cdl_instance_name> a brick:Zone_Air_Cooling_Temperature_Setpoint ;
ref:hasExternalReference bldg:<cdl_instance_name>_Reference ;
qudt:hasQuantityKind quantitykind:Temperature ;
qudt:hasUnit qudt:K .
bldg:<cdl_instance_name>_Reference a ref:BOPTestReference ;
ref:activate literal:<cdl_instance_name>_activate ;
ref:name literal:<cdl_instance_name>_u ;
ref:isWritable true ;
ref:description literal:description ;
ref:max literal:max ;
ref:min literal:min ;
ref:unit literal:K .
")),
Placement(transformation(extent={{-70,70},{-50,90}})));
Modelica.Blocks.Sources.CombiTimeTable TSetCoo(
Expand All @@ -65,17 +56,8 @@ model Thermostat_T
__Buildings(semantic(
metadataLanguage="Brick 1.3 text/turtle"
"bldg:<cdl_instance_name> a brick:Zone_Air_Heating_Temperature_Setpoint ;
ref:hasExternalReference bldg:<cdl_instance_name>_Reference ;
qudt:hasQuantityKind quantitykind:Temperature ;
qudt:hasUnit qudt:K .
bldg:<cdl_instance_name>_Reference a ref:BOPTestReference ;
ref:activate literal:<cdl_instance_name>_activate ;
ref:name literal:<cdl_instance_name>_u ;
ref:isWritable true ;
ref:description literal:description ;
ref:max literal:max ;
ref:min literal:min ;
ref:unit literal:K .")),
qudt:hasUnit qudt:K .")),
Placement(transformation(extent={{-70,30},{-50,50}})));
Modelica.Blocks.Sources.CombiTimeTable TSetHea(
smoothness=Modelica.Blocks.Types.Smoothness.ConstantSegments,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ model TestCase_Ideal "Testcase model with ideal airflow"
annotation (Placement(transformation(extent={{34,-10},{54,10}})));

BaseClasses.Thermostat_T con "Thermostat controller"
annotation (Placement(transformation(extent={{-80,-10},{-60,10}})));
annotation (
Placement(transformation(extent={{-80,-10},{-60,10}})));
BaseClasses.FanCoilUnit_T fcu "Fan coil unit"
annotation (Placement(transformation(extent={{-20,-8},{0,20}})));
annotation (
Placement(transformation(extent={{-20,-8},{0,20}})));
equation
connect(fcu.supplyAir, zon.supplyAir) annotation (Line(points={{0,13.7778},{
20,13.7778},{20,2},{34,2}}, color={0,127,255}));
Expand Down
118 changes: 118 additions & 0 deletions testcases/bestest_air/models/post-processed-model.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
@prefix bldg: <https://BESTESTAir.urn#> .
@prefix boptestrules: <https://boptest-rules.urn#> .
@prefix brick: <https://brickschema.org/schema/Brick#> .
@prefix literal: <https://literal_values.urn#> .
@prefix quantitykind: <http://qudt.org/vocab/quantitykind/> .
@prefix qudt: <http://qudt.org/schema/qudt/> .
@prefix ref: <https://brickschema.org/schema/Brick/ref#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

bldg:fcu a brick:FCU ;
brick:feeds bldg:zon ;
brick:hasPart bldg:fcu_fan ;
brick:hasPoint bldg:fcu_oveFan,
bldg:fcu_oveTSup,
bldg:fcu_reaFloSup,
bldg:fcu_reaPCoo,
bldg:fcu_reaPFan,
bldg:fcu_reaPHea .

bldg:con a brick:Thermostat ;
brick:hasPoint bldg:con_oveTSetCoo,
bldg:con_oveTSetHea .

bldg:con_oveTSetCoo_Reference a ref:BOPTestReference ;
ref:activate literal:con_oveTSetCoo_activate ;
ref:description literal:description ;
ref:isWritable true ;
ref:max literal:max ;
ref:min literal:min ;
ref:name literal:con_oveTSetCoo_u ;
ref:unit literal:K .

bldg:con_oveTSetHea_Reference a ref:BOPTestReference ;
ref:activate literal:con_oveTSetHea_activate ;
ref:description literal:description ;
ref:isWritable true ;
ref:max literal:max ;
ref:min literal:min ;
ref:name literal:con_oveTSetHea_u ;
ref:unit literal:K .

bldg:fcu_fan a brick:Supply_Fan ;
brick:hasPoint bldg:fcu_oveFan,
bldg:fcu_reaPFan .

bldg:fcu_oveFan_Reference a ref:BOPTestReference ;
ref:activate literal:fcu_oveFan_activate ;
ref:isWritable true ;
ref:name literal:fcu_oveFan_u .

bldg:fcu_oveTSup a brick:Supply_Air_Temperature_Setpoint ;
qudt:hasQuantityKind quantitykind:Temperature ;
qudt:hasUnit qudt:K ;
ref:hasExternalReference bldg:fcu_oveTSup_Reference .

bldg:fcu_oveTSup_Reference a ref:BOPTestReference ;
ref:activate literal:fcu_oveTSup_activate ;
ref:isWritable true ;
ref:name literal:fcu_oveTSup_u .

bldg:fcu_reaFloSup a brick:Supply_Air_Flow_Sensor ;
qudt:hasQuantityKind quantitykind:MassFlowRate ;
qudt:hasUnit qudt:KiloGM-PER-SEC ;
ref:hasExternalReference bldg:fcu_reaFloSup_Reference .

bldg:fcu_reaFloSup_Reference a ref:BOPTestReference ;
ref:isWritable false ;
ref:name literal:fcu_reaFloSup_y .

bldg:fcu_reaPCoo a brick:Electric_Power_Sensor ;
qudt:hasQuantityKind quantitykind:ElectricPower ;
qudt:hasUnit qudt:W ;
ref:hasExternalReference bldg:fcu_reaPCoo_Reference .

bldg:fcu_reaPCoo_Reference a ref:BOPTestReference ;
ref:isWritable false ;
ref:name literal:fcu_reaPCoo_y .

bldg:fcu_reaPFan_Reference a ref:BOPTestReference ;
ref:isWritable false ;
ref:name literal:fcu_reaPFan_y .

bldg:fcu_reaPHea a brick:Heating_Thermal_Power_Sensor ;
qudt:hasQuantityKind quantitykind:ElectricPower ;
qudt:hasUnit qudt:W ;
ref:hasExternalReference bldg:fcu_reaPHea_Reference .

bldg:fcu_reaPHea_Reference a ref:BOPTestReference ;
ref:isWritable false ;
ref:name literal:fcu_reaPHea_y .

bldg:zon a brick:Zone ;
brick:hasPoint bldg:con_oveTSetCoo,
bldg:con_oveTSetHea ;
brick:isLocationOf bldg:con .

bldg:con_oveTSetCoo a brick:Zone_Air_Cooling_Temperature_Setpoint ;
qudt:hasQuantityKind quantitykind:Temperature ;
qudt:hasUnit qudt:K ;
ref:hasExternalReference bldg:con_oveTSetCoo_Reference .

bldg:con_oveTSetHea a brick:Zone_Air_Heating_Temperature_Setpoint ;
qudt:hasQuantityKind quantitykind:Temperature ;
qudt:hasUnit qudt:K ;
ref:hasExternalReference bldg:con_oveTSetHea_Reference .

bldg:fcu_oveFan a brick:Fan_Command ;
qudt:hasQuantityKind quantitykind:Temperature ;
qudt:hasUnit qudt:K ;
boptestrules:pointOf brick:Supply_Fan ;
ref:hasExternalReference bldg:fcu_oveFan_Reference .

bldg:fcu_reaPFan a brick:Electric_Power_Sensor ;
qudt:hasQuantityKind quantitykind:ElectricPower ;
qudt:hasUnit qudt:W ;
boptestrules:pointOf brick:Supply_Fan ;
ref:hasExternalReference bldg:fcu_reaPFan_Reference .

20 changes: 20 additions & 0 deletions testcases/multizone_office_simple_air/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## Semantic Model Extraction

* First, set up MODELICAPATH and MODELICAJSONPATH environment variables.
For example, add following lines to the end of ~/.bashrc in Ubuntu or ~/.bash_profile in MacOS:
```
export MODELICAPATH="/path/to/modelica-buildings:$MODELICAPATH"
export MODELICAJSONPATH="/path/to/modelica-json"
```

* Run the following command to extract a semantic model from the BOPTEST testcase:
```
cd /path/to/project1-boptest/testcases/multizone_office_simple_air/models
node $MODELICAJSONPATH/app.js -f MultiZoneOfficeSimpleAir/TestCases/TestCase.mo -o semantic -m modelica -d m2j_output
```

* For the purposes of this development, we have added semantic annotations to the following files in the `testcases/multizone_office_simple_air/models/MultiZoneOfficeSimpleAir` directory (keep this list updated):
* `TestCases/TestCase.mo`

* For the current testcase, the JSON output should be present in `multizone_office_simple_air/m2j_output/json`.
* For the current testcase, the semantic output should be present in `multizone_office_simple_air/m2j_output/objects/Brick/1.3/testcases/multizone_office_simple_air/models/MultiZoneOfficeSimpleAir/TestCases/TestCase.ttl`.
Loading