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__":
add_use_case(use_case)
add_user.main(use_case)
# add_car.main(use_case)
# add_hash.main(use_case)
# add_offer.main(use_case)
# add_publication.main(use_case)
# add_travel.main(use_case)
add_car.main(use_case)
add_hash.main(use_case)
add_offer.main(use_case)
add_publication.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):
"colour",
"seats",
"year",
"ownerID",
"ownerId",
"deleted",
"state",
"observations"
......@@ -45,17 +45,16 @@ def add_layers(use_case:str, table_name: str):
"colour",
"seats",
"year",
"ownerID",
"ownerId",
"deleted",
"state"
],
"cluster_properties": [
#TODO discuss with others
"brand",
"model",
"seats",
"year",
"ownerID",
"ownerId",
"state"
]
},
......@@ -70,7 +69,7 @@ def add_layers(use_case:str, table_name: str):
"colour",
"seats",
"year",
"ownerID",
"ownerId",
"deleted",
"state"
],
......@@ -90,12 +89,11 @@ def add_layers(use_case:str, table_name: str):
"colour",
"seats",
"year",
"ownerID",
"ownerId",
"deleted",
"state"
],
"cluster_properties": [
#TODO discuss with others
"year",
"state"
]
......@@ -111,12 +109,11 @@ def add_layers(use_case:str, table_name: str):
"colour",
"seats",
"year",
"ownerID",
"ownerId",
"deleted",
"state"
],
"cluster_properties": [
#TODO discuss with others
"brand",
"model",
"seats"
......@@ -128,7 +125,7 @@ def add_layers(use_case:str, table_name: str):
"name": "CarState_layer",
"properties": [
"UniqueID",
"ownerID",
"ownerId",
"deleted",
"state"
],
......
......@@ -16,7 +16,7 @@ def add_table(use_case: str, table_name: str):
]
columns = { c : c for c in columns }
columns["UniqueID"] = "id"
columns["UniqueID"] = "documents[0]//id"
columns["document1id"] = "documents[0]//id"
columns["document1collection"] = "documents[0]//collection"
......
......@@ -29,14 +29,14 @@ def add_table(use_case: str, table_name: str):
columns = { c : c for c in columns }
columns["UniqueID"] = "id"
columns["carID"] = "car//_id"
columns["carOwner"] = "car//ownerID"
columns["carID"] = "car//carLicensePlate"
columns["carOwner"] = "car//ownerId"
##TODO Question: should i get all the data from the car field? or just the car id/owner?
columns["startLatitude"] = "startPlace//latitude"
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
columns["endFirstLatitude"] = "endPlace[0]//latitude"
columns["endFirstLongitude"] = "endPlace[0]//longitude"
columns["endFirstLatitude"] = "endPlaces[0]//latitude"
columns["endFirstLongitude"] = "endPlaces[0]//longitude"
table = {
"name": table_name,
......
......@@ -41,19 +41,19 @@ def add_table(use_case: str, table_name: str):
columns["user1ID"] = "users[0]//userId"
columns["user1PassengersNr"] = "users[0]//passengers"
columns["isDriver"] = "users[0]//isDriver"
columns["startPlaceLatitude"] = "startPlace//Latitude"
columns["startPlaceLongitude"] = "startPlace//Latitude"
columns["endPlaceLatitude"] = "endPlace//Latitude"
columns["endPlaceLongitude"] = "endPlace//Longitude"
columns["startPlaceLatitude"] = "startPlace//latitude"
columns["startPlaceLongitude"] = "startPlace//longitude"
columns["endPlaceLatitude"] = "endPlace//latitude"
columns["endPlaceLongitude"] = "endPlace//longitude"
#TODO consider only the first sugested place? how to consider multiple
columns["suggestedEndPlace1Latitude"] = "suggestedEndPlaces[0]//endplace//latitude"
columns["suggestedEndPlace1Longitude"] = "suggestedEndPlaces[0]//endplace//longitude"
columns["endPlace1User"] = "endPlace[0]//user"
columns["endPlace1Moment"] = "endPlace[0]//moment"
columns["endPlace1Latitude"] = "endPlace[0]//coordinate//latitude"
columns["endPlace1Longitude"] = "endPlace[0]//coordinate//longitude"
columns["score1User"] = "score[0]//user"
columns["score1Rating"] = "score[0]//value"
#columns["suggestedEndPlace1Latitude"] = "suggestedEndPlaces[0]//endplace//latitude"
#columns["suggestedEndPlace1Longitude"] = "suggestedEndPlaces[0]//endplace//longitude"
#columns["finishedBy1User"] = "finishedBy[0]//user"
#columns["finishedBy1Moment"] = "finishedBy[0]//moment"
#columns["finishedBy1Latitude"] = "finishedBy[0]//coordinate//latitude"
#columns["finishedBy1Longitude"] = "finishedBy[0]//coordinate//longitude"
#columns["score1User"] = "score[0]//user"
#columns["score1Rating"] = "score[0]//value"
columns["startedBy1StartPlaceLatitude"] = "startedBy[0]//startPlace//latitude"
columns["startedBy1StartPlaceLongitude"] = "startedBy[0]//startPlace//longitude"
columns["startedBy1Moment"] = "startedBy[0]//moment"
......@@ -77,8 +77,8 @@ def add_layers(use_case:str, table_name: str):
'UniqueID',
'user1ID',
'isDriver',
'score1User',
'score1Rating',
#'score1User',
#'score1Rating',
'startedBy1User'
],
"cluster_properties": [
......@@ -110,7 +110,7 @@ def add_layers(use_case:str, table_name: str):
'UniqueID',
'startDate',
'endDate',
'endPlace1Moment',
#'finishedBy1Moment',
'startedBy1Moment'
],
"cluster_properties": [
......@@ -124,15 +124,15 @@ def add_layers(use_case:str, table_name: str):
"properties": [
'user1ID',
'UniqueID',
'endPlace1Latitude',
'endPlace1Longitude',
#'finishedBy1Latitude',
#'finishedBy1Longitude',
'kmTraveled',
'startPlaceLatitude',
'startPlaceLongitude',
],
"cluster_properties": [
'endPlace1Latitude',
'endPlace1Longitude'
#'finishedBy1Latitude',
#'finishedBy1Longitude'
]
},{
"use_case": use_case,
......@@ -143,12 +143,12 @@ def add_layers(use_case:str, table_name: str):
'UniqueID',
'startDate',
'endDate',
'endPlace1Moment',
#'finishedBy1Moment',
'startedBy1Moment'
],
"cluster_properties": [
'endDate',
'endPlace1Moment'
'endDate' #,
#'finishedBy1Moment'
]
},{
"use_case": use_case,
......@@ -180,12 +180,12 @@ def add_layers(use_case:str, table_name: str):
'user1ID',
'status',
'score1User',
'score1Rating',
#'score1Rating',
'rentForTime'
],
"cluster_properties": [
'status',
'score1Rating',
#'score1Rating',
'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