Skip to content

TestCase pass-specification_optionality_and_facet_optionality_can_be_combined not passes #402

Open

Description

@Cudok

description

the TestCase form the folder ids with the regarding files:

  • pass-specification_optionality_and_facet_optionality_can_be_combined not passes.ifc and
  • pass-specification_optionality_and_facet_optionality_can_be_combined not passes.ids

not pass with the usage of ifcTester. From my understanding (based on https://github.com/buildingSMART/IDS/blob/development/Documentation/ImplementersDocumentation/TestCases/scripts.md) this TestCase should pass fully.

used python script

import ifcopenshell
import ifctester
import ifctester.ids
import ifctester.reporter
import webbrowser
model = ifcopenshell.open('pass-specification_optionality_and_facet_optionality_can_be_combined.ifc')
my_ids = ifctester.ids.open('pass-specification_optionality_and_facet_optionality_can_be_combined.ids')
my_ids.validate(model)

# return the check of specifications pass(true) or fail(false) with
# and the name of the specification
# and if all specifications of one IDS pass
all_spec_pass = True
for spec in my_ids.specifications:
    print("name: {}, passed: {}".format(spec.name, spec.status))
    if not spec.status:
        all_spec_pass = False
print(">>>>>> ")
print("all checks of the specifications of this IDS pass: {}".format(all_spec_pass))

# for check the results of return above
ifctester.reporter.Console(my_ids).report()

return

name: Specification optionality and facet optionality can be combined, passed: False
>>>>>> 
all checks of the specifications of this IDS pass: False
Specification optionality and facet optionality can be combined
[FAIL] (0/1) Specification optionality and facet optionality can be combined
    Applies to:
        All IFCWALL data
    Requirements:
        The Name shall be Waldo
        The Description may be Foobar
            The attribute value None is empty - #1=IfcWall('1hqIFTRjfV6AWq_bMtnZwI',$,'Waldo',$,$,$,$,$,$)

setup

python: 3.11
ifctester: 0.8.1
ifcopenshell: 0.7.0.240627
os: PopOS

Activity

  1. Moult commented on Mar 11, 2025

    @Moult
    Contributor

    This is not a bug in IDS? I'm closing this referencing it here: IfcOpenShell/IfcOpenShell#6323

  2. reopened this on Feb 16, 2026
  3. Moult commented on Feb 16, 2026

    @Moult
    Contributor

    Reopening because I think this is potentially a bug in IDS itself. The test case says it should pass pass-specification_optionality_and_facet_optionality_can_be_combined not passes.ifc, however, the written documentation seems to contradict.

    https://github.com/buildingSMART/IDS/blob/development/Documentation/UserManual/attribute-facet.md states for prohibited facets:

    The attribute Description must not exist on applicable objects, even if empty.

    And for optional it says:

    If the attribute Description exists on applicable objects, it needs to have the value Answer.

    From this, the word "exists" seems to mean is part of the schema definition, and has nothing to do with emptiness. Therefore, I'd say that the test case should fail, not pass.

  4. BIMvoice commented on Aug 6, 2026

    @BIMvoice
    Contributor

    Measured this rather than re-reading the spec text in isolation.

    On the reported behaviour, optional plus an unset Description failing instead of passing: that is an implementation bug on our side, and there is already an unmerged fix for it, IfcOpenShell#7645 by @louistrue.

    On the reopening question, we do not think this is an IDS bug. attribute-facet.md's REQUIRED with no value row defines populated as "not null". Reading OPTIONAL's "exists" any other way, as schema level presence, would make that word mean two different things one table row apart. property-facet.md's OPTIONAL row makes the intended reading explicit: "Lack of property is allowed."

    So the fixture's PASS expectation matches the documented behaviour, and the current FAIL is the implementation, not the test case.

    Separately, the same investigation turned up a related defect on the PROHIBITED row, which seems worth recording here since it comes from the same table.

    That row says the attribute must not exist, even if empty. We were not enforcing the "even if empty" half:

    prohibited, Description unset       PASS   correct
    prohibited, Description = ""        PASS   should FAIL
    prohibited, LayerOn = UNKNOWN       PASS   should FAIL
    

    The cause is that empty values are stripped out before existence is decided, which is right for REQUIRED and OPTIONAL but makes a present-but-empty attribute indistinguishable from an absent one. Notably the Classification facet does not do that stripping and was already correct, so the three facets did not agree with each other.

    Fixed on our side in IfcOpenShell#9273. Not proposing any specification change, the documentation was already clear on this. Flagging it only because the same "even if empty" phrasing appears in attribute-facet.md, property-facet.md and classification-facet.md, so other implementations may want to check the same case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions