Commit 8bdc634d authored by Bogdan's avatar Bogdan

Cleanup of Schema Mapping to current flatening rules

parent f6840670
...@@ -49,9 +49,9 @@ if __name__ == "__main__": ...@@ -49,9 +49,9 @@ if __name__ == "__main__":
add_use_case(use_case) add_use_case(use_case)
add_user.main(use_case) add_user.main(use_case)
# add_car.main(use_case) add_car.main(use_case)
# add_hash.main(use_case) add_hash.main(use_case)
# add_offer.main(use_case) add_offer.main(use_case)
# add_publication.main(use_case) add_publication.main(use_case)
# add_travel.main(use_case) add_travel.main(use_case)
\ No newline at end of file
...@@ -15,7 +15,7 @@ def add_table(use_case: str, table_name:str): ...@@ -15,7 +15,7 @@ def add_table(use_case: str, table_name:str):
"colour", "colour",
"seats", "seats",
"year", "year",
"ownerID", "ownerId",
"deleted", "deleted",
"state", "state",
"observations" "observations"
...@@ -45,17 +45,16 @@ def add_layers(use_case:str, table_name: str): ...@@ -45,17 +45,16 @@ def add_layers(use_case:str, table_name: str):
"colour", "colour",
"seats", "seats",
"year", "year",
"ownerID", "ownerId",
"deleted", "deleted",
"state" "state"
], ],
"cluster_properties": [ "cluster_properties": [
#TODO discuss with others
"brand", "brand",
"model", "model",
"seats", "seats",
"year", "year",
"ownerID", "ownerId",
"state" "state"
] ]
}, },
...@@ -70,7 +69,7 @@ def add_layers(use_case:str, table_name: str): ...@@ -70,7 +69,7 @@ def add_layers(use_case:str, table_name: str):
"colour", "colour",
"seats", "seats",
"year", "year",
"ownerID", "ownerId",
"deleted", "deleted",
"state" "state"
], ],
...@@ -90,12 +89,11 @@ def add_layers(use_case:str, table_name: str): ...@@ -90,12 +89,11 @@ def add_layers(use_case:str, table_name: str):
"colour", "colour",
"seats", "seats",
"year", "year",
"ownerID", "ownerId",
"deleted", "deleted",
"state" "state"
], ],
"cluster_properties": [ "cluster_properties": [
#TODO discuss with others
"year", "year",
"state" "state"
] ]
...@@ -111,12 +109,11 @@ def add_layers(use_case:str, table_name: str): ...@@ -111,12 +109,11 @@ def add_layers(use_case:str, table_name: str):
"colour", "colour",
"seats", "seats",
"year", "year",
"ownerID", "ownerId",
"deleted", "deleted",
"state" "state"
], ],
"cluster_properties": [ "cluster_properties": [
#TODO discuss with others
"brand", "brand",
"model", "model",
"seats" "seats"
...@@ -128,7 +125,7 @@ def add_layers(use_case:str, table_name: str): ...@@ -128,7 +125,7 @@ def add_layers(use_case:str, table_name: str):
"name": "CarState_layer", "name": "CarState_layer",
"properties": [ "properties": [
"UniqueID", "UniqueID",
"ownerID", "ownerId",
"deleted", "deleted",
"state" "state"
], ],
......
...@@ -16,7 +16,7 @@ def add_table(use_case: str, table_name: str): ...@@ -16,7 +16,7 @@ def add_table(use_case: str, table_name: str):
] ]
columns = { c : c for c in columns } columns = { c : c for c in columns }
columns["UniqueID"] = "id" columns["UniqueID"] = "documents[0]//id"
columns["document1id"] = "documents[0]//id" columns["document1id"] = "documents[0]//id"
columns["document1collection"] = "documents[0]//collection" columns["document1collection"] = "documents[0]//collection"
......
...@@ -29,14 +29,14 @@ def add_table(use_case: str, table_name: str): ...@@ -29,14 +29,14 @@ def add_table(use_case: str, table_name: str):
columns = { c : c for c in columns } columns = { c : c for c in columns }
columns["UniqueID"] = "id" columns["UniqueID"] = "id"
columns["carID"] = "car//_id" columns["carID"] = "car//carLicensePlate"
columns["carOwner"] = "car//ownerID" columns["carOwner"] = "car//ownerId"
##TODO Question: should i get all the data from the car field? or just the car id/owner? ##TODO Question: should i get all the data from the car field? or just the car id/owner?
columns["startLatitude"] = "startPlace//latitude" columns["startLatitude"] = "startPlace//latitude"
columns["startLongitude"] = "startPlace//longitude" columns["startLongitude"] = "startPlace//longitude"
#TODO what if there are more end places? how can i define them? i can only get the first index of the array #TODO what if there are more end places? how can i define them? i can only get the first index of the array
columns["endFirstLatitude"] = "endPlace[0]//latitude" columns["endFirstLatitude"] = "endPlaces[0]//latitude"
columns["endFirstLongitude"] = "endPlace[0]//longitude" columns["endFirstLongitude"] = "endPlaces[0]//longitude"
table = { table = {
"name": table_name, "name": table_name,
......
...@@ -41,19 +41,19 @@ def add_table(use_case: str, table_name: str): ...@@ -41,19 +41,19 @@ def add_table(use_case: str, table_name: str):
columns["user1ID"] = "users[0]//userId" columns["user1ID"] = "users[0]//userId"
columns["user1PassengersNr"] = "users[0]//passengers" columns["user1PassengersNr"] = "users[0]//passengers"
columns["isDriver"] = "users[0]//isDriver" columns["isDriver"] = "users[0]//isDriver"
columns["startPlaceLatitude"] = "startPlace//Latitude" columns["startPlaceLatitude"] = "startPlace//latitude"
columns["startPlaceLongitude"] = "startPlace//Latitude" columns["startPlaceLongitude"] = "startPlace//longitude"
columns["endPlaceLatitude"] = "endPlace//Latitude" columns["endPlaceLatitude"] = "endPlace//latitude"
columns["endPlaceLongitude"] = "endPlace//Longitude" columns["endPlaceLongitude"] = "endPlace//longitude"
#TODO consider only the first sugested place? how to consider multiple #TODO consider only the first sugested place? how to consider multiple
columns["suggestedEndPlace1Latitude"] = "suggestedEndPlaces[0]//endplace//latitude" #columns["suggestedEndPlace1Latitude"] = "suggestedEndPlaces[0]//endplace//latitude"
columns["suggestedEndPlace1Longitude"] = "suggestedEndPlaces[0]//endplace//longitude" #columns["suggestedEndPlace1Longitude"] = "suggestedEndPlaces[0]//endplace//longitude"
columns["endPlace1User"] = "endPlace[0]//user" #columns["finishedBy1User"] = "finishedBy[0]//user"
columns["endPlace1Moment"] = "endPlace[0]//moment" #columns["finishedBy1Moment"] = "finishedBy[0]//moment"
columns["endPlace1Latitude"] = "endPlace[0]//coordinate//latitude" #columns["finishedBy1Latitude"] = "finishedBy[0]//coordinate//latitude"
columns["endPlace1Longitude"] = "endPlace[0]//coordinate//longitude" #columns["finishedBy1Longitude"] = "finishedBy[0]//coordinate//longitude"
columns["score1User"] = "score[0]//user" #columns["score1User"] = "score[0]//user"
columns["score1Rating"] = "score[0]//value" #columns["score1Rating"] = "score[0]//value"
columns["startedBy1StartPlaceLatitude"] = "startedBy[0]//startPlace//latitude" columns["startedBy1StartPlaceLatitude"] = "startedBy[0]//startPlace//latitude"
columns["startedBy1StartPlaceLongitude"] = "startedBy[0]//startPlace//longitude" columns["startedBy1StartPlaceLongitude"] = "startedBy[0]//startPlace//longitude"
columns["startedBy1Moment"] = "startedBy[0]//moment" columns["startedBy1Moment"] = "startedBy[0]//moment"
...@@ -77,8 +77,8 @@ def add_layers(use_case:str, table_name: str): ...@@ -77,8 +77,8 @@ def add_layers(use_case:str, table_name: str):
'UniqueID', 'UniqueID',
'user1ID', 'user1ID',
'isDriver', 'isDriver',
'score1User', #'score1User',
'score1Rating', #'score1Rating',
'startedBy1User' 'startedBy1User'
], ],
"cluster_properties": [ "cluster_properties": [
...@@ -110,7 +110,7 @@ def add_layers(use_case:str, table_name: str): ...@@ -110,7 +110,7 @@ def add_layers(use_case:str, table_name: str):
'UniqueID', 'UniqueID',
'startDate', 'startDate',
'endDate', 'endDate',
'endPlace1Moment', #'finishedBy1Moment',
'startedBy1Moment' 'startedBy1Moment'
], ],
"cluster_properties": [ "cluster_properties": [
...@@ -124,15 +124,15 @@ def add_layers(use_case:str, table_name: str): ...@@ -124,15 +124,15 @@ def add_layers(use_case:str, table_name: str):
"properties": [ "properties": [
'user1ID', 'user1ID',
'UniqueID', 'UniqueID',
'endPlace1Latitude', #'finishedBy1Latitude',
'endPlace1Longitude', #'finishedBy1Longitude',
'kmTraveled', 'kmTraveled',
'startPlaceLatitude', 'startPlaceLatitude',
'startPlaceLongitude', 'startPlaceLongitude',
], ],
"cluster_properties": [ "cluster_properties": [
'endPlace1Latitude', #'finishedBy1Latitude',
'endPlace1Longitude' #'finishedBy1Longitude'
] ]
},{ },{
"use_case": use_case, "use_case": use_case,
...@@ -143,12 +143,12 @@ def add_layers(use_case:str, table_name: str): ...@@ -143,12 +143,12 @@ def add_layers(use_case:str, table_name: str):
'UniqueID', 'UniqueID',
'startDate', 'startDate',
'endDate', 'endDate',
'endPlace1Moment', #'finishedBy1Moment',
'startedBy1Moment' 'startedBy1Moment'
], ],
"cluster_properties": [ "cluster_properties": [
'endDate', 'endDate' #,
'endPlace1Moment' #'finishedBy1Moment'
] ]
},{ },{
"use_case": use_case, "use_case": use_case,
...@@ -180,12 +180,12 @@ def add_layers(use_case:str, table_name: str): ...@@ -180,12 +180,12 @@ def add_layers(use_case:str, table_name: str):
'user1ID', 'user1ID',
'status', 'status',
'score1User', 'score1User',
'score1Rating', #'score1Rating',
'rentForTime' 'rentForTime'
], ],
"cluster_properties": [ "cluster_properties": [
'status', 'status',
'score1Rating', #'score1Rating',
'rentForTime' 'rentForTime'
] ]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment