diff --git a/NEWS.md b/NEWS.md index 5215aa0..3ba78c4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/R/elx_make_query.R b/R/elx_make_query.R index f0b7d73..108d43a 100644 --- a/R/elx_make_query.R +++ b/R/elx_make_query.R @@ -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 @@ -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") @@ -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 = " ") @@ -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')}.") } @@ -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.}") } @@ -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){ diff --git a/README.md b/README.md index 0ae9dd7..de95dff 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/man/elx_make_query.Rd b/man/elx_make_query.Rd index 26c51a0..153ae70 100644 --- a/man/elx_make_query.Rd +++ b/man/elx_make_query.Rd @@ -30,6 +30,7 @@ elx_make_query( include_advocate_general = FALSE, include_court_formation = FALSE, include_court_scholarship = FALSE, + include_proposal = FALSE, order = FALSE, limit = NULL ) @@ -83,6 +84,8 @@ elx_make_query( \item{include_court_scholarship}{If `TRUE`, results include court-curated relevant scholarship} +\item{include_proposal}{If `TRUE`, results include the CELEX of the proposal of the adopted legal act} + \item{order}{Order results by ids} \item{limit}{Limit the number of results, for testing purposes mainly}