Skip to content

Commit

Permalink
Partial impletmentation of sql and schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
keegansmith21 committed May 14, 2024
1 parent f05526c commit db2424e
Show file tree
Hide file tree
Showing 27 changed files with 252 additions and 0 deletions.
26 changes: 26 additions & 0 deletions dags/oaebu_workflows/schema/shmp_pilot/generic.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[
{
"mode": "REQUIRED",
"name": "ISBN13",
"type": "STRING",
"description": "13 Digit ISBN of the book."
},
{
"mode": "REQUIRED",
"name": "month",
"type": "DATE",
"description": "Start date for period of analytics info."
},
{
"mode": "REQUIRED",
"name": "value",
"type": "INTEGER",
"description": "Measured value."
},
{
"mode": "REQUIRED",
"name": "release_date",
"type": "DATE",
"description": "The end date of the release month"
}
]
122 changes: 122 additions & 0 deletions dags/oaebu_workflows/schema/shmp_pilot/muse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
[
{
"description": "The id of the book.",
"mode": "NULLABLE",
"name": "ID",
"type": "STRING"
},
{
"description": "Publication year.",
"mode": "NULLABLE",
"name": "YEAR",
"type": "INTEGER"
},
{
"description": "Publication month.",
"mode": "NULLABLE",
"name": "MONTH",
"type": "INTEGER"
},
{
"description": "Resource type.",
"mode": "NULLABLE",
"name": "RESOURCE_TYPE",
"type": "STRING"
},
{
"description": "Resource id.",
"mode": "NULLABLE",
"name": "RESOURCE_ID",
"type": "STRING"
},
{
"description": "ISBN of the book on MUSE.",
"mode": "NULLABLE",
"name": "ISBN",
"type": "STRING"
},
{
"description": "Title of the book.",
"mode": "NULLABLE",
"name": "RESOURCE",
"type": "STRING"
},
{
"description": "URL of the book.",
"mode": "NULLABLE",
"name": "RESOURCE_URL",
"type": "STRING"
},
{
"description": "Date of launch.",
"mode": "NULLABLE",
"name": "RESOURCE_LAUNCH",
"type": "DATE"
},
{
"description": "Author of the book.",
"mode": "NULLABLE",
"name": "AUTHOR",
"type": "STRING"
},
{
"description": "Title of the chapter.",
"mode": "NULLABLE",
"name": "FULLTEXT_TITLE",
"type": "STRING"
},
{
"description": "URL of the chapter.",
"mode": "NULLABLE",
"name": "FULLTEXT_URL",
"type": "STRING"
},
{
"description": "Date of fulltext launch.",
"mode": "NULLABLE",
"name": "FULLTEXT_LAUNCH",
"type": "DATE"
},
{
"description": "Issue.",
"mode": "NULLABLE",
"name": "ISSUE",
"type": "STRING"
},
{
"description": "Format.",
"mode": "NULLABLE",
"name": "FORMAT",
"type": "STRING"
},
{
"description": "Access type.",
"mode": "NULLABLE",
"name": "ACCESS",
"type": "STRING"
},
{
"description": "Country Name.",
"mode": "NULLABLE",
"name": "COUNTRY",
"type": "STRING"
},
{
"description": "Institution name.",
"mode": "NULLABLE",
"name": "INSTITUTION",
"type": "STRING"
},
{
"description": "Number of requests.",
"mode": "NULLABLE",
"name": "REQUESTS",
"type": "INTEGER"
},
{
"mode": "REQUIRED",
"name": "release_date",
"type": "DATE",
"description": "Last day of the release month. Table is partitioned on this column."
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
STRUCT(month.altmetrics.total_downloads) AS altmetrics
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
STRUCT(month.amazon.total_downloads) AS amazon
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
STRUCT(month.amazon_ltd.total_downloads) AS amazon_ltd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
STRUCT(month.internet_archive.total_downloads) AS internet_archive
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
STRUCT(month.scholarcommons_ltd.total_downloads) AS scholarcommons_ltd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
STRUCT(month.scholarspace_downloads.total_downloads) AS scholarspace_downloads
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
STRUCT(month.scholarspace_views.total_downloads) AS scholarspace_views
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
STRUCT(month.sci_open.total_downloads) AS sci_open
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
altmetrics_metrics as (
SELECT
ISBN13,
release_date,
value,
FROM
`{{ altmetrics_table_id }}`
GROUP BY
ISBN13,
release_date
),
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
amazon_metrics as (
SELECT
ISBN13,
release_date,
value,
FROM
`{{ amazon_table_id }}`
GROUP BY
ISBN13,
release_date
),
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
amazon_ltd_metrics as (
SELECT
ISBN13,
release_date,
value,
FROM
`{{ amazon_ltd_table_id }}`
GROUP BY
ISBN13,
release_date
),
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
internet_archive_metrics as (
SELECT
ISBN13,
release_date,
value,
FROM
`{{ internet_archive_table_id }}`
GROUP BY
ISBN13,
release_date
),
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
scholarcommons_ltd_metrics as (
SELECT
ISBN13,
release_date,
value,
FROM
`{{ scholarcommons_ltd_table_id }}`
GROUP BY
ISBN13,
release_date
),
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
scholarspace_downloads_metrics as (
SELECT
ISBN13,
release_date,
value,
FROM
`{{ scholarspace_downloads_table_id }}`
GROUP BY
ISBN13,
release_date
),
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
scholarspace_views_metrics as (
SELECT
ISBN13,
release_date,
value,
FROM
`{{ scholarspace_views_table_id }}`
GROUP BY
ISBN13,
release_date
),
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
altmetrics_metrics as (
SELECT
ISBN13,
release_date,
value,
FROM
`{{ altmetrics_table_id }}`
GROUP BY
ISBN13,
release_date
),
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
month.altmetrics IS NOT NULL
1 change: 1 addition & 0 deletions dags/oaebu_workflows/sql/shmp_pilot/month_null_amazon.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
month.amazon IS NOT NULL
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
month.amazon_ltd IS NOT NULL
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
month.internet_archive IS NOT NULL
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
month.scholarspace_commons_ltd IS NOT NULL
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
month.scholarspace_downloads IS NOT NULL
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
month.scholarspace_views IS NOT NULL
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
month.sci_open IS NOT NULL

0 comments on commit db2424e

Please sign in to comment.