Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
350bbaa
Workaround for xtravels
BobdenOs Aug 4, 2025
a223f50
Add hybrid profile and Data Sphere export script
BobdenOs Aug 9, 2025
156cdd0
Merged main into cafe
danjoa Aug 12, 2025
b16ebfc
Merge branch 'main' into cafe
danjoa Aug 12, 2025
9cf85e6
Remove unused 'textAspect' symbol from Data Sphere index
danjoa Aug 12, 2025
0ada422
Adopt simple comments
BobdenOs Aug 12, 2025
94a40d7
Merge branch 'main' into cafe
danjoa Aug 12, 2025
f9b432a
.
danjoa Aug 13, 2025
36def81
Switch to generating .env files
BobdenOs Aug 13, 2025
c5b5c2f
version 0.1.2
danjoa Aug 14, 2025
afc2c6b
API readonly
danjoa Aug 14, 2025
71d789c
cleanup
danjoa Aug 14, 2025
cb71c24
.
danjoa Aug 14, 2025
57d84fb
.
danjoa Aug 14, 2025
eb95bdc
rm exported apis
danjoa Aug 14, 2025
a3d549b
add generated apis to .gitignore
danjoa Aug 14, 2025
d2aae4f
-> .cdsrc.yaml
danjoa Aug 15, 2025
e66fd93
Merge branch 'main' into cafe
danjoa Aug 15, 2025
451febb
Added readme
danjoa Aug 17, 2025
662770f
Merge branch 'main' into cafe
danjoa Aug 18, 2025
9553ecf
Merge remote-tracking branch 'origin/main' into cafe
danjoa Aug 21, 2025
7e915bc
Merge branch 'main' into cafe
danjoa Aug 26, 2025
8ded31b
Merge branch 'main' into cafe
danjoa Aug 28, 2025
3e59b85
Restored readme from main
danjoa Aug 29, 2025
e9c01d0
Merge branch 'main' into cafe
danjoa Sep 2, 2025
d36d1f0
named apis
danjoa Sep 3, 2025
2efbb58
Merge branch 'main' into cafe
danjoa Sep 3, 2025
96d62a3
Merge branch 'main' into cafe
danjoa Sep 4, 2025
da5959f
rm .cdsrc.yaml
danjoa Sep 4, 2025
8bdeb03
Merge branch 'main' into cafe
danjoa Sep 4, 2025
9b0d47e
Merge branch 'main' into cafe
danjoa Sep 4, 2025
b2ce706
Merge branch 'main' into cafe
danjoa Sep 4, 2025
2e8be40
Merge branch 'main' into cafe
danjoa Sep 4, 2025
7ebc8a5
Merge branch 'main' into cafe
danjoa Sep 5, 2025
0007187
Merge branch 'main' into cafe
danjoa Sep 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@
_out
gen
node_modules
csn.json
Comment thread
BobdenOs marked this conversation as resolved.
Outdated
datasphere.json
Comment thread
BobdenOs marked this conversation as resolved.
Outdated
default-env.json
Comment thread
BobdenOs marked this conversation as resolved.
Outdated

# added by cds
.cdsrc-private.json
Comment thread
danjoa marked this conversation as resolved.
104 changes: 104 additions & 0 deletions .plugins/datasphere/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
const model = require('../../csn.json')

const textAspect = Symbol('text aspect')

// Remove includes as Data Sphere doesn't support them
for (const name in model.definitions) {
const def = model.definitions[name]
const includes = def.includes
if (!includes) continue
for (const include of includes) {
const i = model.definitions[include]
def.elements = { ...def.elements, ...i.elements }
}
delete def.includes
}

// Inline custom types to simplify managed association removal
for (const name in model.definitions) {
const def = model.definitions[name]
const elements = def.elements
if (!elements) continue
for (const col in elements) {
const element = elements[col]
const customType = model.definitions[element.type]
if (!customType) continue
elements[col] = { ...customType, kind: undefined }
}
}

// Remove managed association as Data Sphere doesn't support them
for (const name in model.definitions) {
const def = model.definitions[name]
const elements = def.elements
if (!elements) continue
for (const col in elements) {
const element = elements[col]

// Data Sphere doesn't know that value.xpr is a thing that is supposed to be supported
if (element.value && element.value.xpr) {
element.xpr = element.value.xpr
delete element.value
}
if (!(element.type in { 'cds.Association': 1, 'cds.Composition': 1 })) continue
if (!element.keys) continue
const keys = element.keys
const on = []
let first = true
for (const k of keys) {
if (first) first = false
else on.push('and')
const foreignKey = `${col}_${k.ref[0]}`
on.push(
{ ref: [col, k.ref[0]] },
'=',
{ ref: [foreignKey] },
)
const target = model.definitions[element.target]
elements[foreignKey] = { ...target.elements[k.ref[0]], key: element.key }
}
delete element.keys
delete element.key
element.on = on
}
}

// Collect all @data.product service to convert to Data Sphere annotation
const dataProductServices = []
for (const name in model.definitions) {
const def = model.definitions[name]
if (def.kind !== 'service' || !def['@data.product']) continue
dataProductServices.push(name)
}

// Just keep entities as Data Sphere doesn't handle the other types
for (const name in model.definitions) {
const def = model.definitions[name]
if (def.kind === 'entity') continue
delete model.definitions[name]
}

// Enhance all the entities with Data Sphere annotations for compatibility
for (const name in model.definitions) {
const def = model.definitions[name]
if (def.kind !== 'entity') continue
delete def['@cds.autoexpose']
delete def['@cds.persistence.skip']
def['@DataWarehouse.consumption.external'] = dataProductServices.some(s => name.startsWith(s))
def['@ObjectModel.modelingPattern'] = { '#': 'DATA_STRUCTURE' }
def['@ObjectModel.supportedCapabilities'] = [{ '#': 'DATA_STRUCTURE' }]
if (def.projection) def['@DataWarehouse.sqlEditor.query'] = `SELECT * FROM "${def.projection.from.ref[0]}"`
}



const fs = require('node:fs')
const path = require('node:path')

const dataSphereString = JSON.stringify(model, null, 2)
.replace(/\.texts"/g, '_texts"')

fs.writeFileSync(
path.resolve(path.dirname(require.resolve('../../csn.json')), 'datasphere.json'),
dataSphereString
)
12 changes: 6 additions & 6 deletions db/data/sap.capire.flights-Airlines.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ID, name , currency_code, icon
GA, Green Albatros , CAD , https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/Green-Albatross-logo.png
FA, Fly Africa , ZAR , https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/Fly-Africa-logo.png
EA, European Airlines, EUR , https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/European-Airlines-logo.png
OC, Oceania , USD , https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/Oceania-logo.png
SW, Sunset Wings , USD , https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/Sunset-Wings-logo.png
ID,name,currency_code,icon
GA,Green Albatros,CAD,https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/Green-Albatross-logo.png
FA,Fly Africa,ZAR,https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/Fly-Africa-logo.png
EA,European Airlines,EUR,https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/European-Airlines-logo.png
OC,Oceania,USD,https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/Oceania-logo.png
SW,Sunset Wings,USD,https://raw.githubusercontent.com/SAP-samples/fiori-elements-opensap/main/week1/images/airlines/Sunset-Wings-logo.png
96 changes: 48 additions & 48 deletions db/data/sap.capire.flights-Airports.csv
Original file line number Diff line number Diff line change
@@ -1,48 +1,48 @@
ID , name , city , country_code
FRA, Frankfurt Airport , Frankfurt/Main , DE
HAM, Hamburg Airport , Hamburg , DE
MUC, Munich Airport , Munich , DE
SXF, Berlin Schönefeld Airport , Berlin , DE
THF, Berlin Tempelhof Airport , Berlin , DE
TXL, Berlin Tegel Airport , Berlin , DE
CDG, Charles de Gaulle Airport , Paris , FR
ORY, Orly Airport , Paris , FR
VIE, Vienna International Airport , Vienna , AT
ZRH, Zürich Airport , Zurich , CH
RTM, Rotterdam The Hague Airport , Rotterdam , NL
FCO, Leonardo da Vinci–Fiumicino Airport , Rome , IT
VCE, Venice Marco Polo Airport , Venice , IT
LCY, London City Airport , London , GB
LGW, Gatwick Airport , London , GB
LHR, Heathrow Airport , London , GB
MAD, Adolfo Suárez Madrid–Barajas Airport , Madrid , ES
VKO, Vnukovo International Airport , Moscow , RU
SVO, Sheremetyevo International Airport , Moscow , RU
JFK, John F. Kennedy International Airport, "New York City, New York" , US
BNA, Nashville International Airport , "Nashville, Tennessee" , US
BOS, Logan International Airport , "Boston, Massachusetts" , US
ELP, El Paso International Airport , "El Paso, Texas" , US
DEN, Denver International Airport , "Denver, Colorado" , US
HOU, William P. Hobby Airport , "Houston, Texas" , US
LAS, McCarran International Airport , "Las Vegas, Nevada" , US
LAX, Los Angeles International Airport , "Los Angeles, California" , US
MCI, Kansas City International Airport , "Kansas City, Missouri" , US
MIA, Miami International Airport , "Miami, Florida" , US
SFO, San Francisco International Airport , "San Francisco, California" , US
EWR, Newark Liberty International Airport , "Newark, New Jersey" , US
YOW, Ottawa Macdonald–Cartier Int. Airport, "Ottawa, Ontario" , CA
ACA, General Juan N. Álvarez Int. Airport , "Acapulco, Guerrero" , MX
GIG, Rio de Janeiro–Galeão Int. Airport , Rio de Janeiro , BR
HAV, José Martí International Airport , Havana , CU
ASP, Alice Springs Airport , "Alice Springs, Northern Territory", AU
ACE, Lanzarote Airport , "Lanzarote, Canary Islands" , ES
HRE, Harare International Airport , Harare , ZW
GCJ, Grand Central Airport , Johannesburg , ZA
NRT, Narita International Airport , "Tokyo, Honshu" , JP
ITM, Osaka International Airport , "Osaka, Honshu" , JP
KIX, Kansai International Airport , "Osaka, Honshu" , JP
HIJ, Hiroshima Airport , "Hiroshima, Honshu" , JP
SIN, Singapore Changi Airport , Singapore , SG
KUL, Kuala Lumpur International Airport , Kuala Lumpur , MY
HKG, Hong Kong International Airport , Hongkong , CN
BKK, Suvarnabhumi Airport , Bangkok , TH
ID,name,city,country_code
FRA,Frankfurt Airport,Frankfurt/Main,DE
HAM,Hamburg Airport,Hamburg,DE
MUC,Munich Airport,Munich,DE
SXF,Berlin Schönefeld Airport,Berlin,DE
THF,Berlin Tempelhof Airport,Berlin,DE
TXL,Berlin Tegel Airport,Berlin,DE
CDG,Charles de Gaulle Airport,Paris,FR
ORY,Orly Airport,Paris,FR
VIE,Vienna International Airport,Vienna,AT
ZRH,Zürich Airport,Zurich,CH
RTM,Rotterdam The Hague Airport,Rotterdam,NL
FCO,Leonardo da Vinci–Fiumicino Airport,Rome,IT
VCE,Venice Marco Polo Airport,Venice,IT
LCY,London City Airport,London,GB
LGW,Gatwick Airport,London,GB
LHR,Heathrow Airport,London,GB
MAD,Adolfo Suárez Madrid–Barajas Airport,Madrid,ES
VKO,Vnukovo International Airport,Moscow,RU
SVO,Sheremetyevo International Airport,Moscow,RU
JFK,John F. Kennedy International Airport,"New York City,New York",US
BNA,Nashville International Airport,"Nashville,Tennessee",US
BOS,Logan International Airport,"Boston,Massachusetts",US
ELP,El Paso International Airport,"El Paso,Texas",US
DEN,Denver International Airport,"Denver,Colorado",US
HOU,William P. Hobby Airport,"Houston,Texas",US
LAS,McCarran International Airport,"Las Vegas,Nevada",US
LAX,Los Angeles International Airport,"Los Angeles,California",US
MCI,Kansas City International Airport,"Kansas City,Missouri",US
MIA,Miami International Airport,"Miami,Florida",US
SFO,San Francisco International Airport,"San Francisco,California",US
EWR,Newark Liberty International Airport,"Newark,New Jersey",US
YOW,Ottawa Macdonald–Cartier Int. Airport,"Ottawa,Ontario",CA
ACA,General Juan N. Álvarez Int. Airport,"Acapulco,Guerrero",MX
GIG,Rio de Janeiro–Galeão Int. Airport,Rio de Janeiro,BR
HAV,José Martí International Airport,Havana,CU
ASP,Alice Springs Airport,"Alice Springs,Northern Territory",AU
ACE,Lanzarote Airport,"Lanzarote,Canary Islands",ES
HRE,Harare International Airport,Harare,ZW
GCJ,Grand Central Airport,Johannesburg,ZA
NRT,Narita International Airport,"Tokyo,Honshu",JP
ITM,Osaka International Airport,"Osaka,Honshu",JP
KIX,Kansai International Airport,"Osaka,Honshu",JP
HIJ,Hiroshima Airport,"Hiroshima,Honshu",JP
SIN,Singapore Changi Airport,Singapore,SG
KUL,Kuala Lumpur International Airport,Kuala Lumpur,MY
HKG,Hong Kong International Airport,Hongkong,CN
BKK,Suvarnabhumi Airport,Bangkok,TH
100 changes: 50 additions & 50 deletions db/data/sap.capire.flights-Supplements.csv
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
ID , price, type_code, descr , currency_code
BV-0001, 2.30, BV , Hot Chocolate , EUR
BV-0002, 7.50, BV , Alcohol free Champagne , EUR
BV-0003, 3.50, BV , Coke , EUR
BV-0004, 3.50, BV , Orange Lemonade , EUR
BV-0005, 3.50, BV , Apple Juice , EUR
BV-0006, 3.50, BV , Pear Juice , EUR
BV-0007, 3.50, BV , Mango Juice , EUR
BV-0008, 3.50, BV , Lemon Lemonade , EUR
BV-0009, 4.50, BV , Tomato Juice , EUR
ML-0001, 3.00, ML , Black Forest Cake , EUR
ML-0002, 2.00, ML , Chocolate Cake , EUR
ML-0003, 1.50, ML , Apple Pie , EUR
ML-0004, 1.50, ML , Pear Pie , EUR
ML-0005, 8.00, ML , Nice Salad , EUR
ML-0006, 9.00, ML , Paris Salad , EUR
ML-0007, 12.00, ML , Hamburg Salad with Eggs , EUR
ML-0008, 25.00, ML , Quail with French Salad and Black Forest Cake, EUR
ML-0009, 13.00, ML , Duck on Lettuce , EUR
ML-0010, 5.00, ML , Carpaccio , EUR
ML-0011, 7.00, ML , Seasonal Salad , EUR
ML-0012, 16.00, ML , Hamburg Salad with Fresh Shrimps , EUR
ML-0013, 17.00, ML , Quail , EUR
ML-0014, 14.00, ML , Wiener Schnitzel , EUR
ML-0015, 13.00, ML , Pork Schnitzel , EUR
ML-0016, 14.00, ML , Schnitzel with Pepper Sauce , EUR
ML-0017, 11.00, ML , Chicken and French Fries , EUR
ML-0018, 12.00, ML , Turkey Steak , EUR
ML-0019, 15.00, ML , Bavarian Duck , EUR
ML-0020, 14.00, ML , Knuckle of Pork , EUR
ML-0021, 22.00, ML , Fillet of Beef , EUR
ML-0022, 21.00, ML , Trout Au Bleu , EUR
ML-0023, 20.00, ML , Trout Meuniere , EUR
ML-0024, 17.00, ML , Monkfish , EUR
ML-0025, 12.00, ML , Sole , EUR
ML-0026, 6.00, ML , Mini Fried Sole , EUR
ML-0027, 14.00, ML , Salmon in a Bearnaise Sauce , EUR
ML-0028, 15.00, ML , Salmon Lasagne , EUR
ML-0029, 3.00, ML , Chocolate Ice Cream , EUR
ML-0030, 2.50, ML , Vanilla Ice Cream , EUR
ML-0031, 4.50, ML , Vanilla Ice Cream with Hot Cherries , EUR
ML-0032, 4.50, ML , Vanilla Ice Cream with Hot Raspberries , EUR
ML-0033, 4.00, ML , Apple Strudel , EUR
ML-0034, 4.00, ML , Raspberry Sorbet , EUR
ML-0035, 4.00, ML , Strawberry Sorbet , EUR
ML-0036, 4.00, ML , Lemon Sorbet , EUR
LU-0001, 40.00, LU , Extra baggage 5 kgs , EUR
LU-0002, 15.00, LU , Luggage transfer from airport to hotel , EUR
LU-0003, 75.00, LU , Luggage pickup from home and return , EUR
LU-0004, 80.00, LU , Bulky goods like sports equipment , EUR
ID,price,type_code,descr,currency_code
BV-0001,2.30,BV,Hot Chocolate,EUR
BV-0002,7.50,BV,Alcohol free Champagne,EUR
BV-0003,3.50,BV,Coke,EUR
BV-0004,3.50,BV,Orange Lemonade,EUR
BV-0005,3.50,BV,Apple Juice,EUR
BV-0006,3.50,BV,Pear Juice,EUR
BV-0007,3.50,BV,Mango Juice,EUR
BV-0008,3.50,BV,Lemon Lemonade,EUR
BV-0009,4.50,BV,Tomato Juice,EUR
ML-0001,3.00,ML,Black Forest Cake,EUR
ML-0002,2.00,ML,Chocolate Cake,EUR
ML-0003,1.50,ML,Apple Pie,EUR
ML-0004,1.50,ML,Pear Pie,EUR
ML-0005,8.00,ML,Nice Salad,EUR
ML-0006,9.00,ML,Paris Salad,EUR
ML-0007,12.00,ML,Hamburg Salad with Eggs,EUR
ML-0008,25.00,ML,Quail with French Salad and Black Forest Cake,EUR
ML-0009,13.00,ML,Duck on Lettuce,EUR
ML-0010,5.00,ML,Carpaccio,EUR
ML-0011,7.00,ML,Seasonal Salad,EUR
ML-0012,16.00,ML,Hamburg Salad with Fresh Shrimps,EUR
ML-0013,17.00,ML,Quail,EUR
ML-0014,14.00,ML,Wiener Schnitzel,EUR
ML-0015,13.00,ML,Pork Schnitzel,EUR
ML-0016,14.00,ML,Schnitzel with Pepper Sauce,EUR
ML-0017,11.00,ML,Chicken and French Fries,EUR
ML-0018,12.00,ML,Turkey Steak,EUR
ML-0019,15.00,ML,Bavarian Duck,EUR
ML-0020,14.00,ML,Knuckle of Pork,EUR
ML-0021,22.00,ML,Fillet of Beef,EUR
ML-0022,21.00,ML,Trout Au Bleu,EUR
ML-0023,20.00,ML,Trout Meuniere,EUR
ML-0024,17.00,ML,Monkfish,EUR
ML-0025,12.00,ML,Sole,EUR
ML-0026,6.00,ML,Mini Fried Sole,EUR
ML-0027,14.00,ML,Salmon in a Bearnaise Sauce,EUR
ML-0028,15.00,ML,Salmon Lasagne,EUR
ML-0029,3.00,ML,Chocolate Ice Cream,EUR
ML-0030,2.50,ML,Vanilla Ice Cream,EUR
ML-0031,4.50,ML,Vanilla Ice Cream with Hot Cherries,EUR
ML-0032,4.50,ML,Vanilla Ice Cream with Hot Raspberries,EUR
ML-0033,4.00,ML,Apple Strudel,EUR
ML-0034,4.00,ML,Raspberry Sorbet,EUR
ML-0035,4.00,ML,Strawberry Sorbet,EUR
ML-0036,4.00,ML,Lemon Sorbet,EUR
LU-0001,40.00,LU,Extra baggage 5 kgs,EUR
LU-0002,15.00,LU,Luggage transfer from airport to hotel,EUR
LU-0003,75.00,LU,Luggage pickup from home and return,EUR
LU-0004,80.00,LU,Bulky goods like sports equipment,EUR
Loading