diff --git a/bricksrc/entity_properties.py b/bricksrc/entity_properties.py index ff79ffc4..12cb995e 100644 --- a/bricksrc/entity_properties.py +++ b/bricksrc/entity_properties.py @@ -348,19 +348,28 @@ RDFS.label: Literal("is virtual meter"), }, BRICK.electricVehicleChargerType: { - SKOS.definition: Literal("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)"), + SKOS.definition: Literal( + "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)" + ), "property_of": BRICK.Electric_Vehicle_Charging_Station, RDFS.label: Literal("has electric vehicle charger type"), SH.node: BSH.ElectricVehicleChargingTypeShape, }, BRICK.electricVehicleChargerDirectionality: { - SKOS.definition: Literal("Indicates if the EVSE charger supports bidirectional charging or just unidirectional charging of the EV battery"), - "property_of": BRICK.Electric_Vehicle_Charging_Station, + SKOS.definition: Literal( + "Indicates if the EVSE charger supports bidirectional charging or just unidirectional charging of the EV battery" + ), + "property_of": [ + BRICK.Electric_Vehicle_Charging_Station, + BRICK.Electric_Vehicle_Charging_Port, + ], RDFS.label: Literal("has electric vehicle charger directionality"), SH.node: BSH.ElectricVehicleChargingDirectionalityShape, }, BRICK.electricVehicleConnectorType: { - SKOS.definition: Literal("Identifies which kind of connector the port has. This property helps identify the physical connection required between the vehicle and the charging equipment."), + SKOS.definition: Literal( + "Identifies which kind of connector the port has. This property helps identify the physical connection required between the vehicle and the charging equipment." + ), "property_of": BRICK.Electric_Vehicle_Charging_Port, RDFS.label: Literal("has electric vehicle connector type"), SH.node: BSH.ElectricVehicleConnectorTypeShape, @@ -558,7 +567,17 @@ "values": ["unidirectional", "bidirectional"] }, BRICK.ElectricVehicleConnectorTypeShape: { - "values": ["Type 1 (CSS)", "Type 2 (CSS)", "GB/T", "Type 1 (SAE J1772)", "Type 2 (IEC 62196)", "CHAdeMO", "CCS (Combined Charging System)", "Tesla Supercharger", "Wireless"] + "values": [ + "Type 1 (CSS)", + "Type 2 (CSS)", + "GB/T", + "Type 1 (SAE J1772)", + "Type 2 (IEC 62196)", + "CHAdeMO", + "CCS (Combined Charging System)", + "Tesla Supercharger", + "Wireless", + ] }, } diff --git a/bricksrc/rules.ttl b/bricksrc/rules.ttl index 7637b6a1..1e5f3b99 100644 --- a/bricksrc/rules.ttl +++ b/bricksrc/rules.ttl @@ -389,6 +389,8 @@ bsh:hasSubstance a sh:NodeShape ; # add unidirectional charging to all EVsE chargers as a default value +# UNLESS there is already a brick:electricVehicleChargerDirectionality attribute +# on ports associated with the charger bsh:AddDefaultEVSEChargerDirection a sh:NodeShape ; sh:targetClass brick:Electric_Vehicle_Charging_Station ; sh:rule [ @@ -399,8 +401,17 @@ bsh:AddDefaultEVSEChargerDirection a sh:NodeShape ; $this brick:electricVehicleChargerDirectionality [ brick:value "unidirectional" ] } WHERE { $this rdf:type brick:Electric_Vehicle_Charging_Station . - FILTER NOT EXISTS {$this brick:electricVehicleChargerDirectionality ?direction} + FILTER NOT EXISTS { + $this brick:electricVehicleChargerDirectionality ?direction . + } + FILTER NOT EXISTS { + $this brick:hasPart ?port . + ?port a brick:Electric_Vehicle_Charging_Port . + ?port brick:electricVehicleChargerDirectionality ?other_direction . + } } """ ; ] ; . + +# inherit