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

Remove brick collection #676

Open
wants to merge 2 commits into
base: v1.5.0
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
6 changes: 6 additions & 0 deletions bricksrc/deprecations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
from .namespaces import BRICK, RDFS, SKOS, A, REC

deprecations = {
BRICK.Collection: {
"version": "1.5.0",
"mitigation_message": "Brick Collection is deprecated in favor of REC Collection to remove redundancy between the two ontologies.",
"replace_with": REC.Collection,
RDFS.subClassOf: BRICK.Entity,
},
BRICK.Speed_Status: {
"version": "1.4.0",
"mitigation_message": "Speed Status is no longer necessary. Use Speed Mode Status for motors with various categorical speed settings, such as low, medium, and high. To further clarify, points representing the current speed of a variable speed fan as an analog value or input, use Speed Sensor.",
Expand Down
4 changes: 2 additions & 2 deletions bricksrc/relationships.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@
OWL.inverseOf: BRICK.isMeteredBy,
"domain": BRICK.Meter,
# this is a special property that implements the 'range' as a SHACL shape
"range": [BRICK.Equipment, BRICK.Location, BRICK.Collection],
"range": [BRICK.Equipment, BRICK.Location, REC.Collection],
RDFS.label: Literal("meters", lang="en"),
},
"isMeteredBy": {
A: [OWL.ObjectProperty, OWL.AsymmetricProperty, OWL.IrreflexiveProperty],
OWL.inverseOf: BRICK.meters,
# this is a special property that implements the 'domain' as a SHACL shape
"domain": [BRICK.Equipment, BRICK.Location, BRICK.Collection],
"domain": [BRICK.Equipment, BRICK.Location, REC.Collection],
"range": BRICK.Meter,
RDFS.label: Literal("is metered by", lang="en"),
},
Expand Down
28 changes: 4 additions & 24 deletions bricksrc/root_class_shapes.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ brick:Location a sh:NodeShape ;
[sh:not [ sh:class brick:Equipment ] ; sh:message "Location is an exclusive top class." ],
[sh:not [ sh:class brick:Substance ] ; sh:message "Location is an exclusive top class." ],
[sh:not [ sh:class brick:Quantity ] ; sh:message "Location is an exclusive top class." ],
[sh:not [ sh:class brick:Collection ] ; sh:message "Location is an exclusive top class." ] ;
[sh:not [ sh:class rec:Collection ] ; sh:message "Location is an exclusive top class." ] ;
sh:property [
sh:path brick:hasPart;
sh:or ( [ sh:class brick:Location] [ sh:class rec:Space ] );
Expand Down Expand Up @@ -44,7 +44,7 @@ brick:Equipment a sh:NodeShape ;
[sh:not [ sh:class brick:Location ] ; sh:message "Equipment is an exclusive top class." ],
[sh:not [ sh:class brick:Substance ] ; sh:message "Equipment is an exclusive top class." ],
[sh:not [ sh:class brick:Quantity ] ; sh:message "Equipment is an exclusive top class." ],
[sh:not [ sh:class brick:Collection ] ; sh:message "Equipment is an exclusive top class." ] ;
[sh:not [ sh:class rec:Collection ] ; sh:message "Equipment is an exclusive top class." ] ;
sh:property [
sh:path brick:hasPart;
sh:class brick:Equipment;
Expand All @@ -60,7 +60,7 @@ brick:Equipment a sh:NodeShape ;
sh:or (
[ sh:class brick:System ]
[ sh:class brick:Equipment ]
[ sh:class brick:Collection ]
[ sh:class rec:Collection ]
);
sh:message "Equipment can be part of a Collection, System or other Equipment."
];
Expand All @@ -86,34 +86,14 @@ brick:Point a sh:NodeShape;
[sh:not [ sh:class rec:Space ] ; sh:message "Point is an exclusive top class." ],
[sh:not [ sh:class brick:Substance ] ; sh:message "Point is an exclusive top class." ],
[sh:not [ sh:class brick:Quantity ] ; sh:message "Point is an exclusive top class." ],
[sh:not [ sh:class brick:Collection ] ; sh:message "Point is an exclusive top class." ] ;
[sh:not [ sh:class rec:Collection ] ; sh:message "Point is an exclusive top class." ] ;
sh:property [
sh:path brick:hasLocation ;
sh:maxCount 0 ;
sh:message "Points cannot have locations; use 'isPointOf' instead" ;
] ;
.

brick:Collection a sh:NodeShape;
sh:node [sh:not [ sh:class brick:Equipment ] ; sh:message "Collection is an exclusive top class." ],
[sh:not [ sh:class brick:Location ] ; sh:message "Collection is an exclusive top class." ],
[sh:not [ sh:class rec:Space ] ; sh:message "Collection is an exclusive top class." ],
[sh:not [ sh:class brick:Substance ] ; sh:message "Collection is an exclusive top class." ],
[sh:not [ sh:class brick:Quantity ] ; sh:message "Collection is an exclusive top class." ],
[sh:not [ sh:class brick:Point ] ; sh:message "Collection is an exclusive top class." ] ;
sh:property [
sh:path brick:hasPart;
sh:or (
[ sh:class brick:Equipment ]
[ sh:class brick:Location ]
[ sh:class rec:Space ]
[ sh:class brick:Point ]
[ sh:class brick:Collection ]
);
sh:message "A Collection can be associated with Equipments, Locations/Spaces, Points, and other Collections."
];
.

bsh:hasHotColdDeck
a sh:NodeShape ;
sh:targetClass brick:DDAHU ;
Expand Down
53 changes: 27 additions & 26 deletions bricksrc/rules.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -481,33 +481,34 @@ bsh:hasSubstance a sh:NodeShape ;
.


# TODO: remove this?
# rule to add rec:includes when a brick:Collection contains a brick:Equipment
bsh:CollectionIncludesEquipment a sh:NodeShape ;
sh:targetClass brick:Collection, brick:System, brick:Equipment ;
sh:rule [
a sh:SPARQLRule ;
sh:construct """
CONSTRUCT {
$this rec:includes ?eq .
}
WHERE {
$this brick:hasPart ?eq .
{
?eq rdf:type/rdfs:subClassOf* brick:Equipment .
}
UNION
{
?eq rdf:type/rdfs:subClassOf* brick:Collection .
}
UNION
{
?eq rdf:type/rdfs:subClassOf* brick:System .
}
}
""" ;
sh:prefixes <https://brickschema.org/schema/1.4/Brick> ;
] ;
.
#bsh:CollectionIncludesEquipment a sh:NodeShape ;
# sh:targetClass brick:Collection, brick:System, brick:Equipment ;
# sh:rule [
# a sh:SPARQLRule ;
# sh:construct """
# CONSTRUCT {
# $this rec:includes ?eq .
# }
# WHERE {
# $this brick:hasPart ?eq .
# {
# ?eq rdf:type/rdfs:subClassOf* brick:Equipment .
# }
# UNION
# {
# ?eq rdf:type/rdfs:subClassOf* brick:Collection .
# }
# UNION
# {
# ?eq rdf:type/rdfs:subClassOf* brick:System .
# }
# }
# """ ;
# sh:prefixes <https://brickschema.org/schema/1.4/Brick> ;
# ] ;
#.

# add unidirectional charging to all EVsE chargers as a default value
# UNLESS there is already a brick:electricVehicleChargerDirectionality attribute
Expand Down
3 changes: 1 addition & 2 deletions generate_brick.py
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,6 @@ def handle_concept_labels():
},
"Point": {"tags": [TAG.Point]},
"Measurable": {"tags": [TAG.Measurable]},
"Collection": {"tags": [TAG.Collection]},
}
define_classes(roots, BRICK.Class) # <= Brick v1.3.0
define_classes(roots, BRICK.Entity) # >= Brick v1.3.0
Expand Down Expand Up @@ -914,7 +913,7 @@ def handle_concept_labels():
# define other root class structures
define_classes(location_subclasses, BRICK.Location)
define_classes(equipment_subclasses, BRICK.Equipment)
define_classes(collection_classes, BRICK.Collection)
define_classes(collection_classes, REC.Collection)
define_classes(hvac_subclasses, BRICK.HVAC_Equipment)
define_classes(hvac_valve_subclasses, BRICK.HVAC_Equipment)
define_classes(valve_subclasses, BRICK.Equipment)
Expand Down
Loading