diff --git a/config/reasoner/dl2op/main-info/phone_number.n3 b/config/reasoner/dl2op/main-info/phone_number.n3 index f83f5ad..da5ce99 100644 --- a/config/reasoner/dl2op/main-info/phone_number.n3 +++ b/config/reasoner/dl2op/main-info/phone_number.n3 @@ -2,46 +2,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. - # number not matches regex - - ?number string:notMatches """[a-zA-Z]""". - # Remove all non digits - ( ?number """[^+\\d]""" "" ) string:replace ?scrape_result. + ( ?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 ?result. + ( ?default_be """\\+320""" "+32" ) string:replace ?replace_320. - # ?result string:matches """^+((32\\d{8})|(324\\d{8})|((?!32)\\d+))$""". - ?result string:matches """^\\+((32\\d{8})|(324\\d{8})|((?!32)\\d+))$""". + ( ?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 . - ( "tel:" ?result ) string:concatenation ?parsed_result . - { ?s schema:telephone ?number. } e:becomes { @@ -50,4 +29,4 @@ PREFIX xsd: } => { ?s schema:telephone ?parsed_result . -}. +}. \ No newline at end of file diff --git a/config/reasoner/dl2op/main/phone_number.n3 b/config/reasoner/dl2op/main/phone_number.n3 index f83f5ad..da5ce99 100644 --- a/config/reasoner/dl2op/main/phone_number.n3 +++ b/config/reasoner/dl2op/main/phone_number.n3 @@ -2,46 +2,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. - # number not matches regex - - ?number string:notMatches """[a-zA-Z]""". - # Remove all non digits - ( ?number """[^+\\d]""" "" ) string:replace ?scrape_result. + ( ?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 ?result. + ( ?default_be """\\+320""" "+32" ) string:replace ?replace_320. - # ?result string:matches """^+((32\\d{8})|(324\\d{8})|((?!32)\\d+))$""". - ?result string:matches """^\\+((32\\d{8})|(324\\d{8})|((?!32)\\d+))$""". + ( ?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 . - ( "tel:" ?result ) string:concatenation ?parsed_result . - { ?s schema:telephone ?number. } e:becomes { @@ -50,4 +29,4 @@ PREFIX xsd: } => { ?s schema:telephone ?parsed_result . -}. +}. \ No newline at end of file