245 lines
6.2 KiB
Plaintext
245 lines
6.2 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#>
|
|
PREFIX dc_terms: <http://purl.org/dc/terms/>
|
|
PREFIX ch: <http://data.lblod.info/vocabularies/contacthub/>
|
|
PREFIX person: <http://www.w3.org/ns/person#>
|
|
PREFIX lblodlg: <http://data.lblod.info/vocabularies/leidinggevenden/>
|
|
PREFIX ere: <http://data.lblod.info/vocabularies/erediensten/>
|
|
|
|
# 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#einde> "2019-02-01T10:32:52+00:00"^^xsd:dateTime.
|
|
{
|
|
?s mandaat:bindingEinde ?eindeDate.
|
|
# use backward arrow rule defined below
|
|
?eindeDate :dateTimeFromDate ?eindeDateTime.
|
|
{
|
|
?s mandaat:bindingEinde ?eindeDate
|
|
} e:becomes {
|
|
?s mandaat:bindingEinde ?eindeDateTime
|
|
}.
|
|
} => {
|
|
?s mandaat:bindingEinde ?eindeDateTime
|
|
}.
|
|
|
|
{
|
|
?s mandaat:bindingStart ?startDate.
|
|
# use backward arrow rule defined below
|
|
?startDate :dateTimeFromDate ?startDateTime.
|
|
{
|
|
?s mandaat:bindingStart ?startDate
|
|
} e:becomes {
|
|
?s mandaat:bindingStart ?startDateTime
|
|
}.
|
|
} => {
|
|
?s mandaat:bindingStart ?startDateTime
|
|
}.
|
|
{
|
|
?s ch:startdatum ?startDate.
|
|
# use backward arrow rule defined below
|
|
?startDate :dateTimeFromDate ?startDateTime.
|
|
{
|
|
?s ch:startdatum ?startDate
|
|
} e:becomes {
|
|
?s ch:startdatum ?startDateTime
|
|
}.
|
|
} => {
|
|
?s ch:startdatum ?startDateTime
|
|
}.
|
|
|
|
{
|
|
?s mandaat:start ?startDate.
|
|
# use backward arrow rule defined below
|
|
?startDate :dateTimeFromDate ?startDateTime.
|
|
{
|
|
?s mandaat:start ?startDate
|
|
} e:becomes {
|
|
?s mandaat:start ?startDateTime
|
|
}.
|
|
} => {
|
|
?s mandaat:start ?startDateTime
|
|
}.
|
|
|
|
{
|
|
?s mandaat:einde ?eindeDate.
|
|
# use backward arrow rule defined below
|
|
?eindeDate :dateTimeFromDate ?eindeDateTime.
|
|
{
|
|
?s mandaat:einde ?eindeDate
|
|
} e:becomes {
|
|
?s mandaat:einde ?eindeDateTime
|
|
}.
|
|
} => {
|
|
?s mandaat:einde ?eindeDateTime
|
|
}.
|
|
|
|
{
|
|
?s ch:eindedatum ?endDate.
|
|
# use backward arrow rule defined below
|
|
?endDate :dateTimeFromDate ?endDateTime.
|
|
{
|
|
?s ch:eindedatum ?endDate
|
|
} e:becomes {
|
|
?s ch:eindedatum ?endDateTime
|
|
}.
|
|
} => {
|
|
?s ch:eindedatum ?endDateTime
|
|
}.
|
|
|
|
{
|
|
?s ere:geplandeEinddatumAanstelling ?endDate.
|
|
# use backward arrow rule defined below
|
|
?endDate :dateTimeFromDate ?endDateTime.
|
|
{
|
|
?s ere:geplandeEinddatumAanstelling ?endDate
|
|
} e:becomes {
|
|
?s ere:geplandeEinddatumAanstelling ?endDateTime
|
|
}.
|
|
} => {
|
|
?s ere:geplandeEinddatumAanstelling ?endDateTime
|
|
}.
|
|
|
|
# Backward arrow rule is like a function call.
|
|
# Removes the timezone indicator "Z" from incoming datetimes
|
|
# To make sure all datetimes have the same convention we now save them as
|
|
# datetime without the timezone indicator
|
|
# We use "T02:00:00" as time indicator to work around a virtuoso bug that
|
|
# results in datetimes being converted to a date when using "T00:00:00"
|
|
{
|
|
?date :dateTimeFromDate ?dateTime
|
|
}
|
|
<=
|
|
{
|
|
( ?date 1 10 ) string:substring ?dateSolo .
|
|
(?dateSolo "T02:00:00") string:concatenation ?datePlusTime.
|
|
(?datePlusTime xsd:dateTime) log:dtlit ?dateTime .
|
|
}.
|
|
|
|
|
|
# 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.
|
|
}.
|
|
|
|
# In OP functionaris inherits from agents-in-position, which inherits from Agent
|
|
{
|
|
?s a lblodlg:Functionaris .
|
|
} => {
|
|
?s a ch:AgentInPositie ,
|
|
dc_terms:Agent .
|
|
} .
|
|
|
|
# In OP mandataris inherits from agents-in-position, which inherits from Agent
|
|
{
|
|
?s a mandaat:Mandataris .
|
|
} => {
|
|
?s a ch:AgentInPositie ,
|
|
dc_terms:Agent .
|
|
} .
|
|
|
|
# In OP minister inherits from agents-in-position, which inherits from Agent
|
|
{
|
|
?s a ere:RolBedienaar .
|
|
} => {
|
|
?s a ch:AgentInPositie ,
|
|
dc_terms:Agent .
|
|
} .
|
|
|
|
# In OP Person inherits from Agent
|
|
{
|
|
?s a person:Person .
|
|
} => {
|
|
?s a dc_terms:Agent .
|
|
} .
|