Skip to content

Commit 518d340

Browse files
gtfierrometesaka
andauthored
v1.4.3 Release (#686)
* working on v1.4.3 * Fix deprecations and add validation to Brick (#685) * fix release tool and update docs (#679) * Add missing properties from rec.ttl * added properties to children of ICT_equipment and fixed typos in error messages * added missing deprecation messages * add Valve parent to HVAC valve subclasses. Previously, these classes were only under HVAC_Equipment. Now they are under both (#680) * to fix workflow issue * another fix to solve pr issue * fix v2 to solve pr issue * fix v3 to solve pr issue * fix v4 to solve pr issue * fix v5 to solve pr issue * fix v6 to solve pr issue * add resolution property (#683) * add resolution property * improve resolution property * to fix workflow issue * another fix to solve pr issue * keep toml same * going back to old version * fix v7 to solve pr issue * FIx deprecation typo * fix typos * patching definitions * addressing core shape validation * making definitions consistent * make sure to parse validation.ttl * remove outdated test file * fixing defs of relationship and entityprop * fix evse example * fix test * add xsd prefix to shacl rules --------- Co-authored-by: metesaka <metesaka98@gmail.com> Co-authored-by: Mete Saka <61266931+metesaka@users.noreply.github.com> --------- Co-authored-by: metesaka <metesaka98@gmail.com> Co-authored-by: Mete Saka <61266931+metesaka@users.noreply.github.com>
1 parent 804ee49 commit 518d340

20 files changed

+212
-118
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.PHONY: format
22

3-
Brick.ttl: bricksrc/*.py bricksrc/*.ttl bricksrc/definitions.csv generate_brick.py support/*.ttl
3+
Brick.ttl: bricksrc/*.py bricksrc/*.ttl bricksrc/definitions.csv generate_brick.py support/*.ttl validation.ttl
44
mkdir -p extensions
55
python tools/sort_definitions.py bricksrc/definitions.csv
66
python generate_brick.py

bricksrc/deprecations.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,13 @@
267267
BRICK.Hot_Water_Supply_Flow_Sensor: {
268268
"version": "1.3.0",
269269
"mitigation_message": "Swapped supply/return for entering/leaving with water-related points",
270-
"replace_with": BRICK.Hot_Water_Leaving_Flow_Sensor,
270+
"replace_with": BRICK.Leaving_Hot_Water_Flow_Sensor,
271271
RDFS.subClassOf: [BRICK.Hot_Water_Flow_Sensor, BRICK.Supply_Water_Flow_Sensor],
272272
},
273273
BRICK.Hot_Water_Discharge_Flow_Sensor: {
274274
"version": "1.3.0",
275275
"mitigation_message": "Swapped supply/return for entering/leaving with water-related points",
276-
"replace_with": BRICK.Hot_Water_Leaving_Flow_Sensor,
276+
"replace_with": BRICK.Leaving_Hot_Water_Flow_Sensor,
277277
RDFS.subClassOf: [
278278
BRICK.Hot_Water_Flow_Sensor,
279279
BRICK.Discharge_Water_Flow_Sensor,
@@ -331,7 +331,7 @@
331331
BRICK.Hot_Water_Return_Flow_Sensor: {
332332
"version": "1.3.0",
333333
"mitigation_message": "Swapped supply/return for entering/leaving with water-related points",
334-
"replace_with": BRICK.Hot_Water_Entering_Flow_Sensor,
334+
"replace_with": BRICK.Entering_Hot_Water_Flow_Sensor,
335335
RDFS.subClassOf: [BRICK.Hot_Water_Flow_Sensor, BRICK.Return_Water_Flow_Sensor],
336336
},
337337
BRICK.Return_Condenser_Water_Flow_Sensor: {
@@ -432,7 +432,7 @@
432432
},
433433
BRICK.Hot_Water_Discharge_Flow_Setpoint: {
434434
"mitigation_message": "Swapped supply/return for entering/leaving with water-related points",
435-
"replace_with": BRICK.Hot_Water_Leaving_Flow_Setpoint,
435+
"replace_with": BRICK.Leaving_Hot_Water_Flow_Setpoint,
436436
"version": "1.3.0",
437437
RDFS.subClassOf: [
438438
BRICK.Discharge_Water_Flow_Setpoint,
@@ -457,7 +457,7 @@
457457
},
458458
BRICK.Hot_Water_Return_Flow_Sensor: {
459459
"mitigation_message": "Swapped supply/return for entering/leaving with water-related points",
460-
"replace_with": BRICK.Hot_Water_Entering_Flow_Sensor,
460+
"replace_with": BRICK.Entering_Hot_Water_Flow_Sensor,
461461
"version": "1.3.0",
462462
RDFS.subClassOf: [BRICK.Return_Water_Flow_Sensor, BRICK.Hot_Water_Flow_Sensor],
463463
},
@@ -471,7 +471,7 @@
471471
},
472472
BRICK.Hot_Water_Supply_Flow_Setpoint: {
473473
"mitigation_message": "Swapped supply/return for entering/leaving with water-related points",
474-
"replace_with": BRICK.Hot_Water_Leaving_Flow_Setpoint,
474+
"replace_with": BRICK.Leaving_Hot_Water_Flow_Setpoint,
475475
"version": "1.3.0",
476476
RDFS.subClassOf: [
477477
BRICK.Supply_Water_Temperature_Sensor,

bricksrc/deprecations.ttl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
brick:powerComplexity brick:deprecation [
2222
brick:deprecatedInVersion "1.3.1" ;
2323
brick:deprecationMitigationMessage "powerComplexity is deprecated in favor of electricalComplexPower because the latter is more clear";
24-
brick:deprecationMigitationRule [
24+
brick:deprecationMitigationRule [
2525
a sh:NodeShape ;
2626
sh:rule [
2727
a sh:SPARQLRule ;
@@ -40,7 +40,7 @@ brick:powerComplexity brick:deprecation [
4040
brick:powerFlow brick:deprecation [
4141
brick:deprecatedInVersion "1.3.1" ;
4242
brick:deprecationMitigationMessage "powerFlow is deprecated in favor of electricalFlow as the latter is more clear";
43-
brick:deprecationMigitationRule [
43+
brick:deprecationMitigationRule [
4444
a sh:NodeShape ;
4545
sh:rule [
4646
a sh:SPARQLRule ;

bricksrc/entity_properties.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
BRICK.deprecation: {
1414
SKOS.definition: Literal("Marks a concept as deprecated"),
1515
"property_of": BRICK.Entity,
16-
SH.node: BRICK.DeprecationShape,
16+
SH.node: BSH.DeprecationShape,
1717
RDFS.label: Literal("Deprecation Notice", lang="en"),
1818
},
1919
BRICK.lastKnownValue: {
@@ -549,7 +549,7 @@
549549
},
550550
}
551551
},
552-
BRICK.DeprecationShape: {
552+
BSH.DeprecationShape: {
553553
"properties": {
554554
BRICK.deprecatedInVersion: {
555555
SKOS.definition: Literal(
@@ -572,13 +572,13 @@
572572
},
573573
},
574574
},
575-
BRICK.ElectricVehicleChargingTypeShape: {
575+
BSH.ElectricVehicleChargingTypeShape: {
576576
"values": ["Level 1", "Level 2", "Level 3"]
577577
},
578-
BRICK.ElectricVehicleChargingDirectionalityShape: {
578+
BSH.ElectricVehicleChargingDirectionalityShape: {
579579
"values": ["unidirectional", "bidirectional"]
580580
},
581-
BRICK.ElectricVehicleConnectorTypeShape: {
581+
BSH.ElectricVehicleConnectorTypeShape: {
582582
"values": [
583583
"Type 1 (CSS)",
584584
"Type 2 (CSS)",

bricksrc/ontology.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
SH.namespace: Literal(str(RDF), datatype=XSD.anyURI),
5555
SH.prefix: Literal("rdf"),
5656
},
57+
{
58+
SH.namespace: Literal(str(XSD), datatype=XSD.anyURI),
59+
SH.prefix: Literal("xsd"),
60+
},
5761
{
5862
SH.namespace: Literal(str(RDFS), datatype=XSD.anyURI),
5963
SH.prefix: Literal("rdfs"),

bricksrc/quantities.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,9 @@ def all_units():
534534
"Atmospheric_Pressure": {
535535
BRICK.hasQUDTReference: QUDTQK["AtmosphericPressure"]
536536
},
537-
"Dynamic_Pressure": {},
537+
"Dynamic_Pressure": {
538+
RDFS.label: Literal("Dynamic Pressure", lang="en"),
539+
},
538540
"Differential_Pressure": {
539541
QUDT.isDeltaQuantity: Literal(True),
540542
SKOS.narrower: {

bricksrc/recpatches.ttl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -992,8 +992,6 @@ brick:Rain_Level_Sensor
992992
sh:name "last known value" ;
993993
sh:nodeKind sh:IRI ;
994994
] ;
995-
.
996-
brick:Rain_Sensor
997995
sh:property [
998996
rdf:type sh:PropertyShape ;
999997
sh:path brick:lastKnownValue ;

bricksrc/relationships.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from rdflib import Literal
2-
from .namespaces import A, OWL, RDFS, BRICK, VCARD, QUDT, SDO, RDF, BSH, XSD, REC
2+
from .namespaces import A, OWL, RDFS, BRICK, VCARD, QUDT, SDO, RDF, BSH, XSD, REC, SH
33
from .env import env
44

55
"""
@@ -17,13 +17,13 @@
1717
"domain": BRICK.Entity,
1818
},
1919
"hasSubstance": {
20-
A: [OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
20+
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
2121
RDFS.label: Literal("Has Substance", lang="en"),
2222
"range": BRICK.Substance,
2323
"domain": [BRICK.Point, BRICK.Meter],
2424
},
2525
"hasQuantity": {
26-
A: [OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
26+
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
2727
RDFS.label: Literal("Has Quantity", lang="en"),
2828
RDFS.subPropertyOf: QUDT.hasQuantityKind,
2929
"range": [BRICK.Quantity, QUDT.QuantityKind],
@@ -135,7 +135,7 @@
135135
"isTagOf": {
136136
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
137137
"domain": BRICK.Tag,
138-
"range": OWL.Class,
138+
"range": [BRICK.Entity, BRICK.Measurable],
139139
RDFS.label: Literal("Is tag of", lang="en"),
140140
},
141141
"hasAssociatedTag": {
@@ -197,14 +197,26 @@
197197
"hasAmbientTemperature": {
198198
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
199199
},
200+
"aliasOf": {
201+
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
202+
"range": BRICK.Entity,
203+
"domain": BRICK.Entity,
204+
},
205+
"deprecation": {
206+
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
207+
"range": [BSH.DeprecationRule],
208+
},
200209
"deprecationMitigationMessage": {
201210
A: [OWL.DatatypeProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
211+
"range": XSD.string,
202212
},
203213
"deprecatedInVersion": {
204214
A: [OWL.DatatypeProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
215+
"range": XSD.string,
205216
},
206217
"deprecationMitigationRule": {
207218
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
219+
"range": [SH.PropertyShape],
208220
},
209221
"aggregationFunction": {
210222
A: [OWL.DatatypeProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],

bricksrc/root_class_shapes.ttl

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,12 @@ brick:Location a sh:NodeShape ;
4040
.
4141

4242
brick:Equipment a sh:NodeShape ;
43-
sh:node [sh:not [ sh:class brick:Point ] ; sh:message "Equipment is an exclusive top class." ],
44-
[sh:not [ sh:class brick:Location ] ; sh:message "Equipment is an exclusive top class." ],
45-
[sh:not [ sh:class brick:Substance ] ; sh:message "Equipment is an exclusive top class." ],
46-
[sh:not [ sh:class brick:Quantity ] ; sh:message "Equipment is an exclusive top class." ],
47-
[sh:not [ sh:class brick:Collection ] ; sh:message "Equipment is an exclusive top class." ] ;
43+
sh:not [ sh:class brick:Location ; sh:message "Instances of Equipment cannot be Locations." ] ,
44+
[ sh:class brick:Substance ; sh:message "Instances of Equipment cannot be Substances." ],
45+
[ sh:class brick:Quantity ; sh:message "Instances of Equipment cannot be Quantities." ],
46+
[ sh:class brick:Collection ; sh:message "Instances of Equipment cannot be Collections." ],
47+
[ sh:class brick:Point ; sh:message "Instances of Equipment cannot be Points." ],
48+
[ sh:class brick:EntityProperty ; sh:message "Instances of Equipment cannot be EntityProperties." ] ;
4849
sh:property [
4950
sh:path brick:hasPart;
5051
sh:class brick:Equipment;
@@ -81,12 +82,12 @@ brick:Equipment a sh:NodeShape ;
8182
.
8283

8384
brick:Point a sh:NodeShape;
84-
sh:node [sh:not [ sh:class brick:Equipment ] ; sh:message "Point is an exclusive top class." ],
85-
[sh:not [ sh:class brick:Location ] ; sh:message "Point is an exclusive top class." ],
86-
[sh:not [ sh:class rec:Space ] ; sh:message "Point is an exclusive top class." ],
87-
[sh:not [ sh:class brick:Substance ] ; sh:message "Point is an exclusive top class." ],
88-
[sh:not [ sh:class brick:Quantity ] ; sh:message "Point is an exclusive top class." ],
89-
[sh:not [ sh:class brick:Collection ] ; sh:message "Point is an exclusive top class." ] ;
85+
sh:not [ sh:class brick:Equipment ; sh:message "Instances of Point cannot be Equipment." ],
86+
[ sh:class brick:Location ; sh:message "Instances of Point cannot be Locations." ],
87+
[ sh:class brick:Substance ; sh:message "Instances of Point cannot be Substances." ],
88+
[ sh:class brick:Quantity ; sh:message "Instances of Point cannot be Quantities." ],
89+
[ sh:class brick:Collection ; sh:message "Instances of Point cannot be Collections." ],
90+
[ sh:class brick:EntityProperty ; sh:message "Instances of Point cannot be EntityProperties." ] ;
9091
sh:property [
9192
sh:path brick:hasLocation ;
9293
sh:maxCount 0 ;

bricksrc/rules.ttl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ bsh:AddDefaultEVSEChargerDirection a sh:NodeShape ;
519519
sh:prefixes <https://brickschema.org/schema/1.4/Brick> ;
520520
sh:construct """
521521
CONSTRUCT {
522-
$this brick:electricVehicleChargerDirectionality [ brick:value "unidirectional" ]
522+
$this brick:electricVehicleChargerDirectionality [ brick:value "unidirectional"^^xsd:string ]
523523
} WHERE {
524524
$this rdf:type brick:Electric_Vehicle_Charging_Station .
525525
FILTER NOT EXISTS {

0 commit comments

Comments
 (0)