Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
SMART
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
3
Issues
3
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UNI-KLU
SMART
Commits
8bdc634d
Commit
8bdc634d
authored
Oct 13, 2020
by
Bogdan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup of Schema Mapping to current flatening rules
parent
f6840670
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
41 additions
and
44 deletions
+41
-44
add_carsharing_schema.py
...add_use_case_scripts/car_sharing/add_carsharing_schema.py
+5
-5
add_car.py
...e/app/_add_use_case_scripts/car_sharing/tables/add_car.py
+7
-10
add_hash.py
.../app/_add_use_case_scripts/car_sharing/tables/add_hash.py
+1
-1
add_offer.py
...app/_add_use_case_scripts/car_sharing/tables/add_offer.py
+4
-4
add_travel.py
...pp/_add_use_case_scripts/car_sharing/tables/add_travel.py
+24
-24
No files found.
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing/add_carsharing_schema.py
View file @
8bdc634d
...
...
@@ -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
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing/tables/add_car.py
View file @
8bdc634d
...
...
@@ -15,7 +15,7 @@ def add_table(use_case: str, table_name:str):
"colour"
,
"seats"
,
"year"
,
"ownerI
D
"
,
"ownerI
d
"
,
"deleted"
,
"state"
,
"observations"
...
...
@@ -45,17 +45,16 @@ def add_layers(use_case:str, table_name: str):
"colour"
,
"seats"
,
"year"
,
"ownerI
D
"
,
"ownerI
d
"
,
"deleted"
,
"state"
],
"cluster_properties"
:
[
#TODO discuss with others
"brand"
,
"model"
,
"seats"
,
"year"
,
"ownerI
D
"
,
"ownerI
d
"
,
"state"
]
},
...
...
@@ -70,7 +69,7 @@ def add_layers(use_case:str, table_name: str):
"colour"
,
"seats"
,
"year"
,
"ownerI
D
"
,
"ownerI
d
"
,
"deleted"
,
"state"
],
...
...
@@ -90,12 +89,11 @@ def add_layers(use_case:str, table_name: str):
"colour"
,
"seats"
,
"year"
,
"ownerI
D
"
,
"ownerI
d
"
,
"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"
,
"ownerI
D
"
,
"ownerI
d
"
,
"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"
,
"ownerI
D
"
,
"ownerI
d
"
,
"deleted"
,
"state"
],
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing/tables/add_hash.py
View file @
8bdc634d
...
...
@@ -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"
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing/tables/add_offer.py
View file @
8bdc634d
...
...
@@ -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//ownerI
D
"
columns
[
"carID"
]
=
"car//
carLicensePlate
"
columns
[
"carOwner"
]
=
"car//ownerI
d
"
##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"
]
=
"endPlace
s
[0]//latitude"
columns
[
"endFirstLongitude"
]
=
"endPlace
s
[0]//longitude"
table
=
{
"name"
:
table_name
,
...
...
src/participation-hub/business-logic-microservice/app/_add_use_case_scripts/car_sharing/tables/add_travel.py
View file @
8bdc634d
...
...
@@ -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//
L
atitude"
columns
[
"startPlaceLongitude"
]
=
"startPlace//
Lat
itude"
columns
[
"endPlaceLatitude"
]
=
"endPlace//
L
atitude"
columns
[
"endPlaceLongitude"
]
=
"endPlace//
L
ongitude"
columns
[
"startPlaceLatitude"
]
=
"startPlace//
l
atitude"
columns
[
"startPlaceLongitude"
]
=
"startPlace//
long
itude"
columns
[
"endPlaceLatitude"
]
=
"endPlace//
l
atitude"
columns
[
"endPlaceLongitude"
]
=
"endPlace//
l
ongitude"
#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'
,
'endPlace
1Moment'
,
#'finishedBy
1Moment',
'startedBy1Moment'
],
"cluster_properties"
:
[
...
...
@@ -124,15 +124,15 @@ def add_layers(use_case:str, table_name: str):
"properties"
:
[
'user1ID'
,
'UniqueID'
,
'endPlace
1Latitude'
,
'endPlace
1Longitude'
,
#'finishedBy
1Latitude',
#'finishedBy
1Longitude',
'kmTraveled'
,
'startPlaceLatitude'
,
'startPlaceLongitude'
,
],
"cluster_properties"
:
[
'endPlace
1Latitude'
,
'endPlace
1Longitude'
#'finishedBy
1Latitude',
#'finishedBy
1Longitude'
]
},{
"use_case"
:
use_case
,
...
...
@@ -143,12 +143,12 @@ def add_layers(use_case:str, table_name: str):
'UniqueID'
,
'startDate'
,
'endDate'
,
'endPlace
1Moment'
,
#'finishedBy
1Moment',
'startedBy1Moment'
],
"cluster_properties"
:
[
'endDate'
,
'endPlace
1Moment'
'endDate'
#
,
#'finishedBy
1Moment'
]
},{
"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'
]
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment