Skip to content

Commit

Permalink
Adjusted handling of all-imports to correct possible metapath syntax …
Browse files Browse the repository at this point in the history
…errors.
  • Loading branch information
david-waltermire committed Jul 8, 2024
1 parent 52774c1 commit f45bd7c
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions src/validations/constraints/oscal-external-constraints.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,22 @@
<context>
<metapath target="/profile"/>
<constraints>
<let var="all-imports" expression="resolve-profile(doc(resolve-uri(import/@href)))/catalog"/>
<index id="profile-metadata-role-id" name="index-imports-metadata-role-id" target="map:merge(recurse-depth($all-imports)/metadata/role ! map:entry(@id,.))?*">
<let var="resolved-profile" expression="xresolve-profile(doc(resolve-uri(import/@href)))/catalog"/>
<index id="profile-metadata-role-id" name="index-imports-metadata-role-id" target="$resolved-profile/metadata/role">
<formal-name>In-Scope Role Identifiers</formal-name>
<description>An index of role identifiers that are in-scope for the profile model. Roles are collected from imported catalogs and profiles. For a given role @id, a locally declared role takes precedence over a role that is imported, the role that was last imported.</description>
<key-field target="@id"/>
</index>
<index id="profile-metadata-location-uuid" name="index-imports-metadata-location-uuid" target="map:merge(recurse-depth($all-imports)/metadata/location ! map:entry(@uuid,.))?*">
<index id="profile-metadata-location-uuid" name="index-imports-metadata-location-uuid" target="$resolved-profile/metadata/location">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-party-uuid" name="index-imports-metadata-party-uuid" target="map:merge(recurse-depth($all-imports)/metadata/party ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-party-uuid" name="index-imports-metadata-party-uuid" target="$resolved-profile/metadata/party">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-party-organization-uuid" name="index-imports-metadata-party-organization-uuid" target="map:merge(recurse-depth($all-imports)/metadata/party[@type='organization'] ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-party-organization-uuid" name="index-imports-metadata-party-organization-uuid" target="$resolved-profile/metadata/party[@type='organization']">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-property-uuid" name="index-imports-metadata-property-uuid" target="map:merge(recurse-depth($all-imports)//prop[@uuid] ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-property-uuid" name="index-imports-metadata-property-uuid" target="$resolved-profile//prop[@uuid]">
<key-field target="@uuid"/>
</index>
</constraints>
Expand Down Expand Up @@ -159,114 +159,114 @@
<context>
<metapath target="/component-definition"/>
<constraints>
<let var="all-imports" expression="'doc(resolve-uri(import-component-definition/@href))/component-definition'"/>
<index id="index-imports-metadata-role-id" name="index-imports-metadata-role-id" target="map:merge(recurse-depth($all-imports)/metadata/role ! map:entry(@id,.))?*">
<let var="all-imports" expression="recurse-depth('doc(resolve-uri(import-component-definition/@href))/component-definition')"/>
<index id="index-imports-metadata-role-id" name="index-imports-metadata-role-id" target="map:merge($all-imports/metadata/role ! map:entry(@id,.))?*">
<formal-name>In-Scope Role Identifiers</formal-name>
<description>An index of role identifiers that are in-scope for the component-definition model. Roles are collected from imported component-definition. For a given role @id, a locally declared role takes precedence over a role that is imported, the role that was last imported.</description>
<key-field target="@id"/>
</index>
<index id="index-imports-metadata-location-uuid" name="index-imports-metadata-location-uuid" target="recurse-depth($all-imports)/metadata/location">
<index id="index-imports-metadata-location-uuid" name="index-imports-metadata-location-uuid" target="map:merge($all-imports/metadata/location ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-party-uuid" name="index-imports-metadata-party-uuid" target="recurse-depth($all-imports)/metadata/party">
<index id="index-imports-metadata-party-uuid" name="index-imports-metadata-party-uuid" target="map:merge($all-imports/metadata/party ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-party-organization-uuid" name="index-imports-metadata-party-organization-uuid" target="recurse-depth($all-imports)/metadata/party[@type='organization']">
<index id="index-imports-metadata-party-organization-uuid" name="index-imports-metadata-party-organization-uuid" target="map:merge($all-imports/metadata/party[@type='organization'] ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-property-uuid" name="index-imports-metadata-property-uuid" target="recurse-depth($all-imports)//prop[@uuid]">
<index id="index-imports-metadata-property-uuid" name="index-imports-metadata-property-uuid" target="map:merge($all-imports//prop[@uuid] ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
</constraints>
</context>
<context>
<metapath target="/system-security-plan"/>
<constraints>
<let var="all-imports" expression="'resolve-profile(doc(resolve-uri(import-profile/@href)))/catalog'"/>
<index id="index-imports-metadata-roles" name="index-imports-metadata-role-id" target="map:merge(recurse-depth($all-imports)/metadata/role ! map:entry(@id,.))?*">
<let var="all-imports" expression="recurse-depth('resolve-profile(doc(resolve-uri(import-profile/@href)))/catalog')"/>
<index id="index-imports-metadata-roles" name="index-imports-metadata-role-id" target="map:merge($all-imports/metadata/role ! map:entry(@id,.))?*">
<formal-name>In-Scope Role Identifiers</formal-name>
<description>An index of role identifiers that are in-scope for the system-securtity-plan model. Roles are collected from imported profiles and catalogs. For a given role @id, a locally declared role takes precedence over a role that is imported, the role that was last imported.</description>
<key-field target="@id"/>
</index>
<index id="index-imports-metadata-location-uuid" name="index-imports-metadata-location-uuid" target="map:merge(recurse-depth($all-imports)/metadata/location ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-location-uuid" name="index-imports-metadata-location-uuid" target="map:merge($all-imports/metadata/location ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-party-uuid" name="index-imports-metadata-party-uuid" target="map:merge(recurse-depth($all-imports)/metadata/party ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-party-uuid" name="index-imports-metadata-party-uuid" target="map:merge($all-imports/metadata/party ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-party-organization-uuid" name="index-imports-metadata-party-organization-uuid" target="map:merge(recurse-depth($all-imports)/metadata/party[@type='organization'] ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-party-organization-uuid" name="index-imports-metadata-party-organization-uuid" target="map:merge($all-imports/metadata/party[@type='organization'] ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-property-uuid" name="index-imports-metadata-property-uuid" target="map:merge(recurse-depth($all-imports)//prop[@uuid] ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-property-uuid" name="index-imports-metadata-property-uuid" target="map:merge($all-imports//prop[@uuid] ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
</constraints>
</context>
<context>
<metapath target="/assessment-plan"/>
<constraints>
<let var="all-imports" expression="'.[import-ssp]/doc(resolve-uri(import-ssp/@href))/system-security-plan|.[import-profile]/resolve-profile(doc(resolve-uri(import-profile/@href)))/catalog'"/>
<index id="index-imports-metadata-role-id" name="index-imports-metadata-role-id" target="map:merge(recurse-depth($all-imports)/metadata/role ! map:entry(@id,.))?*">
<let var="all-imports" expression="recurse-depth('.[import-ssp]/doc(resolve-uri(import-ssp/@href))/system-security-plan|.[import-profile]/resolve-profile(doc(resolve-uri(import-profile/@href)))/catalog')"/>
<index id="index-imports-metadata-role-id" name="index-imports-metadata-role-id" target="map:merge($all-imports/metadata/role ! map:entry(@id,.))?*">
<formal-name>In-Scope Role Identifiers</formal-name>
<description>An index of role identifiers that are in-scope for the assessment-plan model. Roles are collected from imported system-securtity-plans, which in turn includes referenced profiles and catalogs. For a given role @id, a locally declared role takes precedence over a role that is imported, the role that was last imported.</description>
<key-field target="@id"/>
</index>
<index id="index-imports-metadata-location-uuid" name="index-imports-metadata-location-uuid" target="map:merge(recurse-depth($all-imports)/metadata/location ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-location-uuid" name="index-imports-metadata-location-uuid" target="map:merge($all-imports/metadata/location ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-party-uuid" name="index-imports-metadata-party-uuid" target="map:merge(recurse-depth($all-imports)/metadata/party ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-party-uuid" name="index-imports-metadata-party-uuid" target="map:merge($all-imports/metadata/party ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-party-organization-uuid" name="index-imports-metadata-party-organization-uuid" target="map:merge(recurse-depth($all-imports)/metadata/party[@type='organization'] ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-party-organization-uuid" name="index-imports-metadata-party-organization-uuid" target="map:merge($all-imports/metadata/party[@type='organization'] ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-property-uuid" name="index-imports-metadata-property-uuid" target="map:merge(recurse-depth($all-imports)//prop[@uuid] ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-property-uuid" name="index-imports-metadata-property-uuid" target="map:merge($all-imports//prop[@uuid] ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
</constraints>
</context>
<context>
<metapath target="/assessment-results"/>
<constraints>
<let var="all-imports" expression="'.[import-ap]/doc(resolve-uri(import-ap/@href))/assessment-plan|.[import-ssp]/doc(resolve-uri(import-ssp/@href))/system-security-plan|.[import-profile]/resolve-profile(doc(resolve-uri(import-profile/@href)))/catalog'"/>
<index id="index-imports-metadata-role-id" name="index-imports-metadata-role-id" target="map:merge(recurse-depth($all-imports)/metadata/role ! map:entry(@id,.))?*">
<let var="all-imports" expression="recurse-depth('.[import-ap]/doc(resolve-uri(import-ap/@href))/assessment-plan|.[import-ssp]/doc(resolve-uri(import-ssp/@href))/system-security-plan|.[import-profile]/resolve-profile(doc(resolve-uri(import-profile/@href)))/catalog')"/>
<index id="index-imports-metadata-role-id" name="index-imports-metadata-role-id" target="map:merge($all-imports/metadata/role ! map:entry(@id,.))?*">
<formal-name>In-Scope Role Identifiers</formal-name>
<description>An index of role identifiers that are in-scope for the assessment-result model. Roles are collected from imported assessment-plans, which in turn includes referenced system-securtity-plans, which in turn includes referenced profiles and catalogs. For a given role @id, a locally declared role takes precedence over a role that is imported, the role that was last imported.</description>
<key-field target="@id"/>
</index>
<index id="index-imports-metadata-location-uuid" name="index-imports-metadata-location-uuid" target="map:merge(recurse-depth($all-imports)/metadata/location ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-location-uuid" name="index-imports-metadata-location-uuid" target="map:merge($all-imports/metadata/location ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-party-uuid" name="index-imports-metadata-party-uuid" target="map:merge(recurse-depth($all-imports)/metadata/party ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-party-uuid" name="index-imports-metadata-party-uuid" target="map:merge($all-imports/metadata/party ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-party-organization-uuid" name="index-imports-metadata-party-organization-uuid" target="map:merge(recurse-depth($all-imports)/metadata/party[@type='organization'] ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-party-organization-uuid" name="index-imports-metadata-party-organization-uuid" target="map:merge($all-imports/metadata/party[@type='organization'] ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-property-uuid" name="index-imports-metadata-property-uuid" target="map:merge(recurse-depth($all-imports)//prop[@uuid] ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-property-uuid" name="index-imports-metadata-property-uuid" target="map:merge($all-imports//prop[@uuid] ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
</constraints>
</context>
<context>
<metapath target="/plan-of-action-and-milestones"/>
<constraints>
<let var="all-imports" expression="'.[import-ap]/doc(resolve-uri(import-ap/@href))/assessment-plan|.[import-ssp]/doc(resolve-uri(import-ssp/@href))/system-security-plan|.[import-profile]/resolve-profile(doc(resolve-uri(import-profile/@href)))/catalog'"/>
<index id="index-imports-metadata-role-id" name="index-imports-metadata-role-id" target="map:merge(recurse-depth($all-imports)/metadata/role ! map:entry(@id,.))?*">
<let var="all-imports" expression="recurse-depth('.[import-ap]/doc(resolve-uri(import-ap/@href))/assessment-plan|.[import-ssp]/doc(resolve-uri(import-ssp/@href))/system-security-plan|.[import-profile]/resolve-profile(doc(resolve-uri(import-profile/@href)))/catalog')"/>
<index id="index-imports-metadata-role-id" name="index-imports-metadata-role-id" target="map:merge($all-imports/metadata/role ! map:entry(@id,.))?*">
<formal-name>In-Scope Role Identifiers</formal-name>
<description>An index of role identifiers that are in-scope for the plan-of-action-and-milestones model. Roles are collected from imported system-securtity-plans, which in turn includes referenced profiles and catalogs. For a given role @id, a locally declared role takes precedence over a role that is imported, the role that was last imported.</description>
<key-field target="@id"/>
</index>
<index id="index-imports-metadata-location-uuid" name="index-imports-metadata-location-uuid" target="map:merge(recurse-depth($all-imports)/metadata/location ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-location-uuid" name="index-imports-metadata-location-uuid" target="map:merge($all-imports/metadata/location ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-party-uuid" name="index-imports-metadata-party-uuid" target="map:merge(recurse-depth($all-imports)/metadata/party ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-party-uuid" name="index-imports-metadata-party-uuid" target="map:merge($all-imports/metadata/party ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-party-organization-uuid" name="index-imports-metadata-party-organization-uuid" target="map:merge(recurse-depth($all-imports)/metadata/party[@type='organization'] ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-party-organization-uuid" name="index-imports-metadata-party-organization-uuid" target="map:merge($all-imports/metadata/party[@type='organization'] ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
<index id="index-imports-metadata-property-uuid" name="index-imports-metadata-property-uuid" target="map:merge(recurse-depth($all-imports)//prop[@uuid] ! map:entry(@uuid,.))?*">
<index id="index-imports-metadata-property-uuid" name="index-imports-metadata-property-uuid" target="map:merge($all-imports//prop[@uuid] ! map:entry(@uuid,.))?*">
<key-field target="@uuid"/>
</index>
</constraints>
Expand Down

0 comments on commit f45bd7c

Please sign in to comment.