Config file and change of folder structure
This commit is contained in:
parent
667dc7d68d
commit
bc9e2d06ac
4 changed files with 27 additions and 27 deletions
19
config/config.R
Normal file
19
config/config.R
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
###### Konfiguration für das Projekt ######
|
||||||
|
|
||||||
|
|
||||||
|
#Pfade
|
||||||
|
PFAD_EXCEL <- "data/Input/"
|
||||||
|
PFAD_OUT <- "data/Output/"
|
||||||
|
PFAD_DB_OUT <- "data/Database/"
|
||||||
|
|
||||||
|
#Datei in der ersetzt werden soll
|
||||||
|
FILENAME_EXCEL <- "GC3D_Limits_ref.xlsx"
|
||||||
|
|
||||||
|
#Spaltennummer in denen ersetzt werden soll im Excel
|
||||||
|
SPALTEN <- c(2, 3, 4, 5, 6)
|
||||||
|
|
||||||
|
#Spaltennummer mit der verglichen wird aus Datenbank (citations)
|
||||||
|
INHALTE_DB <- 3
|
||||||
|
|
||||||
|
#Spaltennummer der Inhalte die eingesetzt werden soll (uris)
|
||||||
|
ID <- 1
|
||||||
|
|
@ -8,30 +8,9 @@ library("stringr")
|
||||||
library("tictoc")
|
library("tictoc")
|
||||||
library("rlang")
|
library("rlang")
|
||||||
|
|
||||||
source("../sparql.R")
|
|
||||||
|
|
||||||
###### Konfiguration #########
|
|
||||||
|
|
||||||
#Arbeitsverzeichnis
|
|
||||||
setwd("C:/Users/linchr/ownCloud/GIT/URI_Replacement")
|
|
||||||
|
|
||||||
#Funktionen einbinden
|
#Funktionen einbinden
|
||||||
source("sparql.R")
|
source("sparql.R")
|
||||||
|
source("config/config.R")
|
||||||
#Datei in der ersetzt werden soll
|
|
||||||
FILENAME_EXCEL <- "GC3D_Limits_ref.xlsx"
|
|
||||||
PFAD_EXCEL <- "data/"
|
|
||||||
|
|
||||||
#Spaltennummer in denen ersetzt werden soll im Excel
|
|
||||||
SPALTEN <- c(2, 3, 4, 5, 6)
|
|
||||||
|
|
||||||
#Spaltennummer mit der verglichen wird aus Datenbank (citations)
|
|
||||||
INHALTE_DB <- 3
|
|
||||||
|
|
||||||
#Spaltennummer der Inhalte die eingesetzt werden soll (uris)
|
|
||||||
ID <- 1
|
|
||||||
|
|
||||||
##############################
|
|
||||||
|
|
||||||
|
|
||||||
### Einlesen ###
|
### Einlesen ###
|
||||||
|
|
@ -43,7 +22,6 @@ to_replace_done <- to_replace_original
|
||||||
###
|
###
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#Schleife über den Spaltenvektor aus der Excel
|
#Schleife über den Spaltenvektor aus der Excel
|
||||||
for (spalte_excel in SPALTEN[1]:SPALTEN[length(SPALTEN)]) {
|
for (spalte_excel in SPALTEN[1]:SPALTEN[length(SPALTEN)]) {
|
||||||
|
|
||||||
|
|
@ -112,6 +90,6 @@ for (spalte_excel in SPALTEN[1]:SPALTEN[length(SPALTEN)]) {
|
||||||
|
|
||||||
toc()
|
toc()
|
||||||
|
|
||||||
pfad_output <- paste(PFAD_EXCEL, "replaced_" , FILENAME_EXCEL, sep="")
|
pfad_output <- paste(PFAD_OUT, "replaced_", format(Sys.time(), "%Y_%m_%d_%H%M%S"), FILENAME_EXCEL, sep="")
|
||||||
write_xlsx(to_replace_done, pfad_output)
|
write_xlsx(to_replace_done, pfad_output)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ library("writexl")
|
||||||
library("tidyverse")
|
library("tidyverse")
|
||||||
library("xlsx")
|
library("xlsx")
|
||||||
|
|
||||||
setwd("C:/Users/linchr/ownCloud/GIT/URI_Replacement")
|
|
||||||
|
|
||||||
pfad <- "data/Input/"
|
pfad <- "data/Input/"
|
||||||
|
|
||||||
|
|
|
||||||
7
sparql.R
7
sparql.R
|
|
@ -1,6 +1,9 @@
|
||||||
library("SPARQL")
|
library("SPARQL")
|
||||||
library("stringi")
|
library("stringi")
|
||||||
|
|
||||||
|
### Konfiguration einbinden
|
||||||
|
source("config/config.R")
|
||||||
|
|
||||||
### Gets the bibliographicCitations which are currently in the db ##################
|
### Gets the bibliographicCitations which are currently in the db ##################
|
||||||
|
|
||||||
read_current_geoera_lit_db <- function() {
|
read_current_geoera_lit_db <- function() {
|
||||||
|
|
@ -32,7 +35,7 @@ for (j in 1:length (inDB[1, ])) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pfad <- paste("data/inDB-", format(Sys.Date(), "%Y_%m_%d"), ".xlsx", sep="")
|
pfad <- paste(PFAD_DB_OUT, "inDB-", format(Sys.Date(), "%Y_%m_%d"), ".xlsx", sep="")
|
||||||
|
|
||||||
write_xlsx(inDB, pfad)
|
write_xlsx(inDB, pfad)
|
||||||
|
|
||||||
|
|
@ -41,7 +44,7 @@ write_xlsx(inDB, pfad)
|
||||||
|
|
||||||
get_current_geoera_lit_db <- function() {
|
get_current_geoera_lit_db <- function() {
|
||||||
|
|
||||||
pfad <- paste("data/inDB-", format(Sys.Date(), "%Y_%m_%d"), ".xlsx", sep="")
|
pfad <- paste(PFAD_DB_OUT, "inDB-", format(Sys.Date(), "%Y_%m_%d"), ".xlsx", sep="")
|
||||||
|
|
||||||
if (file.exists(pfad)) {
|
if (file.exists(pfad)) {
|
||||||
inDB <- read_excel(pfad)
|
inDB <- read_excel(pfad)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue