diff --git a/DESCRIPTION b/DESCRIPTION index 7e8e931..99d5ea1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: eurlex Type: Package Title: Retrieve Data on European Union Law -Version: 0.4.1 +Version: 0.4.2 Authors@R: c(person(given = "Michal", family = "Ovadek", role = c("aut", "cre", "cph"), diff --git a/NEWS.md b/NEWS.md index 92b3442..5215aa0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# eurlex 0.4.2 + +## Major changes + +- 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 + # eurlex 0.4.1 ## Major changes diff --git a/R/elx_make_query.R b/R/elx_make_query.R index 703b53b..f0b7d73 100644 --- a/R/elx_make_query.R +++ b/R/elx_make_query.R @@ -431,7 +431,8 @@ elx_make_query <- function(resource_type = c("any","directive","regulation","dec if (include_citations == TRUE){ - query <- paste(query, "OPTIONAL{?work cdm:work_cites_work ?citation. ?citation cdm:resource_legal_id_celex ?citationcelex.}") + query <- paste(query, "OPTIONAL{?work cdm:work_cites_work ?citation. + ?citation cdm:resource_legal_id_celex ?citationcelex.}") } @@ -486,6 +487,12 @@ elx_make_query <- function(resource_type = c("any","directive","regulation","dec query <- paste(query, "OPTIONAL{?work cdm:resource_legal_id_sector ?sector.}") } + + # add filter to hide versioned works (keeps only latest) + query <- paste( + query, + 'FILTER not exists{?work cdm:do_not_index "true"^^}.' + ) if (order == TRUE){ query <- paste(query, "} order by str(?date)") diff --git a/README.md b/README.md index 039c620..0ae9dd7 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,10 @@ Please consider contributing to the maintenance and development of the package b ## Latest changes +### eurlex 0.4.2 + +- 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 - `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