151 lines
4.3 KiB
Plaintext
151 lines
4.3 KiB
Plaintext
PREFIX : <#>
|
|
PREFIX adms: <http://www.w3.org/ns/adms#>
|
|
PREFIX adres: <https://data.vlaanderen.be/ns/adres#>
|
|
PREFIX besluit: <http://data.vlaanderen.be/ns/besluit#>
|
|
PREFIX crypto: <http://www.w3.org/2000/10/swap/crypto#>
|
|
PREFIX e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>
|
|
PREFIX ex: <http://example.org/test#>
|
|
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
|
PREFIX func: <http://www.w3.org/2007/rif-builtin-function#>
|
|
PREFIX generiek: <https://data.vlaanderen.be/ns/generiek#>
|
|
PREFIX log: <http://www.w3.org/2000/10/swap/log#>
|
|
PREFIX mandaat: <http://data.vlaanderen.be/ns/mandaat#>
|
|
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
|
|
PREFIX org: <http://www.w3.org/ns/org#>
|
|
PREFIX persoon: <https://data.vlaanderen.be/ns/persoon#>
|
|
PREFIX persoon_loket: <http://data.vlaanderen.be/ns/persoon#>
|
|
PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
|
|
PREFIX string: <http://www.w3.org/2000/10/swap/string#>
|
|
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
|
|
|
|
|
# DL and OP both use persoon:gebruikteVoornaam but with different semantics (!)
|
|
# Hence the mapping is in two steps.
|
|
# The first step maps the DL persoon:gebruikteVoornaam to the OP counterpart
|
|
# and drops the DL persoon:gebruikteVoornaam statements with e:becomes
|
|
# A second reasoning will map DL foaf:name to OP persoon:gebruikteVoornaam
|
|
# Doing both at once would lead all DL foaf:names to incorrectly become foaf:givennames
|
|
# in OP
|
|
|
|
# First name
|
|
# persoon:gebruikteVoornaam => foaf:givenName
|
|
# Alternatieve voornaam
|
|
# foaf:name => persoon:gebruikteVoornaam
|
|
|
|
# Test Mock DL
|
|
# <http://example.org/person> persoon_loket:gebruikteVoornaam "Didier".
|
|
|
|
{
|
|
{
|
|
?s persoon_loket:gebruikteVoornaam ?o
|
|
} e:becomes {
|
|
?s foaf:givenName ?o
|
|
}
|
|
} => {
|
|
?s foaf:givenName ?o
|
|
}.
|
|
|
|
|
|
# First name
|
|
# persoon:gebruikteVoornaam => foaf:givenName (done in pre-processing)
|
|
# Alternatieve voornaam
|
|
# foaf:name => persoon:gebruikteVoornaam
|
|
|
|
# Test Mock LLB
|
|
# <http://example.org/person> foaf:name "Didier".
|
|
{
|
|
{
|
|
?s foaf:name ?o
|
|
} e:becomes {
|
|
?s persoon:gebruikteVoornaam ?o
|
|
}
|
|
} => {
|
|
?s persoon:gebruikteVoornaam ?o
|
|
}.
|
|
|
|
# Test
|
|
# ex:s <http://data.vlaanderen.be/ns/mandaat#start> "2019-01-01T19:32:52+00:00"^^xsd:dateTime.
|
|
{
|
|
?s mandaat:start ?startDateTime.
|
|
# use backward arrow rule defined below
|
|
?startDateTime :dateFromDateTime ?startDate.
|
|
{
|
|
?s mandaat:start ?startDateTime
|
|
} e:becomes {
|
|
?s mandaat:start ?startDate
|
|
}.
|
|
} => {
|
|
?s mandaat:start ?startDate
|
|
}.
|
|
|
|
# ex:s <http://data.vlaanderen.be/ns/mandaat#einde> "2019-02-01T10:32:52+00:00"^^xsd:dateTime.
|
|
{
|
|
?s mandaat:einde ?eindeDateTime.
|
|
# use backward arrow rule defined below
|
|
?eindeDateTime :dateFromDateTime ?eindeDate.
|
|
{
|
|
?s mandaat:einde ?eindeDateTime
|
|
} e:becomes {
|
|
?s mandaat:einde ?eindeDate
|
|
}.
|
|
} => {
|
|
?s mandaat:einde ?eindeDate
|
|
}.
|
|
|
|
|
|
# Backward arrow rule is like a function call.
|
|
# Removes time info in the returned date
|
|
# The user in DL selects a date via the UI.
|
|
# These dates are persisted as midnight dateTimes in UTC.
|
|
# Meaning that 1st of July is stored as
|
|
# "2022-06-30T22:00:00Z"^^xsd:dateTime
|
|
# and 1 December
|
|
# "2022-11-30T23:00:00Z"^^xsd:dateTime
|
|
# So, the following rule adds 2 hours to the datetime, and then takes the date part of the UTC date time
|
|
# to come to the date that the DL user selected (in CE(S)T)
|
|
{
|
|
?dateTime :dateFromDateTime ?date
|
|
} <= {
|
|
(?dateTimeLiteral xsd:dateTime) log:dtlit ?dateTime.
|
|
(?dateTime "PT2H"^^xsd:dayTimeDuration) func:add-dayTimeDuration-to-dateTime ?localDateTime.
|
|
(?localDateTimeLiteral xsd:dateTime) log:dtlit ?localDateTime.
|
|
(?localDateTimeLiteral 0 11) func:substring ?dateLiteral.
|
|
(?dateLiteral xsd:date) log:dtlit ?date.
|
|
}.
|
|
|
|
|
|
# ex:orgA besluit:classificatie <http://data.vlaanderen.be/id/concept/BestuurseenheidClassificatieCode/5ab0e9b8a3b2ca7c5e000002>.
|
|
{
|
|
{
|
|
?s besluit:classificatie ?o
|
|
} e:becomes {
|
|
?s org:classification ?o
|
|
}
|
|
} => {
|
|
?s org:classification ?o
|
|
}.
|
|
|
|
# fix typo V -> v
|
|
# <http://data.lblod.info/id/adressen/606D972BC20E70000900001C> <https://data.vlaanderen.be/ns/adres#AdresVoorstelling.huisnummer> "1" .
|
|
{
|
|
{
|
|
?s adres:AdresVoorstelling.huisnummer ?o
|
|
} e:becomes {
|
|
?s adres:Adresvoorstelling.huisnummer ?o
|
|
}
|
|
} => {
|
|
?s adres:Adresvoorstelling.huisnummer ?o
|
|
}.
|
|
|
|
|
|
# Tijdspecialisatie
|
|
{
|
|
{
|
|
?s mandaat:isTijdspecialisatieVan ?o.
|
|
} e:becomes {
|
|
?s generiek:isTijdspecialisatieVan ?o.
|
|
}
|
|
} => {
|
|
?s generiek:isTijdspecialisatieVan ?o.
|
|
}.
|