Closed ronaldtse closed 7 months ago
@ronaldtse what should be the format of the output in the mapping.yaml
file?
Just similar to the XML structure. Please take a first stab and then I’ll let you know any feedback.
@ronaldtse got it. I'm working on extracting shale mappings from the module.dtd
file, will let you know once its ready.
I think we should implement fully qualified names, that is precede the type name in the reference path by the schema name. more later. Tom
On Apr 3, 2024, at 1:36 AM, Ronald Tse @.***> wrote:
In every module.xml, there is a
element. We need to convert this into a mapping.yaml file (we already have mapping.changes.yaml, so let's keep it at the same place). Let's use Shale to parse it according to the DTD (module.dtd).
This element looks like this:
... Elements can look like:
<!-- ++ AFFECTED_PLANE_TOLERANCE_ZONE ++ --> <ae entity="Affected_plane_tolerance_zone" extensible="NO"> <aimelt>tolerance_zone</aimelt> <source>ISO 10303-47</source> <aa attribute="affected_plane" assertion_to="Axis_placement_shape_element"> <aimelt>PATH</aimelt> <refpath> shape_tolerance_schema.tolerance_zone <= shape_aspect <- shape_aspect_relationship.relating_shape_aspect shape_aspect_relationship {shape_aspect_relationship.name = 'affected plane association'} shape_aspect_relationship.related_shape_aspect -> shape_aspect </refpath> </aa> </ae> <!-- ++ ALL_AROUND_SHAPE_ELEMENT ++ --> <ae entity="All_around_shape_element" extensible="NO"> <aimelt>all_around_shape_aspect</aimelt> <source>ISO 10303-47</source> </ae> <!-- ++ TOLERANCE_ZONE ++ --> <ae entity="Tolerance_zone" extensible="NO"> <aimelt>tolerance_zone</aimelt> <source>ISO 10303-47</source> <aa attribute="form_type"> <alt_map id="1"> <description>If form_type has the value within_a_circle</description> <aimelt>tolerance_zone_form.name</aimelt> <refpath>{tolerance_zone_form.name = 'within a circle'}</refpath> </alt_map> <alt_map id="2"> <description>If form_type has the value within_a_cylinder</description> <aimelt>tolerance_zone_form.name</aimelt> <refpath>{tolerance_zone_form.name = 'within a cylinder'}</refpath> </alt_map> <!-- ... --> </aa> <aa attribute="zone_for" assertion_to="Geometric_tolerance"> <aimelt>PATH</aimelt> <refpath>tolerance_zone
tolerance_zone.defining_tolerance[i] -> tolerance_zone_target = geometric_tolerance geometric_tolerance
</ae>
— Reply to this email directly, view it on GitHub https://github.com/metanorma/stepmod-utils/issues/239, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMMKVFTNBR62IYRVFA5ZFLY3OPORAVCNFSM6AAAAABFUVO4FKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZDEMBSHE3DONY. You are receiving this because you are subscribed to this thread.
The reference paths are PCDATA. which the dtd doesn't help with. To find the details look at clause 5.1 which defines the multi-character symbols that are part of the reference path. The multi-character symbols are critical part of checking technology.
@HassanAkbar can you please help complete this the coming week? Thanks.
I think we should implement fully qualified names, that is precede the type name in the reference path by the schema name. more later. Tom … On Apr 3, 2024, at 1:36 AM, Ronald Tse @.***> wrote: In every module.xml, there is a
element. We need to convert this into a mapping.yaml file (we already have mapping.changes.yaml, so let's keep it at the same place). Let's use Shale to parse it according to the DTD (module.dtd). This element looks like this: <ae ...> ... Elements can look like:tolerance_zone PATH shape_tolerance_schema.tolerance_zone <= shape_aspect <- shape_aspect_relationship.relating_shape_aspect shape_aspect_relationship {shape_aspect_relationship.name = 'affected plane association'} shape_aspect_relationship.related_shape_aspect -> shape_aspect all_around_shape_aspect — Reply to this email directly, view it on GitHub <#239>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMMKVFTNBR62IYRVFA5ZFLY3OPORAVCNFSM6AAAAABFUVO4FKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIZDEMBSHE3DONY. You are receiving this because you are subscribed to this thread. tolerance_zone If form_type has the value within_a_circle tolerance_zone_form.name {tolerance_zone_form.name = 'within a circle'} If form_type has the value within_a_cylinder tolerance_zone_form.name {tolerance_zone_form.name = 'within a cylinder'} PATH tolerance_zone tolerance_zone.defining_tolerance[i] -> tolerance_zone_target = geometric_tolerance geometric_tolerance
@ronaldtse @HassanAkbar It is likely that in some cases, the query to find the schema name will fail. Ideas? Maybe just ignore the failure and continue. Then we can run a post-process check for missing schema name.
In every
module.xml
, there is a<mapping_table>
element. We need to convert this into amapping.yaml
file (we already havemapping.changes.yaml
, so let's keep it at the same place).Let's use Shale to parse it according to the DTD (
module.dtd
).This element looks like this:
Elements can look like: