Skip to content

Commit

Permalink
implement inference rules for charging directionality
Browse files Browse the repository at this point in the history
  • Loading branch information
gtfierro committed Sep 27, 2023
1 parent cdaacd0 commit c791cd0
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
22 changes: 21 additions & 1 deletion bricksrc/rules.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -414,4 +414,24 @@ bsh:AddDefaultEVSEChargerDirection a sh:NodeShape ;
] ;
.

# inherit
# inherit the directionality of the EVSE charger to the ports
bsh:InheritEVSEChargerDirection a sh:NodeShape ;
sh:targetClass brick:Electric_Vehicle_Charging_Port ;
sh:rule [
a sh:SPARQLRule ;
sh:prefixes <https://brickschema.org/schema/1.3/Brick> ;
sh:construct """
CONSTRUCT {
$this brick:electricVehicleChargerDirectionality ?direction
} WHERE {
$this rdf:type brick:Electric_Vehicle_Charging_Port .
$this brick:isPartOf ?charger .
?charger a brick:Electric_Vehicle_Charging_Station .
?charger brick:electricVehicleChargerDirectionality ?direction .
FILTER NOT EXISTS {
$this brick:electricVehicleChargerDirectionality ?other_direction .
}
}
""" ;
] ;
.
5 changes: 4 additions & 1 deletion examples/evse/evse.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
brick:hasPart :station1, :station2 .

:station1 a brick:Electric_Vehicle_Charging_Station ;
brick:electricVehicleChargerDirectionality [ brick:value "bidirectional" ] ;
brick:electricVehicleChargerType [ brick:value "Level 1" ] ;
brick:hasPart :port1-1, :port1-2 ;
.

:port1-1 a brick:Electric_Vehicle_Charging_Port ;
brick:electricVehicleChargerDirectionality [ brick:value "bidirectional" ] ;
brick:electricVehicleConnectorType [ brick:value "Level 1 (SAE J1772)" ] ;
brick:currentFlowType [ brick:value "AC" ] ;
brick:electricalPhaseCount [ brick:value "1" ] ;
Expand All @@ -26,6 +26,7 @@
.

:port1-2 a brick:Electric_Vehicle_Charging_Port ;
brick:electricVehicleChargerDirectionality [ brick:value "bidirectional" ] ;
brick:electricVehicleConnectorType [ brick:value "Level 1 (SAE J1772)" ] ;
brick:currentFlowType [ brick:value "AC" ] ;
brick:electricalPhaseCount [ brick:value "1" ] ;
Expand All @@ -36,11 +37,13 @@
.

:station2 a brick:Electric_Vehicle_Charging_Station ;
brick:electricVehicleChargerDirectionality [ brick:value "unidirectional" ] ;
brick:electricVehicleChargerType [ brick:value "Level 2" ] ;
brick:hasPart :port2-1 ;
.

:port2-1 a brick:Electric_Vehicle_Charging_Port ;
# this should inherit 'unidirectional' from the station
brick:electricVehicleConnectorType [ brick:value "Level 2 (IEC 62196)" ] ;
brick:currentFlowType [ brick:value "AC" ] ;
brick:electricalPhaseCount [ brick:value "3" ] ;
Expand Down

0 comments on commit c791cd0

Please sign in to comment.