@@ -164,17 +164,13 @@ def clear_project(cls) -> None:
164164
165165 @classmethod
166166 def export_brick_attributes (cls , brick_uri : str ) -> dict [str , Any ]:
167- query = BrickStore .graph .query (
168- """
167+ query = BrickStore .graph .query ("""
169168 PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
170169 SELECT ?label {
171170 <{brick_uri}> rdfs:label ?label .
172171 }
173172 LIMIT 1
174- """ .replace (
175- "{brick_uri}" , brick_uri
176- )
177- )
173+ """ .replace ("{brick_uri}" , brick_uri ))
178174 name = None
179175 for row in query :
180176 name = str (row .get ("label" ))
@@ -218,18 +214,14 @@ def get_brick_path_name(cls) -> str:
218214 @classmethod
219215 def get_brickifc_project (cls ) -> Union [str , None ]:
220216 project = tool .Ifc .get ().by_type ("IfcProject" )[0 ]
221- query = BrickStore .graph .query (
222- """
217+ query = BrickStore .graph .query ("""
223218 PREFIX ref: <https://brickschema.org/schema/Brick/ref#>
224219 SELECT ?proj WHERE {
225220 ?proj a ref:ifcProject .
226221 ?proj ref:ifcProjectID "{project_globalid}" .
227222 }
228223 LIMIT 1
229- """ .replace (
230- "{project_globalid}" , project .GlobalId
231- )
232- )
224+ """ .replace ("{project_globalid}" , project .GlobalId ))
233225 results = list (query )
234226 if results :
235227 return results [0 ][0 ].toPython ()
@@ -275,17 +267,13 @@ def get_element_feeds(cls, element: ifcopenshell.entity_instance) -> set[ifcopen
275267
276268 @classmethod
277269 def get_item_class (cls , item : str ) -> Union [str , None ]:
278- query = BrickStore .graph .query (
279- """
270+ query = BrickStore .graph .query ("""
280271 PREFIX brick: <https://brickschema.org/schema/Brick#>
281272 SELECT ?class WHERE {
282273 <{item}> a ?class .
283274 }
284275 LIMIT 1
285- """ .replace (
286- "{item}" , item
287- )
288- )
276+ """ .replace ("{item}" , item ))
289277 for row in query :
290278 return row .get ("class" ).toPython ().split ("#" )[- 1 ]
291279
@@ -308,8 +296,7 @@ def get_namespace(cls, uri: str) -> str:
308296
309297 @classmethod
310298 def import_brick_classes (cls , brick_class : str , split_screen : bool = False ) -> None :
311- query = BrickStore .graph .query (
312- """
299+ query = BrickStore .graph .query ("""
313300 PREFIX brick: <https://brickschema.org/schema/Brick#>
314301 PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
315302 PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
@@ -322,10 +309,7 @@ def import_brick_classes(cls, brick_class: str, split_screen: bool = False) -> N
322309 }
323310 GROUP BY ?group
324311 ORDER BY asc(?group)
325- """ .replace (
326- "{brick_class}" , brick_class
327- )
328- )
312+ """ .replace ("{brick_class}" , brick_class ))
329313 props = tool .Brick .get_brick_props ()
330314 if split_screen :
331315 bricks = props .split_screen_bricks
@@ -342,8 +326,7 @@ def import_brick_classes(cls, brick_class: str, split_screen: bool = False) -> N
342326
343327 @classmethod
344328 def import_brick_items (cls , brick_class : str , split_screen : bool = False ) -> None :
345- query = BrickStore .graph .query (
346- """
329+ query = BrickStore .graph .query ("""
347330 PREFIX brick: <https://brickschema.org/schema/Brick#>
348331 PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
349332 PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
@@ -354,10 +337,7 @@ def import_brick_items(cls, brick_class: str, split_screen: bool = False) -> Non
354337 }
355338 }
356339 ORDER BY asc(?item)
357- """ .replace (
358- "{brick_class}" , brick_class
359- )
360- )
340+ """ .replace ("{brick_class}" , brick_class ))
361341 props = tool .Brick .get_brick_props ()
362342 if split_screen :
363343 bricks = props .split_screen_bricks
@@ -507,8 +487,7 @@ def get_project(cls) -> brickschema.graph.Graph:
507487
508488 @classmethod
509489 def load_sub_roots (cls ) -> None :
510- query = BrickStore .graph .query (
511- """
490+ query = BrickStore .graph .query ("""
512491 PREFIX brick: <https://brickschema.org/schema/Brick#>
513492 PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
514493 SELECT ?subRoot ?subClasses WHERE {
@@ -525,8 +504,7 @@ def load_sub_roots(cls) -> None:
525504 }
526505 FILTER(?subClasses > 3)
527506 }
528- """
529- )
507+ """ )
530508 for row in query :
531509 sub_root = row .get ("subRoot" ).toPython ().split ("#" )[- 1 ]
532510 BrickStore .root_classes .append (sub_root )
@@ -558,8 +536,7 @@ def load_namespaces(cls) -> None:
558536 @classmethod
559537 def load_entity_classes (cls ) -> None :
560538 for root_class in BrickStore .root_classes :
561- query = BrickStore .graph .query (
562- """
539+ query = BrickStore .graph .query ("""
563540 PREFIX brick: <https://brickschema.org/schema/Brick#>
564541 PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
565542 PREFIX owl: <http://www.w3.org/2002/07/owl#>
@@ -569,25 +546,20 @@ def load_entity_classes(cls) -> None:
569546 ?class owl:deprecated true .
570547 }
571548 }
572- """ .replace (
573- "{root_class}" , root_class
574- )
575- )
549+ """ .replace ("{root_class}" , root_class ))
576550 BrickStore .entity_classes [root_class ] = []
577551 for uri in sorted ([x [0 ].toPython () for x in query ]):
578552 BrickStore .entity_classes [root_class ].append (uri )
579553
580554 @classmethod
581555 def load_relationships (cls ) -> None :
582- query = BrickStore .graph .query (
583- """
556+ query = BrickStore .graph .query ("""
584557 PREFIX brick: <https://brickschema.org/schema/Brick#>
585558 PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
586559 SELECT DISTINCT ?relation WHERE {
587560 ?relation rdfs:subPropertyOf brick:Relationship .
588561 }
589- """
590- )
562+ """ )
591563 for uri in sorted ([x [0 ].toPython () for x in query ]):
592564 BrickStore .relationships .append (uri )
593565
0 commit comments