Skip to content

Commit

Permalink
proposals and author fix for 0.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
michalovadek committed May 24, 2022
1 parent 9ec5e61 commit f8365dc
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@

## Major changes

- new feature: `elx_make_query(include_proposal = TRUE)` retrieves the CELEX of a proposal of a requested legal act
- the returned results from `elx_make_query()` no longer include previous versions of the same record (new versions typically fix incorrect or missing metadata). This reduces the number of duplicates previously appearing in the results

## Minor changes
- `elx_make_query(include_author = TRUE)` now returns the human-readable label (institutional authors) instead of URI

# eurlex 0.4.1

## Major changes
Expand Down
22 changes: 19 additions & 3 deletions R/elx_make_query.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#' @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_proposal If `TRUE`, results include the CELEX of the proposal of the adopted legal act
#' @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 @@ -52,6 +53,7 @@ elx_make_query <- function(resource_type = c("any","directive","regulation","dec
include_ecli = FALSE, include_judge_rapporteur = FALSE,
include_advocate_general = FALSE, include_court_formation = FALSE,
include_court_scholarship = FALSE,
include_proposal = FALSE,
order = FALSE, limit = NULL){

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

}

if (include_proposal == TRUE){

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

}

if (resource_type == "any"){
query <- paste(query, "where{", sep = " ")
Expand Down Expand Up @@ -425,7 +433,8 @@ elx_make_query <- function(resource_type = c("any","directive","regulation","dec

if (include_author == TRUE){

query <- paste(query, "OPTIONAL{?work cdm:work_created_by_agent ?author.}")
query <- paste(query, "OPTIONAL{?work cdm:work_created_by_agent ?authorx.
?authorx skos:prefLabel ?author. FILTER(lang(?author)='en')}.")

}

Expand All @@ -446,14 +455,14 @@ elx_make_query <- function(resource_type = c("any","directive","regulation","dec
if (include_advocate_general == TRUE){

query <- paste(query, "OPTIONAL{?work cdm:case-law_delivered_by_advocate-general ?agx.
?agx cdm:agent_name ?ag}")
?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}")
?jrx cdm:agent_name ?jr.}")

}

Expand All @@ -469,6 +478,13 @@ elx_make_query <- function(resource_type = c("any","directive","regulation","dec
query <- paste(query, "OPTIONAL{?work cdm:case-law_article_journal_related ?scholarship.}")

}

if (include_proposal == TRUE){

query <- paste(query, "OPTIONAL{?work cdm:resource_legal_adopts_resource_legal ?adoptedx.
?adoptedx cdm:resource_legal_id_celex ?proposal.}")

}

if (include_ecli == TRUE){

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

### eurlex 0.4.2

- new feature: `elx_make_query(include_proposal = TRUE)` retrieves the CELEX of a proposal of a requested legal act
- the returned results from `elx_make_query()` no longer include previous versions of the same record (new versions typically fix incorrect or missing metadata)

### eurlex 0.4.1
Expand Down
3 changes: 3 additions & 0 deletions man/elx_make_query.Rd

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

0 comments on commit f8365dc

Please sign in to comment.