GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Use add2 schema · opensourceBIM/python-mvdxml@678c522

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • sparql.py
  • tests
    • test_specialized_references.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎sparql.py‎

Copy file name to clipboardExpand all lines: sparql.py
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ def withschema(fn):
5959

6060
def _(*args, **kwargs):
6161
schema_name = STANDARD_PREFIXES["ifcowl"].split("/")[-1][:-2]
62-
if "_" in schema_name:
63-
schema_name = schema_name.split("_")[0]
64-
S = ifcopenshell.ifcopenshell_wrapper.schema_by_name(schema_name)
62+
try:
63+
S = ifcopenshell.ifcopenshell_wrapper.schema_by_name(schema_name)
64+
except RuntimeError:
65+
if "_" not in schema_name:
66+
raise
67+
S = ifcopenshell.ifcopenshell_wrapper.schema_by_name(schema_name.split("_")[0])
6568
return fn(S, *args, **kwargs)
6669

6770
return _
Collapse file

‎tests/test_specialized_references.py‎

Copy file name to clipboardExpand all lines: tests/test_specialized_references.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def test_references_chained_entities_and_direct_attribute_entities_are_equivalen
247247
comparing actual extracted bindings and SPARQL rows, not only match flags.
248248
"""
249249
monkeypatch.setitem(
250-
sparql.STANDARD_PREFIXES, "ifcowl", "<http://example.org/IFC4X3#>"
250+
sparql.STANDARD_PREFIXES, "ifcowl", "<http://example.org/IFC4X3_ADD2#>"
251251
)
252252
extraction = {}
253253
query_results = {}
@@ -363,7 +363,7 @@ def test_graphviz_reference_matches_xml_specialization(
363363

364364
def owl_graph(model):
365365
graph = Graph()
366-
owl = Namespace("http://example.org/IFC4X3#")
366+
owl = Namespace("http://example.org/IFC4X3_ADD2#")
367367
inst = Namespace("http://example.org/instances/")
368368
express = Namespace("https://w3id.org/express#")
369369
schema = ifcopenshell.schema_by_name("IFC4X3_ADD2")
@@ -399,7 +399,7 @@ def test_sparql_executes_specialized_type_filter(
399399
tmp_path, geometry_models, monkeypatch, revolved, leaf
400400
):
401401
monkeypatch.setitem(
402-
sparql.STANDARD_PREFIXES, "ifcowl", "<http://example.org/IFC4X3#>"
402+
sparql.STANDARD_PREFIXES, "ifcowl", "<http://example.org/IFC4X3_ADD2#>"
403403
)
404404
parsed = body_template(tmp_path, revolved=revolved, leaf=leaf)
405405
query = sparql.convertor.template(parsed)

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.