Skip to content

Commit 3440f1f

Browse files
authored
Add EVSE Charging Concepts (#529)
* ensure that deprecated concepts are not always asserted to be owl:Class * adding some evse concepts * add evse example * add directionality and expand enumerations * working on more EVSe rules; put directionality on the port * implement inference rules for charging directionality * add test for EVSE example * fix EVSE property definitions * add inverse property rule * fix datatypes on evse example * use topquadrant reasoning on test * use specialized logger * final changes
1 parent a9bbb7a commit 3440f1f

File tree

11 files changed

+251
-19
lines changed

11 files changed

+251
-19
lines changed

bricksrc/collections.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,9 @@
180180
"aliases": [BRICK["PV_Array"]],
181181
"constraints": {BRICK.hasPart: [BRICK.PV_Panel]},
182182
},
183+
"Electric_Vehicle_Charging_Hub": {
184+
"tags": [TAG.Collection, TAG.Electric, TAG.Vehicle, TAG.Charging, TAG.Hub],
185+
"aliases": [BRICK["EV_Charging_Hub"]],
186+
"constraints": {BRICK.hasPart: [BRICK.Electric_Vehicle_Charging_Station]},
187+
},
183188
}

bricksrc/definitions.csv

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,9 @@ https://brickschema.org/schema/Brick#Electric_Current,,
322322
https://brickschema.org/schema/Brick#Electric_Energy,,
323323
https://brickschema.org/schema/Brick#Electric_Power_Sensor,Measures the amount of instantaneous electric power consumed,
324324
https://brickschema.org/schema/Brick#Electric_Radiator,Electric heating device,
325+
https://brickschema.org/schema/Brick#Electric_Vehicle_Charging_Hub,"A collection of charging stations for charging electric vehicles. A hub may be located in a parking lot, for example",
326+
https://brickschema.org/schema/Brick#Electric_Vehicle_Charging_Port,An individual point of attachment for charing a single electric vehicle,
327+
https://brickschema.org/schema/Brick#Electric_Vehicle_Charging_Station,An individual piece of equipment supplying electrical power for charging electric vehicles. Contains 1 or more electric vehicle charging ports,
325328
https://brickschema.org/schema/Brick#Electric_Voltage,,
326329
https://brickschema.org/schema/Brick#Electrical_Energy_Usage_Sensor,A sensor that records the quantity of electrical energy consumed in a given period,
327330
https://brickschema.org/schema/Brick#Electrical_Meter,A meter that measures the usage or consumption of electricity,

bricksrc/entity_properties.py

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,33 @@
347347
SH.node: BSH.VirtualMeterShape,
348348
RDFS.label: Literal("is virtual meter"),
349349
},
350+
BRICK.electricVehicleChargerType: {
351+
SKOS.definition: Literal(
352+
"Which type of EVSE charger this is, e.g. Level 1 (up to up to 2.5kW of AC power on 1 phase 120V input), Level 2 (direct AC power but can use higher voltage and up to 3 phases), or Level 3 (direct DC power)"
353+
),
354+
"property_of": BRICK.Electric_Vehicle_Charging_Station,
355+
RDFS.label: Literal("has electric vehicle charger type"),
356+
SH.node: BSH.ElectricVehicleChargingTypeShape,
357+
},
358+
BRICK.electricVehicleChargerDirectionality: {
359+
SKOS.definition: Literal(
360+
"Indicates if the EVSE charger supports bidirectional charging or just unidirectional charging of the EV battery"
361+
),
362+
"property_of": [
363+
BRICK.Electric_Vehicle_Charging_Station,
364+
BRICK.Electric_Vehicle_Charging_Port,
365+
],
366+
RDFS.label: Literal("has electric vehicle charger directionality"),
367+
SH.node: BSH.ElectricVehicleChargingDirectionalityShape,
368+
},
369+
BRICK.electricVehicleConnectorType: {
370+
SKOS.definition: Literal(
371+
"Identifies which kind of connector the port has. This property helps identify the physical connection required between the vehicle and the charging equipment."
372+
),
373+
"property_of": BRICK.Electric_Vehicle_Charging_Port,
374+
RDFS.label: Literal("has electric vehicle connector type"),
375+
SH.node: BSH.ElectricVehicleConnectorTypeShape,
376+
},
350377
}
351378

352379
building_primary_function_values = [
@@ -451,7 +478,7 @@
451478
BSH.ElectricalComplexPowerShape: {"values": ["real", "reactive", "apparent"]},
452479
BSH.ElectricalFlowShape: {"values": ["import", "export", "net", "absolute"]},
453480
BSH.PhasesShape: {"values": ["A", "B", "C", "AB", "BC", "AC", "ABC"]},
454-
BSH.PhaseCountShape: {"values": ["1", "2", "3", "Total"]},
481+
BSH.PhaseCountShape: {"values": [1, 2, 3, "Total"]},
455482
BSH.CurrentFlowTypeShape: {"values": ["AC", "DC"]},
456483
BSH.StageShape: {"values": [1, 2, 3, 4]},
457484
BSH.BuildingPrimaryFunctionShape: {"values": building_primary_function_values},
@@ -533,6 +560,25 @@
533560
},
534561
},
535562
},
563+
BRICK.ElectricVehicleChargingTypeShape: {
564+
"values": ["Level 1", "Level 2", "Level 3"]
565+
},
566+
BRICK.ElectricVehicleChargingDirectionalityShape: {
567+
"values": ["unidirectional", "bidirectional"]
568+
},
569+
BRICK.ElectricVehicleConnectorTypeShape: {
570+
"values": [
571+
"Type 1 (CSS)",
572+
"Type 2 (CSS)",
573+
"GB/T",
574+
"Type 1 (SAE J1772)",
575+
"Type 2 (IEC 62196)",
576+
"CHAdeMO",
577+
"CCS (Combined Charging System)",
578+
"Tesla Supercharger",
579+
"Wireless",
580+
]
581+
},
536582
}
537583

538584

bricksrc/equipment.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,25 @@
4545
"Electrical_Equipment": {
4646
"tags": [TAG.Electrical, TAG.Equipment],
4747
"subclasses": {
48+
"Electric_Vehicle_Charging_Station": {
49+
"tags": [
50+
TAG.Electric,
51+
TAG.Vehicle,
52+
TAG.Charging,
53+
TAG.Station,
54+
TAG.Equipment,
55+
],
56+
"constraints": {BRICK.hasPart: [BRICK.Electric_Vehicle_Charging_Port]},
57+
},
58+
"Electric_Vehicle_Charging_Port": {
59+
"tags": [
60+
TAG.Electric,
61+
TAG.Vehicle,
62+
TAG.Charging,
63+
TAG.Port,
64+
TAG.Equipment,
65+
],
66+
},
4867
"Energy_Storage": {
4968
"tags": [TAG.Energy, TAG.Storage, TAG.Equipment],
5069
"subclasses": {

bricksrc/rules.ttl

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,24 @@ WHERE {
3939
sh:targetClass brick:Entity ;
4040
.
4141

42+
bsh:InferInverseProperties2
43+
a sh:NodeShape ;
44+
sh:rule [
45+
a sh:SPARQLRule ;
46+
sh:construct """
47+
CONSTRUCT {
48+
$this ?p ?o .
49+
}
50+
WHERE {
51+
?o ?invP $this .
52+
?invP owl:inverseOf ?p .
53+
}
54+
""" ;
55+
sh:prefixes <https://brickschema.org/schema/1.3/Brick> ;
56+
] ;
57+
sh:targetClass brick:Entity ;
58+
.
59+
4260
bsh:InferSymmetricProperties
4361
a sh:NodeShape ;
4462
sh:rule [
@@ -424,3 +442,52 @@ bsh:hasSubstance a sh:NodeShape ;
424442
sh:targetObjectsOf brick:hasSubstance ;
425443
sh:class brick:Substance ;
426444
.
445+
446+
447+
# add unidirectional charging to all EVsE chargers as a default value
448+
# UNLESS there is already a brick:electricVehicleChargerDirectionality attribute
449+
# on ports associated with the charger
450+
bsh:AddDefaultEVSEChargerDirection a sh:NodeShape ;
451+
sh:targetClass brick:Electric_Vehicle_Charging_Station ;
452+
sh:rule [
453+
a sh:SPARQLRule ;
454+
sh:prefixes <https://brickschema.org/schema/1.3/Brick> ;
455+
sh:construct """
456+
CONSTRUCT {
457+
$this brick:electricVehicleChargerDirectionality [ brick:value "unidirectional" ]
458+
} WHERE {
459+
$this rdf:type brick:Electric_Vehicle_Charging_Station .
460+
FILTER NOT EXISTS {
461+
$this brick:electricVehicleChargerDirectionality ?direction .
462+
}
463+
FILTER NOT EXISTS {
464+
$this brick:hasPart ?port .
465+
?port a brick:Electric_Vehicle_Charging_Port .
466+
?port brick:electricVehicleChargerDirectionality ?other_direction .
467+
}
468+
}
469+
""" ;
470+
] ;
471+
.
472+
473+
# inherit the directionality of the EVSE charger to the ports
474+
bsh:InheritEVSEChargerDirection a sh:NodeShape ;
475+
sh:targetClass brick:Electric_Vehicle_Charging_Port ;
476+
sh:rule [
477+
a sh:SPARQLRule ;
478+
sh:prefixes <https://brickschema.org/schema/1.3/Brick> ;
479+
sh:construct """
480+
CONSTRUCT {
481+
$this brick:electricVehicleChargerDirectionality ?direction
482+
} WHERE {
483+
$this rdf:type brick:Electric_Vehicle_Charging_Port .
484+
$this brick:isPartOf ?charger .
485+
?charger a brick:Electric_Vehicle_Charging_Station .
486+
?charger brick:electricVehicleChargerDirectionality ?direction .
487+
FILTER NOT EXISTS {
488+
$this brick:electricVehicleChargerDirectionality ?other_direction .
489+
}
490+
}
491+
""" ;
492+
] ;
493+
.

examples/evse/evse.ttl

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
@prefix brick: <https://brickschema.org/schema/Brick#> .
2+
@prefix unit: <http://qudt.org/vocab/unit/> .
3+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4+
@prefix : <urn:evse#> .
5+
6+
:parking_lot a brick:Parking_Structure ;
7+
brick:isLocationOf :hub .
8+
9+
:hub a brick:Electric_Vehicle_Charging_Hub ;
10+
brick:hasPart :station1, :station2 .
11+
12+
:station1 a brick:Electric_Vehicle_Charging_Station ;
13+
brick:electricVehicleChargerType [ brick:value "Level 1" ] ;
14+
brick:hasPart :port1-1, :port1-2 ;
15+
.
16+
17+
:port1-1 a brick:Electric_Vehicle_Charging_Port ;
18+
brick:electricVehicleChargerDirectionality [ brick:value "bidirectional" ] ;
19+
brick:electricVehicleConnectorType [ brick:value "Level 1 (SAE J1772)" ] ;
20+
brick:currentFlowType [ brick:value "AC" ] ;
21+
brick:electricalPhaseCount [ brick:value 1 ] ;
22+
brick:hasPoint :port1-1-voltage ;
23+
.
24+
:port1-1-voltage a brick:Battery_Voltage_Sensor ;
25+
brick:hasUnit unit:PERCENT ;
26+
.
27+
28+
:port1-2 a brick:Electric_Vehicle_Charging_Port ;
29+
brick:electricVehicleChargerDirectionality [ brick:value "bidirectional" ] ;
30+
brick:electricVehicleConnectorType [ brick:value "Level 1 (SAE J1772)" ] ;
31+
brick:currentFlowType [ brick:value "AC" ] ;
32+
brick:electricalPhaseCount [ brick:value 1 ] ;
33+
brick:hasPoint :port1-2-voltage ;
34+
.
35+
:port1-2-voltage a brick:Battery_Voltage_Sensor ;
36+
brick:hasUnit unit:PERCENT ;
37+
.
38+
39+
:station2 a brick:Electric_Vehicle_Charging_Station ;
40+
brick:electricVehicleChargerDirectionality [ brick:value "unidirectional" ] ;
41+
brick:electricVehicleChargerType [ brick:value "Level 2" ] ;
42+
brick:hasPart :port2-1 ;
43+
.
44+
45+
:port2-1 a brick:Electric_Vehicle_Charging_Port ;
46+
# this should inherit 'unidirectional' from the station
47+
brick:electricVehicleConnectorType [ brick:value "Level 2 (IEC 62196)" ] ;
48+
brick:currentFlowType [ brick:value "AC" ] ;
49+
brick:electricalPhaseCount [ brick:value 3 ] ;
50+
brick:hasPoint :port2-1-voltage ;
51+
.
52+
53+
:port2-1-voltage a brick:Battery_Voltage_Sensor ;
54+
brick:hasUnit unit:PERCENT ;
55+
.

examples/last_known_value/last_known_value.ttl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
@prefix unit: <http://qudt.org/vocab/unit/> .
55
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
66
@prefix bacnet: <http://data.ashrae.org/bacnet/2020#> .
7+
@prefix owl: <http://www.w3.org/2002/07/owl#> .
8+
9+
bldg: a owl:Ontology ;
10+
owl:imports <https://brickschema.org/schema/1.3/Brick> .
711

812
bldg:sample-device a bacnet:BACnetDevice ;
913
bacnet:device-instance 123 ;

0 commit comments

Comments
 (0)