From e844c9f8244be14164265f9b666b6374662aa3eb Mon Sep 17 00:00:00 2001 From: Claire Lovisa Date: Wed, 22 Jan 2025 20:18:47 +0100 Subject: [PATCH] Add reasoner rules back, we'll clean everything up afterwards --- .../dl2op/main-info/inverse_relations.n3 | 33 ++ config/reasoner/dl2op/main-info/mapping.n3 | 244 ++++++++ .../dl2op/main-info/persoon_http_to_https.n3 | 524 +++++++++++++++++ .../reasoner/dl2op/main-info/phone_number.n3 | 32 ++ config/reasoner/dl2op/main-info/query.n3q | 544 ++++++++++++++++++ .../dl2op/main-info/retract_empty_strings.n3 | 27 + config/reasoner/dl2op/main-info/rrn.n3 | 62 ++ .../dl2op/private-info/inverse_relations.n3 | 33 ++ config/reasoner/dl2op/private-info/mapping.n3 | 196 +++++++ .../private-info/persoon_http_to_https.n3 | 524 +++++++++++++++++ config/reasoner/dl2op/private-info/query.n3q | 90 +++ .../private-info/retract_empty_strings.n3 | 27 + config/reasoner/dl2op/private-info/rrn.n3 | 62 ++ 13 files changed, 2398 insertions(+) create mode 100644 config/reasoner/dl2op/main-info/inverse_relations.n3 create mode 100644 config/reasoner/dl2op/main-info/mapping.n3 create mode 100644 config/reasoner/dl2op/main-info/persoon_http_to_https.n3 create mode 100644 config/reasoner/dl2op/main-info/phone_number.n3 create mode 100644 config/reasoner/dl2op/main-info/query.n3q create mode 100644 config/reasoner/dl2op/main-info/retract_empty_strings.n3 create mode 100644 config/reasoner/dl2op/main-info/rrn.n3 create mode 100644 config/reasoner/dl2op/private-info/inverse_relations.n3 create mode 100644 config/reasoner/dl2op/private-info/mapping.n3 create mode 100644 config/reasoner/dl2op/private-info/persoon_http_to_https.n3 create mode 100644 config/reasoner/dl2op/private-info/query.n3q create mode 100644 config/reasoner/dl2op/private-info/retract_empty_strings.n3 create mode 100644 config/reasoner/dl2op/private-info/rrn.n3 diff --git a/config/reasoner/dl2op/main-info/inverse_relations.n3 b/config/reasoner/dl2op/main-info/inverse_relations.n3 new file mode 100644 index 0000000..bfeda31 --- /dev/null +++ b/config/reasoner/dl2op/main-info/inverse_relations.n3 @@ -0,0 +1,33 @@ +PREFIX : <#> +PREFIX adms: +PREFIX adres: +PREFIX besluit: +PREFIX crypto: +PREFIX e: +PREFIX ex: +PREFIX foaf: +PREFIX func: +PREFIX generiek: +PREFIX log: +PREFIX mandaat: +PREFIX mu: +PREFIX org: +PREFIX persoon: +PREFIX persoon_loket: +PREFIX skos: +PREFIX string: +PREFIX xsd: + + +# Inverse properties +{ + ?s org:holds ?o. +} => { + ?o org:heldBy ?s. +}. + +{ + ?s org:heldBy ?o. +} => { + ?o org:holds ?s. +}. diff --git a/config/reasoner/dl2op/main-info/mapping.n3 b/config/reasoner/dl2op/main-info/mapping.n3 new file mode 100644 index 0000000..326b028 --- /dev/null +++ b/config/reasoner/dl2op/main-info/mapping.n3 @@ -0,0 +1,244 @@ +PREFIX : <#> +PREFIX adms: +PREFIX adres: +PREFIX besluit: +PREFIX crypto: +PREFIX e: +PREFIX ex: +PREFIX foaf: +PREFIX func: +PREFIX generiek: +PREFIX log: +PREFIX mandaat: +PREFIX mu: +PREFIX org: +PREFIX persoon: +PREFIX persoon_loket: +PREFIX skos: +PREFIX string: +PREFIX xsd: +PREFIX dc_terms: +PREFIX ch: +PREFIX person: +PREFIX lblodlg: +PREFIX ere: + +# 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 +# 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 +# foaf:name "Didier". +{ + { + ?s foaf:name ?o + } e:becomes { + ?s persoon:gebruikteVoornaam ?o + } +} => { + ?s persoon:gebruikteVoornaam ?o +}. + + +# Test +# ex:s "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 . +{ + { + ?s besluit:classificatie ?o + } e:becomes { + ?s org:classification ?o + } +} => { + ?s org:classification ?o +}. + +# fix typo V -> v +# "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 . +} . diff --git a/config/reasoner/dl2op/main-info/persoon_http_to_https.n3 b/config/reasoner/dl2op/main-info/persoon_http_to_https.n3 new file mode 100644 index 0000000..8afa661 --- /dev/null +++ b/config/reasoner/dl2op/main-info/persoon_http_to_https.n3 @@ -0,0 +1,524 @@ +PREFIX : <#> +PREFIX adms: +PREFIX adres: +PREFIX besluit: +PREFIX crypto: +PREFIX e: +PREFIX ex: +PREFIX foaf: +PREFIX func: +PREFIX generiek: +PREFIX log: +PREFIX mandaat: +PREFIX mu: +PREFIX org: +PREFIX persoon: +PREFIX persoon_loket: +PREFIX skos: +PREFIX string: +PREFIX xsd: + + +# Map from http persoon to https persoon namespace. + +## classes: +{ + { + ?s a persoon_loket:Afstamming + } e:becomes { + ?s a persoon:Afstamming + } +} => { + ?s a persoon:Afstamming +}. + +{ + { + ?s a persoon_loket:BurgerlijkeStaat + } e:becomes { + ?s a persoon:BurgerlijkeStaat + } +} => { + ?s a persoon:BurgerlijkeStaat +}. + +{ + { + ?s a persoon_loket:Domicilie + } e:becomes { + ?s a persoon:Domicilie + } +} => { + ?s a persoon:Domicilie +}. + +{ + { + ?s a persoon_loket:Geboorte + } e:becomes { + ?s a persoon:Geboorte + } +} => { + ?s a persoon:Geboorte +}. + +{ + { + ?s a persoon_loket:GeenInwoner + } e:becomes { + ?s a persoon:GeenInwoner + } +} => { + ?s a persoon:GeenInwoner +}. + +{ + { + ?s a persoon_loket:GeregistreerdPersoon + } e:becomes { + ?s a persoon:GeregistreerdPersoon + } +} => { + ?s a persoon:GeregistreerdPersoon +}. + +{ + { + ?s a persoon_loket:Gezin + } e:becomes { + ?s a persoon:Gezin + } +} => { + ?s a persoon:Gezin +}. + +{ + { + ?s a persoon_loket:Gezinsrelatie + } e:becomes { + ?s a persoon:Gezinsrelatie + } +} => { + ?s a persoon:Gezinsrelatie +}. + +{ + { + ?s a persoon_loket:Huwelijk + } e:becomes { + ?s a persoon:Huwelijk + } +} => { + ?s a persoon:Huwelijk +}. + +{ + { + ?s a persoon_loket:Inwoner + } e:becomes { + ?s a persoon:Inwoner + } +} => { + ?s a persoon:Inwoner +}. + +{ + { + ?s a persoon_loket:Inwonerschap + } e:becomes { + ?s a persoon:Inwonerschap + } +} => { + ?s a persoon:Inwonerschap +}. + +{ + { + ?s a persoon_loket:Nationaliteit + } e:becomes { + ?s a persoon:Nationaliteit + } +} => { + ?s a persoon:Nationaliteit +}. + +{ + { + ?s a persoon_loket:Overlijden + } e:becomes { + ?s a persoon:Overlijden + } +} => { + ?s a persoon:Overlijden +}. + +{ + { + ?s a persoon_loket:PermanentInwoner + } e:becomes { + ?s a persoon:PermanentInwoner + } +} => { + ?s a persoon:PermanentInwoner +}. + +{ + { + ?s a persoon_loket:Persoonsgebeurtenis + } e:becomes { + ?s a persoon:Persoonsgebeurtenis + } +} => { + ?s a persoon:Persoonsgebeurtenis +}. + +{ + { + ?s a persoon_loket:Persoonsrelatie + } e:becomes { + ?s a persoon:Persoonsrelatie + } +} => { + ?s a persoon:Persoonsrelatie +}. + +{ + { + ?s a persoon_loket:Samenwonen + } e:becomes { + ?s a persoon:Samenwonen + } +} => { + ?s a persoon:Samenwonen +}. + +{ + { + ?s a persoon_loket:Staatsburger + } e:becomes { + ?s a persoon:Staatsburger + } +} => { + ?s a persoon:Staatsburger +}. + +{ + { + ?s a persoon_loket:Staatsburgerschap + } e:becomes { + ?s a persoon:Staatsburgerschap + } +} => { + ?s a persoon:Staatsburgerschap +}. + +{ + { + ?s a persoon_loket:TijdelijkInwoner + } e:becomes { + ?s a persoon:TijdelijkInwoner + } +} => { + ?s a persoon:TijdelijkInwoner +}. + +{ + { + ?s a persoon_loket:Verblijfplaats + } e:becomes { + ?s a persoon:Verblijfplaats + } +} => { + ?s a persoon:Verblijfplaats +}. + +{ + { + ?s a persoon_loket:Voogdij + } e:becomes { + ?s a persoon:Voogdij + } +} => { + ?s a persoon:Voogdij +}. + +{ + { + ?s a persoon_loket:Vreemdeling + } e:becomes { + ?s a persoon:Vreemdeling + } +} => { + ?s a persoon:Vreemdeling +}. + +## properties +{ + { + ?s persoon_loket:afstammingsType ?o + } e:becomes { + ?s persoon:afstammingsType ?o + } +} => { + ?s persoon:afstammingsType ?o +}. + +{ + { + ?s persoon_loket:alternatieveNaam ?o + } e:becomes { + ?s persoon:alternatieveNaam ?o + } +} => { + ?s persoon:alternatieveNaam ?o +}. + +{ + { + ?s persoon_loket:datum ?o + } e:becomes { + ?s persoon:datum ?o + } +} => { + ?s persoon:datum ?o +}. + +{ + { + ?s persoon_loket:datumVanAfstamming ?o + } e:becomes { + ?s persoon:datumVanAfstamming ?o + } +} => { + ?s persoon:datumVanAfstamming ?o +}. + +{ + { + ?s persoon_loket:geslacht ?o + } e:becomes { + ?s persoon:geslacht ?o + } +} => { + ?s persoon:geslacht ?o +}. + +{ + { + ?s persoon_loket:gezinsadres ?o + } e:becomes { + ?s persoon:gezinsadres ?o + } +} => { + ?s persoon:gezinsadres ?o +}. + +{ + { + ?s persoon_loket:gezinsrelatietype ?o + } e:becomes { + ?s persoon:gezinsrelatietype ?o + } +} => { + ?s persoon:gezinsrelatietype ?o +}. + +{ + { + ?s persoon_loket:heeftBurgerlijkeStaat ?o + } e:becomes { + ?s persoon:heeftBurgerlijkeStaat ?o + } +} => { + ?s persoon:heeftBurgerlijkeStaat ?o +}. + +{ + { + ?s persoon_loket:heeftGeboorte ?o + } e:becomes { + ?s persoon:heeftGeboorte ?o + } +} => { + ?s persoon:heeftGeboorte ?o +}. + +{ + { + ?s persoon_loket:heeftInwonerschap ?o + } e:becomes { + ?s persoon:heeftInwonerschap ?o + } +} => { + ?s persoon:heeftInwonerschap ?o +}. + +{ + { + ?s persoon_loket:heeftNationaliteit ?o + } e:becomes { + ?s persoon:heeftNationaliteit ?o + } +} => { + ?s persoon:heeftNationaliteit ?o +}. + +{ + { + ?s persoon_loket:heeftOverlijden ?o + } e:becomes { + ?s persoon:heeftOverlijden ?o + } +} => { + ?s persoon:heeftOverlijden ?o +}. + +{ + { + ?s persoon_loket:heeftPersoonsrelatie ?o + } e:becomes { + ?s persoon:heeftPersoonsrelatie ?o + } +} => { + ?s persoon:heeftPersoonsrelatie ?o +}. + +{ + { + ?s persoon_loket:heeftStaatsburgerschap ?o + } e:becomes { + ?s persoon:heeftStaatsburgerschap ?o + } +} => { + ?s persoon:heeftStaatsburgerschap ?o +}. + +{ + { + ?s persoon_loket:heeftVerblijfplaats ?o + } e:becomes { + ?s persoon:heeftVerblijfplaats ?o + } +} => { + ?s persoon:heeftVerblijfplaats ?o +}. + +{ + { + ?s persoon_loket:Inwonerschap.binnenJurisdictie ?o + } e:becomes { + ?s persoon:Inwonerschap.binnenJurisdictie ?o + } +} => { + ?s persoon:Inwonerschap.binnenJurisdictie ?o +}. + +{ + { + ?s persoon_loket:isHoofdVan ?o + } e:becomes { + ?s persoon:isHoofdVan ?o + } +} => { + ?s persoon:isHoofdVan ?o +}. + +{ + { + ?s persoon_loket:isLidVan ?o + } e:becomes { + ?s persoon:isLidVan ?o + } +} => { + ?s persoon:isLidVan ?o +}. + +{ + { + ?s persoon_loket:isRelatieMet ?o + } e:becomes { + ?s persoon:isRelatieMet ?o + } +} => { + ?s persoon:isRelatieMet ?o +}. + +{ + { + ?s persoon_loket:land ?o + } e:becomes { + ?s persoon:land ?o + } +} => { + ?s persoon:land ?o +}. + +{ + { + ?s persoon_loket:nationaliteit ?o + } e:becomes { + ?s persoon:nationaliteit ?o + } +} => { + ?s persoon:nationaliteit ?o +}. + +{ + { + ?s persoon_loket:plaats ?o + } e:becomes { + ?s persoon:plaats ?o + } +} => { + ?s persoon:plaats ?o +}. + +{ + { + ?s persoon_loket:registratie ?o + } e:becomes { + ?s persoon:registratie ?o + } +} => { + ?s persoon:registratie ?o +}. + +{ + { + ?s persoon_loket:Staatsburgerschap.binnenJurisdictie ?o + } e:becomes { + ?s persoon:Staatsburgerschap.binnenJurisdictie ?o + } +} => { + ?s persoon:Staatsburgerschap.binnenJurisdictie ?o +}. + +{ + { + ?s persoon_loket:type ?o + } e:becomes { + ?s persoon:type ?o + } +} => { + ?s persoon:type ?o +}. + +{ + { + ?s persoon_loket:verblijfsadres ?o + } e:becomes { + ?s persoon:verblijfsadres ?o + } +} => { + ?s persoon:verblijfsadres ?o +}. + +{ + { + ?s persoon_loket:volledigeNaam ?o + } e:becomes { + ?s persoon:volledigeNaam ?o + } +} => { + ?s persoon:volledigeNaam ?o +}. \ No newline at end of file diff --git a/config/reasoner/dl2op/main-info/phone_number.n3 b/config/reasoner/dl2op/main-info/phone_number.n3 new file mode 100644 index 0000000..da5ce99 --- /dev/null +++ b/config/reasoner/dl2op/main-info/phone_number.n3 @@ -0,0 +1,32 @@ +PREFIX string: +PREFIX e: +PREFIX schema: +PREFIX : <#> +{ + ?s schema:telephone ?number. + + # Remove all non digits + ( ?number ("""[^+\\d]""") ("") ) string:replaceAll ?scrape_result. + + # Replace leading 00 with + + ( ?scrape_result """^00""" "+") string:replace ?replaced_zero_zero. + + ( ?replaced_zero_zero """^0""" "+32") string:replace ?default_be. + + ( ?default_be """\\+320""" "+32" ) string:replace ?replace_320. + + ( ?replace_320 """^320""" "+32" ) string:replace ?final_result. + + ?final_result string:matches """^\\+((32\\d{8})|(324\\d{8})|((?!32)\\d+))$""". + + ( "tel:" ?final_result ) string:concatenation ?parsed_result . + + { + ?s schema:telephone ?number. + } e:becomes { + ?s schema:telephone ?parsed_result . + }. + +} => { + ?s schema:telephone ?parsed_result . +}. \ No newline at end of file diff --git a/config/reasoner/dl2op/main-info/query.n3q b/config/reasoner/dl2op/main-info/query.n3q new file mode 100644 index 0000000..2d55202 --- /dev/null +++ b/config/reasoner/dl2op/main-info/query.n3q @@ -0,0 +1,544 @@ +# Generated by producer-config-to-query.ipynb + +## CLASSES +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +# { +# ?s a +# } => { +# ?s a +# }. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +# { +# ?s a +# } => { +# ?s a +# }. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +{ + ?s a + } => { + ?s a +}. + +## PROPERTIES +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +# { +# ?s ?o +# } => { +# ?s ?o +# }. + +{ + ?s ?o +} => { + ?s ?o +}. + +# { +# ?s ?o +# } => { +# ?s ?o +# }. + +# { +# ?s ?o +# } => { +# ?s ?o +# }. + +# { +# ?s ?o +# } => { +# ?s ?o +# }. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +# { +# ?s ?o +# } => { +# ?s ?o +# }. + +{ + ?s ?o +} => { + ?s ?o +}. + +# { +# ?s ?o +# } => { +# ?s ?o +# }. + +{ + ?s ?o +} => { + ?s ?o +}. + +# { +# ?s ?o +# } => { +# ?s ?o +# }. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +# { +# ?s ?o +# } => { +# ?s ?o +# }. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + +{ + ?s ?o +} => { + ?s ?o +}. + diff --git a/config/reasoner/dl2op/main-info/retract_empty_strings.n3 b/config/reasoner/dl2op/main-info/retract_empty_strings.n3 new file mode 100644 index 0000000..f8204a7 --- /dev/null +++ b/config/reasoner/dl2op/main-info/retract_empty_strings.n3 @@ -0,0 +1,27 @@ +PREFIX : <#> +PREFIX adms: +PREFIX adres: +PREFIX besluit: +PREFIX crypto: +PREFIX e: +PREFIX ex: +PREFIX foaf: +PREFIX func: +PREFIX generiek: +PREFIX log: +PREFIX mandaat: +PREFIX mu: +PREFIX org: +PREFIX persoon: +PREFIX persoon_loket: +PREFIX skos: +PREFIX string: +PREFIX xsd: + + +# Retract empty strings +{ + { + ?s ?p "" + } e:becomes {}. +} => {}. diff --git a/config/reasoner/dl2op/main-info/rrn.n3 b/config/reasoner/dl2op/main-info/rrn.n3 new file mode 100644 index 0000000..b45c688 --- /dev/null +++ b/config/reasoner/dl2op/main-info/rrn.n3 @@ -0,0 +1,62 @@ +PREFIX : <#> +PREFIX adms: +PREFIX adres: +PREFIX besluit: +PREFIX crypto: +PREFIX e: +PREFIX ex: +PREFIX foaf: +PREFIX func: +PREFIX generiek: +PREFIX log: +PREFIX mandaat: +PREFIX mu: +PREFIX org: +PREFIX persoon: +PREFIX persoon_loket: +PREFIX skos: +PREFIX string: +PREFIX xsd: + + + +# Rijksregisternummer +# Extend identifiers to match OP's model +# skos:notation "00010100105". +{ + ?identifier skos:notation ?notation. + ?notation string:notEqualIgnoringCase "Rijksregisternummer". + ?identifier log:uri ?identifierString. + (?identifierString "STRUCTURED_IDENTIFIER") string:concatenation ?hashInput. + ?hashInput crypto:md5 ?uuid. + ("http://data.lblod.info/id/gestructureerdeIdentificatoren/" ?uuid) string:concatenation ?structuredIdString. + ?structuredIdentifier log:uri ?structuredIdString. + + { + ?identifier skos:notation ?notation. + } e:becomes { + ?identifier + generiek:gestructureerdeIdentificator ?structuredIdentifier ; + skos:notation "Rijksregisternummer" . + }. + +} => { + ?identifier + generiek:gestructureerdeIdentificator ?structuredIdentifier ; + skos:notation "Rijksregisternummer" . + + ?structuredIdentifier a generiek:GestructureerdeIdentificator ; + mu:uuid ?uuid ; + generiek:lokaleIdentificator ?notation +}. + +# identifier property in the export is only used for RRN. +{ + { + ?s adms:identifier ?o + } e:becomes { + ?s persoon:registratie ?o + } +} => { + ?s persoon:registratie ?o +}. diff --git a/config/reasoner/dl2op/private-info/inverse_relations.n3 b/config/reasoner/dl2op/private-info/inverse_relations.n3 new file mode 100644 index 0000000..bfeda31 --- /dev/null +++ b/config/reasoner/dl2op/private-info/inverse_relations.n3 @@ -0,0 +1,33 @@ +PREFIX : <#> +PREFIX adms: +PREFIX adres: +PREFIX besluit: +PREFIX crypto: +PREFIX e: +PREFIX ex: +PREFIX foaf: +PREFIX func: +PREFIX generiek: +PREFIX log: +PREFIX mandaat: +PREFIX mu: +PREFIX org: +PREFIX persoon: +PREFIX persoon_loket: +PREFIX skos: +PREFIX string: +PREFIX xsd: + + +# Inverse properties +{ + ?s org:holds ?o. +} => { + ?o org:heldBy ?s. +}. + +{ + ?s org:heldBy ?o. +} => { + ?o org:holds ?s. +}. diff --git a/config/reasoner/dl2op/private-info/mapping.n3 b/config/reasoner/dl2op/private-info/mapping.n3 new file mode 100644 index 0000000..b174238 --- /dev/null +++ b/config/reasoner/dl2op/private-info/mapping.n3 @@ -0,0 +1,196 @@ +PREFIX : <#> +PREFIX adms: +PREFIX adres: +PREFIX besluit: +PREFIX crypto: +PREFIX e: +PREFIX ex: +PREFIX foaf: +PREFIX func: +PREFIX generiek: +PREFIX log: +PREFIX mandaat: +PREFIX mu: +PREFIX org: +PREFIX persoon: +PREFIX persoon_loket: +PREFIX skos: +PREFIX string: +PREFIX xsd: +PREFIX ch: + + +# 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 +# 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 +# foaf:name "Didier". +{ + { + ?s foaf:name ?o + } e:becomes { + ?s persoon:gebruikteVoornaam ?o + } +} => { + ?s persoon:gebruikteVoornaam ?o +}. + +# Test +# ex:s "2019-01-01T19:32:52+00:00"^^xsd:dateTime. +{ + ?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 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: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: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 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 +}. + +# 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 . +{ + { + ?s besluit:classificatie ?o + } e:becomes { + ?s org:classification ?o + } +} => { + ?s org:classification ?o +}. + +# fix typo V -> v +# "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. +}. diff --git a/config/reasoner/dl2op/private-info/persoon_http_to_https.n3 b/config/reasoner/dl2op/private-info/persoon_http_to_https.n3 new file mode 100644 index 0000000..8afa661 --- /dev/null +++ b/config/reasoner/dl2op/private-info/persoon_http_to_https.n3 @@ -0,0 +1,524 @@ +PREFIX : <#> +PREFIX adms: +PREFIX adres: +PREFIX besluit: +PREFIX crypto: +PREFIX e: +PREFIX ex: +PREFIX foaf: +PREFIX func: +PREFIX generiek: +PREFIX log: +PREFIX mandaat: +PREFIX mu: +PREFIX org: +PREFIX persoon: +PREFIX persoon_loket: +PREFIX skos: +PREFIX string: +PREFIX xsd: + + +# Map from http persoon to https persoon namespace. + +## classes: +{ + { + ?s a persoon_loket:Afstamming + } e:becomes { + ?s a persoon:Afstamming + } +} => { + ?s a persoon:Afstamming +}. + +{ + { + ?s a persoon_loket:BurgerlijkeStaat + } e:becomes { + ?s a persoon:BurgerlijkeStaat + } +} => { + ?s a persoon:BurgerlijkeStaat +}. + +{ + { + ?s a persoon_loket:Domicilie + } e:becomes { + ?s a persoon:Domicilie + } +} => { + ?s a persoon:Domicilie +}. + +{ + { + ?s a persoon_loket:Geboorte + } e:becomes { + ?s a persoon:Geboorte + } +} => { + ?s a persoon:Geboorte +}. + +{ + { + ?s a persoon_loket:GeenInwoner + } e:becomes { + ?s a persoon:GeenInwoner + } +} => { + ?s a persoon:GeenInwoner +}. + +{ + { + ?s a persoon_loket:GeregistreerdPersoon + } e:becomes { + ?s a persoon:GeregistreerdPersoon + } +} => { + ?s a persoon:GeregistreerdPersoon +}. + +{ + { + ?s a persoon_loket:Gezin + } e:becomes { + ?s a persoon:Gezin + } +} => { + ?s a persoon:Gezin +}. + +{ + { + ?s a persoon_loket:Gezinsrelatie + } e:becomes { + ?s a persoon:Gezinsrelatie + } +} => { + ?s a persoon:Gezinsrelatie +}. + +{ + { + ?s a persoon_loket:Huwelijk + } e:becomes { + ?s a persoon:Huwelijk + } +} => { + ?s a persoon:Huwelijk +}. + +{ + { + ?s a persoon_loket:Inwoner + } e:becomes { + ?s a persoon:Inwoner + } +} => { + ?s a persoon:Inwoner +}. + +{ + { + ?s a persoon_loket:Inwonerschap + } e:becomes { + ?s a persoon:Inwonerschap + } +} => { + ?s a persoon:Inwonerschap +}. + +{ + { + ?s a persoon_loket:Nationaliteit + } e:becomes { + ?s a persoon:Nationaliteit + } +} => { + ?s a persoon:Nationaliteit +}. + +{ + { + ?s a persoon_loket:Overlijden + } e:becomes { + ?s a persoon:Overlijden + } +} => { + ?s a persoon:Overlijden +}. + +{ + { + ?s a persoon_loket:PermanentInwoner + } e:becomes { + ?s a persoon:PermanentInwoner + } +} => { + ?s a persoon:PermanentInwoner +}. + +{ + { + ?s a persoon_loket:Persoonsgebeurtenis + } e:becomes { + ?s a persoon:Persoonsgebeurtenis + } +} => { + ?s a persoon:Persoonsgebeurtenis +}. + +{ + { + ?s a persoon_loket:Persoonsrelatie + } e:becomes { + ?s a persoon:Persoonsrelatie + } +} => { + ?s a persoon:Persoonsrelatie +}. + +{ + { + ?s a persoon_loket:Samenwonen + } e:becomes { + ?s a persoon:Samenwonen + } +} => { + ?s a persoon:Samenwonen +}. + +{ + { + ?s a persoon_loket:Staatsburger + } e:becomes { + ?s a persoon:Staatsburger + } +} => { + ?s a persoon:Staatsburger +}. + +{ + { + ?s a persoon_loket:Staatsburgerschap + } e:becomes { + ?s a persoon:Staatsburgerschap + } +} => { + ?s a persoon:Staatsburgerschap +}. + +{ + { + ?s a persoon_loket:TijdelijkInwoner + } e:becomes { + ?s a persoon:TijdelijkInwoner + } +} => { + ?s a persoon:TijdelijkInwoner +}. + +{ + { + ?s a persoon_loket:Verblijfplaats + } e:becomes { + ?s a persoon:Verblijfplaats + } +} => { + ?s a persoon:Verblijfplaats +}. + +{ + { + ?s a persoon_loket:Voogdij + } e:becomes { + ?s a persoon:Voogdij + } +} => { + ?s a persoon:Voogdij +}. + +{ + { + ?s a persoon_loket:Vreemdeling + } e:becomes { + ?s a persoon:Vreemdeling + } +} => { + ?s a persoon:Vreemdeling +}. + +## properties +{ + { + ?s persoon_loket:afstammingsType ?o + } e:becomes { + ?s persoon:afstammingsType ?o + } +} => { + ?s persoon:afstammingsType ?o +}. + +{ + { + ?s persoon_loket:alternatieveNaam ?o + } e:becomes { + ?s persoon:alternatieveNaam ?o + } +} => { + ?s persoon:alternatieveNaam ?o +}. + +{ + { + ?s persoon_loket:datum ?o + } e:becomes { + ?s persoon:datum ?o + } +} => { + ?s persoon:datum ?o +}. + +{ + { + ?s persoon_loket:datumVanAfstamming ?o + } e:becomes { + ?s persoon:datumVanAfstamming ?o + } +} => { + ?s persoon:datumVanAfstamming ?o +}. + +{ + { + ?s persoon_loket:geslacht ?o + } e:becomes { + ?s persoon:geslacht ?o + } +} => { + ?s persoon:geslacht ?o +}. + +{ + { + ?s persoon_loket:gezinsadres ?o + } e:becomes { + ?s persoon:gezinsadres ?o + } +} => { + ?s persoon:gezinsadres ?o +}. + +{ + { + ?s persoon_loket:gezinsrelatietype ?o + } e:becomes { + ?s persoon:gezinsrelatietype ?o + } +} => { + ?s persoon:gezinsrelatietype ?o +}. + +{ + { + ?s persoon_loket:heeftBurgerlijkeStaat ?o + } e:becomes { + ?s persoon:heeftBurgerlijkeStaat ?o + } +} => { + ?s persoon:heeftBurgerlijkeStaat ?o +}. + +{ + { + ?s persoon_loket:heeftGeboorte ?o + } e:becomes { + ?s persoon:heeftGeboorte ?o + } +} => { + ?s persoon:heeftGeboorte ?o +}. + +{ + { + ?s persoon_loket:heeftInwonerschap ?o + } e:becomes { + ?s persoon:heeftInwonerschap ?o + } +} => { + ?s persoon:heeftInwonerschap ?o +}. + +{ + { + ?s persoon_loket:heeftNationaliteit ?o + } e:becomes { + ?s persoon:heeftNationaliteit ?o + } +} => { + ?s persoon:heeftNationaliteit ?o +}. + +{ + { + ?s persoon_loket:heeftOverlijden ?o + } e:becomes { + ?s persoon:heeftOverlijden ?o + } +} => { + ?s persoon:heeftOverlijden ?o +}. + +{ + { + ?s persoon_loket:heeftPersoonsrelatie ?o + } e:becomes { + ?s persoon:heeftPersoonsrelatie ?o + } +} => { + ?s persoon:heeftPersoonsrelatie ?o +}. + +{ + { + ?s persoon_loket:heeftStaatsburgerschap ?o + } e:becomes { + ?s persoon:heeftStaatsburgerschap ?o + } +} => { + ?s persoon:heeftStaatsburgerschap ?o +}. + +{ + { + ?s persoon_loket:heeftVerblijfplaats ?o + } e:becomes { + ?s persoon:heeftVerblijfplaats ?o + } +} => { + ?s persoon:heeftVerblijfplaats ?o +}. + +{ + { + ?s persoon_loket:Inwonerschap.binnenJurisdictie ?o + } e:becomes { + ?s persoon:Inwonerschap.binnenJurisdictie ?o + } +} => { + ?s persoon:Inwonerschap.binnenJurisdictie ?o +}. + +{ + { + ?s persoon_loket:isHoofdVan ?o + } e:becomes { + ?s persoon:isHoofdVan ?o + } +} => { + ?s persoon:isHoofdVan ?o +}. + +{ + { + ?s persoon_loket:isLidVan ?o + } e:becomes { + ?s persoon:isLidVan ?o + } +} => { + ?s persoon:isLidVan ?o +}. + +{ + { + ?s persoon_loket:isRelatieMet ?o + } e:becomes { + ?s persoon:isRelatieMet ?o + } +} => { + ?s persoon:isRelatieMet ?o +}. + +{ + { + ?s persoon_loket:land ?o + } e:becomes { + ?s persoon:land ?o + } +} => { + ?s persoon:land ?o +}. + +{ + { + ?s persoon_loket:nationaliteit ?o + } e:becomes { + ?s persoon:nationaliteit ?o + } +} => { + ?s persoon:nationaliteit ?o +}. + +{ + { + ?s persoon_loket:plaats ?o + } e:becomes { + ?s persoon:plaats ?o + } +} => { + ?s persoon:plaats ?o +}. + +{ + { + ?s persoon_loket:registratie ?o + } e:becomes { + ?s persoon:registratie ?o + } +} => { + ?s persoon:registratie ?o +}. + +{ + { + ?s persoon_loket:Staatsburgerschap.binnenJurisdictie ?o + } e:becomes { + ?s persoon:Staatsburgerschap.binnenJurisdictie ?o + } +} => { + ?s persoon:Staatsburgerschap.binnenJurisdictie ?o +}. + +{ + { + ?s persoon_loket:type ?o + } e:becomes { + ?s persoon:type ?o + } +} => { + ?s persoon:type ?o +}. + +{ + { + ?s persoon_loket:verblijfsadres ?o + } e:becomes { + ?s persoon:verblijfsadres ?o + } +} => { + ?s persoon:verblijfsadres ?o +}. + +{ + { + ?s persoon_loket:volledigeNaam ?o + } e:becomes { + ?s persoon:volledigeNaam ?o + } +} => { + ?s persoon:volledigeNaam ?o +}. \ No newline at end of file diff --git a/config/reasoner/dl2op/private-info/query.n3q b/config/reasoner/dl2op/private-info/query.n3q new file mode 100644 index 0000000..bddbb11 --- /dev/null +++ b/config/reasoner/dl2op/private-info/query.n3q @@ -0,0 +1,90 @@ +PREFIX : <#> +PREFIX adms: +PREFIX adres: +PREFIX besluit: +PREFIX crypto: +PREFIX e: +PREFIX ex: +PREFIX foaf: +PREFIX func: +PREFIX generiek: +PREFIX log: +PREFIX mandaat: +PREFIX mu: +PREFIX org: +PREFIX persoon: +PREFIX skos: +PREFIX string: +PREFIX xsd: + + + +# Rijksregisternummer +# Extend identifiers to match OP's model +# skos:notation "00010100105". +{ + ?identifier + generiek:gestructureerdeIdentificator ?structuredIdentifier ; + skos:notation "Rijksregisternummer" . + + ?structuredIdentifier a generiek:GestructureerdeIdentificator ; + mu:uuid ?uuid ; + generiek:lokaleIdentificator ?notation +} => { + ?identifier + generiek:gestructureerdeIdentificator ?structuredIdentifier ; + skos:notation "Rijksregisternummer" . + + ?structuredIdentifier a generiek:GestructureerdeIdentificator ; + mu:uuid ?uuid ; + generiek:lokaleIdentificator ?notation +}. + +# identifier property in the export is only used for RRN. +{ + ?s persoon:registratie ?o +} => { + ?s persoon:registratie ?o +}. + +{ + ?s a + } => { + ?s a +}. + +# Nationality +{ + ?s persoon:heeftNationaliteit ?o +} => { + ?s persoon:heeftNationaliteit ?o +}. + + +# Birth and related attributes +{ + ?s a persoon:Geboorte; + ?p ?o. +} => { + ?s a persoon:Geboorte; + ?p ?o. +}. + +{ + ?s persoon:heeftGeboorte ?o +} => { + ?s persoon:heeftGeboorte ?o +}. + +{ + ?s persoon:datum ?o +} => { + ?s persoon:datum ?o +}. + +# Gender +{ + ?s persoon:geslacht ?o +} => { + ?s persoon:geslacht ?o +}. \ No newline at end of file diff --git a/config/reasoner/dl2op/private-info/retract_empty_strings.n3 b/config/reasoner/dl2op/private-info/retract_empty_strings.n3 new file mode 100644 index 0000000..f8204a7 --- /dev/null +++ b/config/reasoner/dl2op/private-info/retract_empty_strings.n3 @@ -0,0 +1,27 @@ +PREFIX : <#> +PREFIX adms: +PREFIX adres: +PREFIX besluit: +PREFIX crypto: +PREFIX e: +PREFIX ex: +PREFIX foaf: +PREFIX func: +PREFIX generiek: +PREFIX log: +PREFIX mandaat: +PREFIX mu: +PREFIX org: +PREFIX persoon: +PREFIX persoon_loket: +PREFIX skos: +PREFIX string: +PREFIX xsd: + + +# Retract empty strings +{ + { + ?s ?p "" + } e:becomes {}. +} => {}. diff --git a/config/reasoner/dl2op/private-info/rrn.n3 b/config/reasoner/dl2op/private-info/rrn.n3 new file mode 100644 index 0000000..b45c688 --- /dev/null +++ b/config/reasoner/dl2op/private-info/rrn.n3 @@ -0,0 +1,62 @@ +PREFIX : <#> +PREFIX adms: +PREFIX adres: +PREFIX besluit: +PREFIX crypto: +PREFIX e: +PREFIX ex: +PREFIX foaf: +PREFIX func: +PREFIX generiek: +PREFIX log: +PREFIX mandaat: +PREFIX mu: +PREFIX org: +PREFIX persoon: +PREFIX persoon_loket: +PREFIX skos: +PREFIX string: +PREFIX xsd: + + + +# Rijksregisternummer +# Extend identifiers to match OP's model +# skos:notation "00010100105". +{ + ?identifier skos:notation ?notation. + ?notation string:notEqualIgnoringCase "Rijksregisternummer". + ?identifier log:uri ?identifierString. + (?identifierString "STRUCTURED_IDENTIFIER") string:concatenation ?hashInput. + ?hashInput crypto:md5 ?uuid. + ("http://data.lblod.info/id/gestructureerdeIdentificatoren/" ?uuid) string:concatenation ?structuredIdString. + ?structuredIdentifier log:uri ?structuredIdString. + + { + ?identifier skos:notation ?notation. + } e:becomes { + ?identifier + generiek:gestructureerdeIdentificator ?structuredIdentifier ; + skos:notation "Rijksregisternummer" . + }. + +} => { + ?identifier + generiek:gestructureerdeIdentificator ?structuredIdentifier ; + skos:notation "Rijksregisternummer" . + + ?structuredIdentifier a generiek:GestructureerdeIdentificator ; + mu:uuid ?uuid ; + generiek:lokaleIdentificator ?notation +}. + +# identifier property in the export is only used for RRN. +{ + { + ?s adms:identifier ?o + } e:becomes { + ?s persoon:registratie ?o + } +} => { + ?s persoon:registratie ?o +}.