Skip to content

Commit

Permalink
PICA: general changes #163
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Jun 2, 2023
1 parent 66dc6db commit 1a5b616
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 19 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ RUN apt-get update \
r-cran-stringr \
r-cran-gridextra \
r-cran-rsqlite \
r-cran-httr \
sqlite3 \
less \
&& rm -rf /var/lib/apt/lists/*
Expand Down
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ sudo apt-get install openjdk-11-jre-headless
# Install R
sudo apt-get install r-base
# Install R packages from ppa:marutter
sudo apt-get install r-cran-tidyverse r-cran-stringr r-cran-gridextra
sudo apt-get install r-cran-tidyverse r-cran-stringr r-cran-gridextra r-cran-httr
# Install sqlite3
sudo apt-get install sqlite3 r-cran-rsqlite
# Install PHP
Expand Down
2 changes: 1 addition & 1 deletion scripts/sqlite/calculate-aggregated-numbers.grouped.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ log "calculate numbers"
# ${OUTPUT_DIR}/issue-grouped-types.csv
# ${OUTPUT_DIR}/issue-grouped-categories.csv
# ${OUTPUT_DIR}/issue-grouped-paths.csv
Rscript scripts/sqlite/qa_catalogue.groupping.R ${OUTPUT_DIR} $SOLR_CORE
Rscript scripts/sqlite/qa_catalogue.grouping.R ${OUTPUT_DIR} $SOLR_CORE

log "import issue_grouped_types"
tail -n +2 ${OUTPUT_DIR}/issue-grouped-types.csv > ${OUTPUT_DIR}/issue-grouped-types-noheader.csv
Expand Down
37 changes: 21 additions & 16 deletions scripts/sqlite/qa_catalogue.grouped.sqlite.sql
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,28 @@ CREATE TABLE IF NOT EXISTS "id_groupid" (
"id" TEXT,
"groupId" INTEGER
);
CREATE TABLE IF NOT EXISTS "issue_group_types" (
"groupId" INTEGER,
"typeId" INTEGER,
"records" INTEGER,
"instances" INTEGER
DROP TABLE IF EXISTS issue_grouped_types;
CREATE TABLE issue_grouped_types (
"groupId" INTEGER,
"typeId" INTEGER,
"record_nr" INTEGER,
"instance_nr" INTEGER
);
CREATE TABLE IF NOT EXISTS "issue_group_categories" (
"groupId" INTEGER,
"categoryId" INTEGER,
"records" INTEGER,
"instances" INTEGER

DROP TABLE IF EXISTS issue_grouped_categories;
CREATE TABLE issue_grouped_categories (
"groupId" INTEGER,
"categoryId" INTEGER,
"record_nr" INTEGER,
"instance_nr" INTEGER
);
CREATE TABLE IF NOT EXISTS "issue_group_paths" (
"groupId" INTEGER,
"typeId" INTEGER,
"path" TEXT,
"records" INTEGER,
"instances" INTEGER

DROP TABLE IF EXISTS issue_grouped_paths;
CREATE TABLE issue_grouped_paths (
"groupId" INTEGER,
"typeId" INTEGER,
"path" VARCHAR(50),
"record_nr" INTEGER,
"instance_nr" INTEGER
);
COMMIT;
1 change: 0 additions & 1 deletion scripts/sqlite/qa_catalogue.grouping.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ for (i in 1:len) {
instances = instances)
}
}

}

file <- sprintf('%s/%s', OUTPUT_DIR, 'issue-grouped-types.csv')
Expand Down

0 comments on commit 1a5b616

Please sign in to comment.