René's URL Explorer Experiment


Title: AttributeError: 'Restriction' object has no attribute 'endswith' when an element fails an entity requirement expressed as xs:restriction · Issue #8046 · IfcOpenShell/IfcOpenShell · GitHub

Open Graph Title: AttributeError: 'Restriction' object has no attribute 'endswith' when an element fails an entity requirement expressed as xs:restriction · Issue #8046 · IfcOpenShell/IfcOpenShell

X Title: AttributeError: 'Restriction' object has no attribute 'endswith' when an element fails an entity requirement expressed as xs:restriction · Issue #8046 · IfcOpenShell/IfcOpenShell

Description: Bug Description Description When an element matches the applicability but fails an entity requirement expressed as xs:restrictionxs:enumeration, ifctester crashes instead of reporting a failure. The xs:restriction form for entity names i...

Open Graph Description: Bug Description Description When an element matches the applicability but fails an entity requirement expressed as xs:restrictionxs:enumeration, ifctester crashes instead of reporting a failure. Th...

X Description: Bug Description Description When an element matches the applicability but fails an entity requirement expressed as xs:restrictionxs:enumeration, ifctester crashes instead of reporting a failure. Th...

Opengraph URL: https://github.com/IfcOpenShell/IfcOpenShell/issues/8046

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"AttributeError: 'Restriction' object has no attribute 'endswith' when an element fails an entity requirement expressed as xs:restriction","articleBody":"### Bug Description\n\n**Description**\nWhen an element matches the applicability but fails an entity requirement expressed as \u003cxs:restriction>\u003cxs:enumeration>, ifctester crashes instead of reporting a failure. The \u003cxs:restriction> form for entity names is valid per the IDS 1.0 schema and is covered by existing test cases, but those cases only test the pass path. The fail path is untested and broken.\n\n**Steps to reproduce**\n- Use the attached IDS file against any IFC2X3 model containing at least one IfcColumn\n- Run validation via ifctester\n\n### Attachments\n\n[ifctester-restriction-bug-demo.txt](https://github.com/user-attachments/files/27587358/ifctester-restriction-bug-demo.txt)\n\nThe IDS (Renamed extension to .txt) has a broad applicability (walls and columns) and a narrower requirement (walls only). Columns match the applicability but fail the requirement, triggering the crash.\n\n**Two issues in facet.py:**\n- Restriction.__eq__ has no explicit return True at the end of the method. When all constraints pass, it returns None implicitly. This means a comparison like inst.is_a().upper() == self.name evaluates to None (falsy) even for a matching element, causing is_pass to be falsy when it should be True.\n- Because is_pass is falsy, Entity.__call__ enters the IFC2X3 type-inference block and hits line 237 (self.name.endswith(\"TYPE\")), which raises AttributeError because Restriction has no endswith method. Line 240 (f\"{self.name}TYPE\") would produce an incorrect string for the same reason.\n\n**Suggested fix:**\nAdd return True at the end of Restriction.__eq__ so matching constraints produce a truthy result. Additionally harden Entity.__call__ against non-string names:\n# Restriction.__eq__ — add explicit return\ndef __eq__(self, other):\n    ...\n    return True  # currently missing, falls through to implicit None\n\n# Entity.__call__ — extract name_str before the IFC2X3 block\nname_str = self.name if isinstance(self.name, str) else next(\n    iter(self.name.options.get(\"enumeration\", [])), \"\"\n)\nif (\n    not is_pass\n    and inst.file.schema == \"IFC2X3\"\n    and not name_str.endswith(\"TYPE\")\n    and (element_type := ifcopenshell.util.element.get_type(inst))\n):\n    is_pass = element_type.is_a().upper() == f\"{name_str}TYPE\"\n\n### Debug and Error Output\n\n```true\nError\n\nFile \"ifctester/facet.py\", line 237, in __call__\n    and not self.name.endswith(\"TYPE\")\nAttributeError: 'Restriction' object has no attribute 'endswith'\n```","author":{"url":"https://github.com/bsmithuk","@type":"Person","name":"bsmithuk"},"datePublished":"2026-05-11T08:48:05Z","url":"https://github.com/IfcOpenShell/IfcOpenShell/issues/8046"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:65727050-61f2-69f8-3b17-37a94aa43075
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id93A4:15B1DE:15EE6D:1DB91F:6B048195
html-safe-noncecdba7884229535f0863c1c73d82c61cf95a7fb899616e07d92e5ed388fef9df8
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5M0E0OjE1QjFERToxNUVFNkQ6MURCOTFGOjZCMDQ4MTk1IiwidmlzaXRvcl9pZCI6IjI3MjI1MTkzMDE4ODUyOTcwNDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac9ecf060e318d09cfd61dcc35468d3d50c98f8d549c5c7fe9cb03a1fe2b8cdd05
hovercard-subject-tagissue:4419375870
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/IfcOpenShell/IfcOpenShell/8046/issue_layout
twitter:imagehttps://opengraph.githubassets.com/28eb2a739e266aae803004c40c45b11ba1b59bbc5dd62996a9a9f6bd497125c7/IfcOpenShell/IfcOpenShell/issues/8046
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/28eb2a739e266aae803004c40c45b11ba1b59bbc5dd62996a9a9f6bd497125c7/IfcOpenShell/IfcOpenShell/issues/8046
og:image:altBug Description Description When an element matches the applicability but fails an entity requirement expressed as xs:restrictionxs:enumeration, ifctester crashes instead of reporting a failure. Th...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebsmithuk
hostnamegithub.com
expected-hostnamegithub.com
None0366ddfb372682a32e92a5d86155cb08fa83e5bbe79953a968789f2f7e24c511
turbo-cache-controlno-preview
go-importgithub.com/IfcOpenShell/IfcOpenShell git https://github.com/IfcOpenShell/IfcOpenShell.git
octolytics-dimension-user_id13692563
octolytics-dimension-user_loginIfcOpenShell
octolytics-dimension-repository_id40473201
octolytics-dimension-repository_nwoIfcOpenShell/IfcOpenShell
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id40473201
octolytics-dimension-repository_network_root_nwoIfcOpenShell/IfcOpenShell
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseed3f2e01f6b7672780c586c8af0e72726374d7b6
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/IfcOpenShell/IfcOpenShell/issues/8046#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F8046
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FIfcOpenShell%2FIfcOpenShell%2Fissues%2F8046
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=IfcOpenShell%2FIfcOpenShell
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/8046
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/8046
Reloadhttps://github.com/IfcOpenShell/IfcOpenShell/issues/8046
IfcOpenShellhttps://github.com/IfcOpenShell
IfcOpenShellhttps://github.com/IfcOpenShell/IfcOpenShell
Codehttps://github.com/IfcOpenShell/IfcOpenShell
Issues1.2k (1.2k)https://github.com/IfcOpenShell/IfcOpenShell/issues
Pull requests937 (937)https://github.com/IfcOpenShell/IfcOpenShell/pulls
Discussionshttps://github.com/IfcOpenShell/IfcOpenShell/discussions
Actionshttps://github.com/IfcOpenShell/IfcOpenShell/actions
Projectshttps://github.com/IfcOpenShell/IfcOpenShell/projects
Wikihttps://github.com/IfcOpenShell/IfcOpenShell/wiki
Security and qualityhttps://github.com/IfcOpenShell/IfcOpenShell/security
Insightshttps://github.com/IfcOpenShell/IfcOpenShell/insights
https://github.com/IfcOpenShell/IfcOpenShell
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/8046
New issuehttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/8046
Bughttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=type:"Bug"
#9540https://github.com/IfcOpenShell/IfcOpenShell/pull/9540
AttributeError: 'Restriction' object has no attribute 'endswith' when an element fails an entity requirement expressed as xs:restrictionhttps://github.com/IfcOpenShell/IfcOpenShell/issues/8046#top
#9540https://github.com/IfcOpenShell/IfcOpenShell/pull/9540
PR ProposedA PR has been proposed for this bug/feature.https://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
https://github.com/bsmithuk
bsmithukhttps://github.com/bsmithuk
on May 11, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8046#issue-4419375870
ifctester-restriction-bug-demo.txthttps://github.com/user-attachments/files/27587358/ifctester-restriction-bug-demo.txt
bsmithukhttps://github.com/bsmithuk
Bughttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=type:"Bug"
on May 11, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8046#event-25373269500
bsmithukhttps://github.com/bsmithuk
on May 15, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8046#event-25581381210
Fix IfcOpenShell#8046 - Entity xs:restriction name crashes with Attri…https://github.com/bsmithuk/IfcOpenShellPR/commit/5cbb32193d55c50d226b44eead196340384cae4d
IfcOpenShell#8046https://github.com/IfcOpenShell/IfcOpenShell/issues/8046
https://docs.github.com/articles/closing-issues-via-commit-messages
5cbb321https://github.com/bsmithuk/IfcOpenShellPR/commit/5cbb32193d55c50d226b44eead196340384cae4d
https://github.com/petruconduraru
petruconduraruhttps://github.com/petruconduraru
on Jul 5, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8046#issuecomment-4885365746
#8250https://github.com/IfcOpenShell/IfcOpenShell/pull/8250
https://github.com/petruconduraru
petruconduraruhttps://github.com/petruconduraru
on Jul 5, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8046#issuecomment-4887339377
#8292https://github.com/IfcOpenShell/IfcOpenShell/pull/8292
petruconduraruhttps://github.com/petruconduraru
on Jul 6, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8046#event-27604992852
ifctester: entity requirement as xs:restriction no longer crashes on …https://github.com/BIMvoice/IfcOpenShell/commit/5d01d308811002f37e24dc3cf1a8f9bfb7e92068
5d01d30https://github.com/BIMvoice/IfcOpenShell/commit/5d01d308811002f37e24dc3cf1a8f9bfb7e92068
petruconduraruhttps://github.com/petruconduraru
PR ProposedA PR has been proposed for this bug/feature.https://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
on Jul 7, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8046#event-27663030301
petruconduraruhttps://github.com/petruconduraru
on Jul 9, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8046#event-27759982109
IfcTester: guard IFC2X3 entity type inference against restriction names https://github.com/BIMvoice/IfcOpenShell/commit/6552a234cb6b1657eb4838c79fbfe4f16ad29cee
6552a23https://github.com/BIMvoice/IfcOpenShell/commit/6552a234cb6b1657eb4838c79fbfe4f16ad29cee
petruconduraruhttps://github.com/petruconduraru
on Aug 7, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8046#event-29101087192
ifctester: add fixture for IfcOpenShell#8046 restriction crashhttps://github.com/BIMvoice/IfcOpenShell/commit/34eb84de0df1e6894e949f54c777986b10541161
IfcOpenShell#8046https://github.com/IfcOpenShell/IfcOpenShell/issues/8046
34eb84dhttps://github.com/BIMvoice/IfcOpenShell/commit/34eb84de0df1e6894e949f54c777986b10541161
Moulthttps://github.com/Moult
completedhttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#9540https://github.com/IfcOpenShell/IfcOpenShell/pull/9540
on Sep 18, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8046#event-31424242637
Moulthttps://github.com/Moult
on Sep 19, 2026https://github.com/IfcOpenShell/IfcOpenShell/issues/8046#event-31429507252
ifctester: entity facets with a restriction name no longer crash on I…https://github.com/BIMvoice/IfcOpenShell/commit/1bf3168addf59d57f416a8afdfbe53387650cf7d
https://docs.github.com/articles/closing-issues-via-commit-messages
1bf3168https://github.com/BIMvoice/IfcOpenShell/commit/1bf3168addf59d57f416a8afdfbe53387650cf7d
Sign up for freehttps://github.com/signup?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/8046
Sign in to commenthttps://github.com/login?return_to=https://github.com/IfcOpenShell/IfcOpenShell/issues/8046
PR ProposedA PR has been proposed for this bug/feature.https://github.com/IfcOpenShell/IfcOpenShell/issues?q=state%3Aopen%20label%3A%22PR%20Proposed%22
Bughttps://github.com/IfcOpenShell/IfcOpenShell/issues?q=type:"Bug"
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.