Skip to content

Commit

Permalink
new data options in 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
michalovadek committed Mar 31, 2022
1 parent 5ff663e commit ba1b473
Show file tree
Hide file tree
Showing 20 changed files with 4,901 additions and 1,230 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Major changes

- `elx_fetch_data(type = "notice", notice = c("tree","branch", "object"))` now mirrors the behaviour of `elx_download_xml()` but instead of saving to path givess access to XML notice in R
- retrieve data on the Judge-Rapporteur, Advocate-General, court formation and court-curated scholarship using new `include_` options in `elx_make_query()`

## Minor changes

Expand Down
60 changes: 58 additions & 2 deletions R/elx_make_query.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#' @param include_citations If `TRUE`, results include citations (CELEX-labelled)
#' @param include_court_procedure If `TRUE`, results include type of court procedure and outcome
#' @param include_ecli If `TRUE`, results include the ECLI identifier for court documents
#' @param include_advocate_general If `TRUE`, results include the Advocate General
#' @param include_judge_rapporteur If `TRUE`, results include the Judge-Rapporteur
#' @param include_court_formation If `TRUE`, results include the court formation
#' @param include_court_scholarship If `TRUE`, results include court-curated relevant scholarship
#' @param include_directory If `TRUE`, results include the Eur-Lex directory code
#' @param include_sector If `TRUE`, results include the Eur-Lex sector code
#' @param order Order results by ids
Expand All @@ -45,7 +49,9 @@ elx_make_query <- function(resource_type = c("any","directive","regulation","dec
include_force = FALSE, include_eurovoc = FALSE, include_author = FALSE,
include_citations = FALSE, include_court_procedure = FALSE,
include_directory = FALSE, include_sector = FALSE,
include_ecli = FALSE,
include_ecli = FALSE, include_judge_rapporteur = FALSE,
include_advocate_general = FALSE, include_court_formation = FALSE,
include_court_scholarship = FALSE,
order = FALSE, limit = NULL){

if (missing(resource_type)) stop("'resource_type' must be defined")
Expand Down Expand Up @@ -169,6 +175,30 @@ elx_make_query <- function(resource_type = c("any","directive","regulation","dec
query <- paste(query, "?sector", sep = " ")

}

if (include_advocate_general == TRUE){

query <- paste(query, "?ag", sep = " ")

}

if (include_judge_rapporteur == TRUE){

query <- paste(query, "?jr", sep = " ")

}

if (include_court_formation == TRUE){

query <- paste(query, "?cf", sep = " ")

}

if (include_court_scholarship == TRUE){

query <- paste(query, "?scholarship", sep = " ")

}

if (resource_type == "any"){
query <- paste(query, "where{", sep = " ")
Expand Down Expand Up @@ -411,6 +441,33 @@ elx_make_query <- function(resource_type = c("any","directive","regulation","dec
?proc skos:prefLabel ?courtprocedure. FILTER(lang(?courtprocedure)='en')}.")

}

if (include_advocate_general == TRUE){

query <- paste(query, "OPTIONAL{?work cdm:case-law_delivered_by_advocate-general ?agx.
?agx cdm:agent_name ?ag}")

}

if (include_judge_rapporteur == TRUE){

query <- paste(query, "OPTIONAL{?work cdm:case-law_delivered_by_judge ?jrx.
?jrx cdm:agent_name ?jr}")

}

if (include_court_formation == TRUE){

query <- paste(query, "OPTIONAL{?work cdm:case-law_delivered_by_court-formation ?cfx.
?cfx skos:prefLabel ?cf. FILTER(lang(?cf)='en')}.")

}

if (include_court_scholarship == TRUE){

query <- paste(query, "OPTIONAL{?work cdm:case-law_article_journal_related ?scholarship.}")

}

if (include_ecli == TRUE){

Expand Down Expand Up @@ -441,4 +498,3 @@ elx_make_query <- function(resource_type = c("any","directive","regulation","dec
return(query)

}

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Please consider contributing to the maintenance and development of the package b
### eurlex 0.4.1

- `elx_fetch_data(type = "notice", notice = c("tree","branch", "object"))` now mirrors the behaviour of `elx_download_xml()` but instead of saving to path givess access to XML notice in R
- retrieve data on the Judge-Rapporteur, Advocate-General, court formation and court-curated scholarship using new `include_` options in `elx_make_query()`
- fixed bug in `elx_download_xml()` parameter checking
- `elx_download_xml(notice = "object")` now retrieves metadata correctly

Expand Down
5 changes: 3 additions & 2 deletions docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

162 changes: 82 additions & 80 deletions docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ba1b473

Please sign in to comment.