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..0325fd5 --- /dev/null +++ b/config/reasoner/dl2op/main-info/phone_number.n3 @@ -0,0 +1,54 @@ +PREFIX string: +PREFIX e: +PREFIX schema: +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: + +{ + ?s schema:telephone ?number. + + # number not matches regex + + ?number string:notMatches """[a-zA-Z]""". + + # Remove all non digits + ( ?number """[^+\\d]""" "" ) string:replace ?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 ?result. + + # ?result string:matches """^+((32\\d{8})|(324\\d{8})|((?!32)\\d+))$""". + ?result string:matches """^\\+((32\\d{8})|(324\\d{8})|((?!32)\\d+))$""". + + ( "tel:" ?result ) string:concatenation ?parsed_result . + + { + ?s schema:telephone ?number. + } e:becomes { + ?s schema:telephone ?parsed_result . + }. + +} => { + ?s schema:telephone ?parsed_result . +}. diff --git a/config/reasoner/dl2op/main/phone_number.n3 b/config/reasoner/dl2op/main/phone_number.n3 index e04eb47..f83f5ad 100644 --- a/config/reasoner/dl2op/main/phone_number.n3 +++ b/config/reasoner/dl2op/main/phone_number.n3 @@ -1,6 +1,25 @@ PREFIX string: PREFIX e: PREFIX schema: +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: { ?s schema:telephone ?number.