-
Notifications
You must be signed in to change notification settings - Fork 7
Produce interopCSN #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Produce interopCSN #157
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
function interopCSN(csn) { | ||
|
||
for (let dn in csn.definitions) { | ||
let def = csn.definitions[dn]; | ||
replaceAnnos(def); | ||
if (def.kind === "entity") | ||
for (let en in def.elements) { | ||
let el = def.elements[en]; | ||
replaceAnnos(el); | ||
} | ||
} | ||
|
||
csn["csnInteropEffective"] = "1.0"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @stewsk : we would need meta.document.version, I would propose to take it from the data source annotation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wouldn't that be the version of the data product itself rather than the data source? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, it needs to go into There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
In CAP, for a Data Product there always is a service
no There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. true, it is more the version of the data product. We should probably have a sync on the detailed content for the meta section (incl. name + namespace) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. summary of the sync between @stewsk and @swennemers :
for the dpd files, that cut this csn per entity, the name and version must reflect the data source name, namespace and version that is maintained on the entity level. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to expose this at all on CAP level? You'll describe the service in ORD as well and then the ORD information and ORD ID would already contain the information. |
||
return csn; | ||
} | ||
|
||
|
||
function replaceAnnos(o) { | ||
const annoReplacement = { | ||
"@Common.Label": "@EndUserText.label", | ||
"@title": "@EndUserText.label", | ||
}; | ||
|
||
for (const [oldA, newA] of Object.entries(annoReplacement)) { | ||
if (o[oldA]) { | ||
o[newA] ??= o[oldA]; | ||
delete o[oldA]; | ||
} | ||
} | ||
} | ||
|
||
module.exports = { | ||
interopCSN | ||
}; |
Uh oh!
There was an error while loading. Please reload this page.