-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4a61ef6
commit 31519f5
Showing
6 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
scrapers/src/main/resources/be/gov/data/scrapers/hda/scripts.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# extra queries to be executed and data to be loaded | ||
hda/sparql-fix-temporal.qry | ||
sparql-delete-label-empty.qry | ||
data-frequency.ttl | ||
sparql-map-frequency.qry | ||
hda/sparql-theme.qry | ||
hda/sparql-fix-datetime.qry | ||
hda/sparql-fix-dateformat.qry | ||
sparql-date-type.qry |
15 changes: 15 additions & 0 deletions
15
scrapers/src/main/resources/be/gov/data/scrapers/hda/sparql-fix-dateformat.qry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Fix dateformat (EU date notation to ISO) | ||
|
||
PREFIX dcat: <http://www.w3.org/ns/dcat#> | ||
PREFIX dcterms: <http://purl.org/dc/terms/> | ||
|
||
DELETE | ||
{ ?s ?prop ?date } | ||
INSERT | ||
{ ?s ?prop ?iso } | ||
WHERE | ||
{ ?s ?prop ?date . | ||
VALUES ?prop { dcterms:modified dcat:startDate dcat:endDate } | ||
FILTER (REGEX(?date, "^(\\d{1,2})[/-](\\d{1,2})[/-](\\d{4})$")) | ||
BIND (REPLACE(?date, "^(\\d{1,2})[/-](\\d{1,2})[/-](\\d{4})$", "$3-$2-$1") as ?iso) | ||
} |
12 changes: 12 additions & 0 deletions
12
scrapers/src/main/resources/be/gov/data/scrapers/hda/sparql-fix-datetime.qry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Remove non-date expressions in modified | ||
|
||
PREFIX dcat: <http://www.w3.org/ns/dcat#> | ||
PREFIX dcterms: <http://purl.org/dc/terms/> | ||
|
||
DELETE | ||
{ ?s ?prop ?label } | ||
WHERE | ||
{ ?s ?prop ?label . | ||
VALUES ?prop { dcterms:modified dcat:startDate dcat:endDate } | ||
FILTER (REGEX(?label, "^\\D+")) | ||
} |
24 changes: 24 additions & 0 deletions
24
scrapers/src/main/resources/be/gov/data/scrapers/hda/sparql-fix-temporal.qry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Split temporal into startdate / enddate | ||
|
||
PREFIX dcterms: <http://purl.org/dc/terms/> | ||
PREFIX dcat: <http://www.w3.org/ns/dcat#> | ||
|
||
DELETE | ||
{ ?s dcterms:temporal ?temp } | ||
INSERT | ||
{ ?s dcterms:temporal [ | ||
dcat:startDate ?start ; | ||
dcat:endDate ?end ] | ||
} | ||
WHERE | ||
{ ?s dcterms:temporal ?temp . | ||
FILTER (REGEX(?temp, "^\\S+ - \\S+")) | ||
BIND ( | ||
REPLACE( | ||
STRBEFORE(?temp, " - "), "-\\D+$", "") | ||
as ?start) | ||
BIND ( | ||
REPLACE( | ||
STRAFTER(?temp, " - "), " - \\?$", "") | ||
as ?end) | ||
} |
13 changes: 13 additions & 0 deletions
13
scrapers/src/main/resources/be/gov/data/scrapers/hda/sparql-theme.qry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Set category / theme | ||
|
||
PREFIX dcat: <http://www.w3.org/ns/dcat#> | ||
PREFIX dgov: <http://data.gov.be#> | ||
|
||
DELETE | ||
{ ?dataset dcat:theme "HEAL" } | ||
INSERT | ||
{ ?dataset dcat:theme <http://publications.europa.eu/resource/authority/data-theme/HEAL> . | ||
?dataset dgov:theme <http://data.gov.be/en/taxonomy/term/40> . | ||
} | ||
WHERE | ||
{ ?dataset dcat:theme "HEAL" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters