Skip to content

Commit 1fa0897

Browse files
committed
revise ALB010 to enforce referents required for IfcAlignmentHorizontal only
IVS-388
1 parent c750a47 commit 1fa0897

13 files changed

+254
-26
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
@industry-practice
22
@ALB
3-
@version1
3+
@version2
44
@E00100
55
Feature: ALB010 - Alignment Nesting Referents
6-
The rule verifies that each alignment nests at least one IfcReferent, such as stations or mileage points.
6+
The rule verifies that each horizontal alignment nests at least one IfcReferent, such as stations or mileage points.
77
These can be used as semantic entities holding information about locations along the alignment.
88
IfcReferent is associated to IfcAlignment via the IfcRelNests relationship.
99

10-
Scenario: Agreement on each IfcAlignment nesting at least one IfcReferent
10+
Scenario: Agreement on each IfcAlignment nesting at least one IfcReferent when not re-using horizontal layout
1111

1212
Given A model with Schema 'IFC4.3'
1313
Given an .IfcAlignment.
14-
15-
Then A relationship IfcRelNests must exist from IfcAlignment to IfcReferent
14+
Given A relationship .IfcRelNests. from .IfcAlignment. to .IfcAlignmentHorizontal.
15+
16+
Then A relationship .IfcRelNests. must exist from .IfcAlignment. to .IfcReferent.
17+

Diff for: features/rules/ALB/ALB012_Alignment-vertical-segment-radius-of-curvature.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Feature: ALB012 - Alignment vertical segment radius of curvature
88
Background:
99
Given A model with Schema 'IFC4.3'
1010
Given An .IfcAlignmentVertical.
11-
Given A relationship IfcRelNests from IfcAlignmentVertical to IfcAlignmentSegment and following that
11+
Given A relationship .IfcRelNests. from .IfcAlignmentVertical. to .IfcAlignmentSegment. and following that
1212
Given Its attribute .DesignParameters.
1313
Given [Its entity type] ^is^ 'IfcAlignmentVerticalSegment'
1414

Diff for: features/rules/ALB/ALB015_Alignment-business-logic-zero-length-final-segment.feature

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ Feature: ALB015 - Alignment business logic zero length final segment
99
Scenario: Validating final segment of horizontal alignment business logic
1010
Given A model with Schema 'IFC4.3'
1111
Given An .IfcAlignmentHorizontal.
12-
Given A relationship IfcRelNests from IfcAlignmentHorizontal to IfcAlignmentSegment and following that
12+
Given A relationship .IfcRelNests. from .IfcAlignmentHorizontal. to .IfcAlignmentSegment. and following that
1313
Given Its final element at depth 1
1414
Given Its attribute .DesignParameters.
1515
Then The SegmentLength of the IfcAlignmentHorizontalSegment must be 0
1616

1717
Scenario: Validating final segment of vertical alignment business logic
1818
Given A model with Schema 'IFC4.3'
1919
Given An .IfcAlignmentVertical.
20-
Given A relationship IfcRelNests from IfcAlignmentVertical to IfcAlignmentSegment and following that
20+
Given A relationship .IfcRelNests. from .IfcAlignmentHorizontal. to .IfcAlignmentSegment. and following that
2121
Given Its final element at depth 1
2222
Given Its attribute .DesignParameters.
2323
Then The HorizontalLength of the IfcAlignmentVerticalSegment must be 0
2424

2525
Scenario: Validating final segment of cant alignment business logic
2626
Given A model with Schema 'IFC4.3'
2727
Given An .IfcAlignmentCant.
28-
Given A relationship IfcRelNests from IfcAlignmentCant to IfcAlignmentSegment and following that
28+
Given A relationship .IfcRelNests. from .IfcAlignmentCant. to .IfcAlignmentSegment. and following that
2929
Given Its final element at depth 1
3030
Given Its attribute .DesignParameters.
3131
Then The HorizontalLength of the IfcAlignmentCantSegment must be 0

Diff for: features/rules/BLT/BLT001_Correct-use-of-operation-type-attributes-for-doors.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ Scenario Outline: Correct values for OperationType and UserDefinedOperationType
2727
Scenario: Correct IfcOperationType with relating type object
2828

2929
Given an .IfcDoor.
30-
Given a relationship IfcRelDefinesByType to IfcDoor from IfcDoorType
30+
Given a relationship .IfcRelDefinesByType. to .IfcDoor. from .IfcDoorType.
3131

3232
Then .OperationType. ^is^ empty

Diff for: features/rules/BLT/BLT002_Correct-use-of-partitioning-type-attributes-for-windows.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ Scenario Outline: Correct values for PartitioningType and UserDefinedPartitionin
2727
Scenario: Correct IfcPartitioningType with relating type object
2828

2929
Given an .IfcWindow.
30-
Given a relationship IfcRelDefinesByType to IfcWindow from IfcWindowType
30+
Given a relationship .IfcRelDefinesByType. to .IfcWindow. from .IfcWindowType.
3131

3232
Then .PartitioningType. ^is^ empty

Diff for: features/rules/OJP/OJP001_Relative-placement-for-elements-aggregated-to-another-element.feature

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ with an PlacementRelTo attribute pointing to the IfcLocalPlacement of the contai
1111

1212
Given A model with Schema 'IFC2X3' or 'IFC4'
1313
Given An .IfcElement.
14-
Given A relationship IfcRelAggregates from IfcElement to IfcElement and following that
14+
Given A relationship .IfcRelAggregates. from .IfcElement. to .IfcElement. and following that
1515

1616
Then The relative placement of that IfcElement must be provided by an IfcLocalPlacement entity
1717

@@ -20,6 +20,6 @@ with an PlacementRelTo attribute pointing to the IfcLocalPlacement of the contai
2020

2121
Given A model with Schema 'IFC2X3' or 'IFC4'
2222
Given An .IfcElement.
23-
Given A relationship IfcRelAggregates from IfcElement to IfcElement and following that
23+
Given A relationship .IfcRelAggregates. from .IfcElement. to .IfcElement. and following that
2424

2525
Then The PlacementRelTo attribute must point to the IfcLocalPlacement of the container element established with IfcRelAggregates relationship

Diff for: features/rules/OJT/OJT001_Object-predefined-type.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ Scenario: Validating the proper use of PredefinedType for an Object typed by Ifc
2323
Given A model with Schema 'IFC4' or 'IFC4.3'
2424
Given An .IfcTypeObject. ^with subtypes^
2525
Given Its PredefinedType attribute does not start with NOTDEFINED
26-
Given A relationship IfcRelDefinesByType from IfcTypeObject to IfcObject and following that
26+
Given A relationship .IfcRelDefinesByType. from .IfcTypeObject. to .IfcObject. following that
2727
Then The value of attribute PredefinedType must be empty and display entity instance

Diff for: features/rules/PJS/PJS002_Correct-elements-related-to-project.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ Feature: PJS002 - Correct elements related to project
1111

1212
Scenario: Validating correct elements relationship from IfcProject
1313
Given An .IfcProject.
14-
Given a relationship IfcRelDeclares from IfcProject to IfcRoot and following that
14+
Given a relationship .IfcRelDeclares. from .IfcProject. to .IfcRoot. and following that
1515

1616
Then the type must be in 'valid_ProjectDeclaration.csv'

Diff for: features/rules/SPS/SPS007_Spatial-containment.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The rule verifies that spatial containment via IfcRelContainedInSpatialStructure
2828

2929
Scenario: Entities that are an aggregated part of another element must not also be part of a spatial structure
3030
Given an .IfcElement.
31-
Given a relationship IfcRelAggregates to IfcElement from IfcElement
31+
Given a relationship .IfcRelAggregates. to .IfcElement. from .IfcElement.
3232

3333
Then .ContainedInStructure. ^is^ empty
3434

Diff for: features/rules/SYS/SYS001_Cable-signal-flow.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The rule verifies that IfcCableSegment must define 2 distribution ports, 1 as a
1818
@E00100
1919
Scenario: Agreement on port directions
2020

21-
Given There exists a relationship IfcRelNests from IfcAlignment to IfcDistributionPort and following that
21+
Given There exists a relationship .IfcRelNests. from .IfcAlignment. to .IfcDistributionPort. and following that
2222
Given Its attribute .FlowDirection.
2323
Then at least '1' value must be 'SOURCE'
2424
Then at least '1' value must be 'SINK'

Diff for: features/steps/givens/relationships.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
from . import ValidationOutcome, OutcomeSeverity
66

77

8-
@gherkin_ifc.step('A relationship {relationship} {dir1:from_to} {entity} {dir2:from_to} {other_entity}')
9-
@gherkin_ifc.step('A relationship {relationship} exists {dir1:from_to} {entity} {dir2:from_to} {other_entity}')
10-
@gherkin_ifc.step('A relationship {relationship} must exist {dir1:from_to} {entity} {dir2:from_to} {other_entity}')
11-
@gherkin_ifc.step('A relationship {relationship} {dir1:from_to} {entity} {dir2:from_to} {other_entity} {tail:maybe_and_following_that}')
12-
@gherkin_ifc.step('A *{required}* relationship {relationship} {dir1:from_to} {entity} {dir2:from_to} {other_entity}')
13-
@gherkin_ifc.step('A *{required}* relationship {relationship} {dir1:from_to} {entity} {dir2:from_to} {other_entity} {tail:maybe_and_following_that}')
8+
@gherkin_ifc.step('A relationship .{relationship}. {dir1:from_to} {entity} {dir2:from_to} .{other_entity}.')
9+
@gherkin_ifc.step('A relationship .{relationship}. exists {dir1:from_to} .{entity}. {dir2:from_to} .{other_entity}.')
10+
@gherkin_ifc.step('A relationship .{relationship}. must exist {dir1:from_to} .{entity}. {dir2:from_to} .{other_entity}.')
11+
@gherkin_ifc.step('A relationship .{relationship}. {dir1:from_to} .{entity}. {dir2:from_to} .{other_entity}. {tail:maybe_and_following_that}')
12+
@gherkin_ifc.step('A *{required}* relationship .{relationship}. {dir1:from_to} .{entity}. {dir2:from_to} .{other_entity}.')
13+
@gherkin_ifc.step('A *{required}* relationship .{relationship}. {dir1:from_to} .{entity}. {dir2:from_to} .{other_entity}. {tail:maybe_and_following_that}')
1414
def step_impl(context, inst, relationship, dir1, entity, dir2, other_entity, tail=" ", required=False):
1515
"""""
1616
Reference to tfk ALB999 rule https://github.com/buildingSMART/ifc-gherkin-rules/pull/37
@@ -54,7 +54,7 @@ def make_aggregate(val):
5454
yield ValidationOutcome(instance_id=inst, severity=OutcomeSeverity.ERROR)
5555

5656
if rel_attribute_name == attr_to_entity:
57-
if tail.strip():
57+
if str(tail).strip():
5858
instances.extend(to_other)
5959
else:
6060
instances.append(inst)
@@ -67,7 +67,7 @@ def make_aggregate(val):
6767

6868

6969

70-
@gherkin_ifc.step("The element {relationship_type} an {entity}")
70+
@gherkin_ifc.step("The element ^{relationship_type}^ an .{entity}.")
7171
def step_impl(context, inst, relationship_type, entity):
7272
reltype_to_extr = {'nests': {'attribute': 'Nests', 'object_placement': 'RelatingObject'},
7373
'is nested by': {'attribute': 'IsNestedBy', 'object_placement': 'RelatedObjects'}}

0 commit comments

Comments
 (0)