-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/useFixInsteadOfMorph' into 128-p…
…rovenanceInfo
- Loading branch information
Showing
9 changed files
with
41,658 additions
and
11,778 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,36 @@ | ||
# <?xml version="1.0" encoding="UTF-8"?> | ||
# <!-- Copyright 2014-2016, hbz. Licensed under the Eclipse Public License 1.0 --> | ||
# | ||
# <maps> | ||
# <filemap name="iso3-iso2-map" | ||
# files="http://lobid.org/download/lookup-tables/data/iso3-iso2-map.csv" /> | ||
# </maps> | ||
do once("maps") | ||
put_filemap("conf/iso3-iso2-map.csv","iso3-iso2-map", sep_char:"\t") | ||
end | ||
|
||
# <metamorph xmlns="http://www.culturegraph.org/metamorph" | ||
# xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1" | ||
# entityMarker="."> | ||
# <rules> | ||
# <!-- use inr as _id --> | ||
# <data source="inr" name="_id"> | ||
# <replace pattern=" " with=""/> | ||
# </data> | ||
# <data source="inr" name="inr"> | ||
# <replace pattern=" " with=""/> | ||
# </data> | ||
# <data source="isil" name="isil"> | ||
# <not-equals string="NULL"/> | ||
# <replace pattern=" " with=""/> | ||
# <not-equals string=""/> | ||
# <replace pattern="/" with="-"/> | ||
# <urlencode/> | ||
# </data> | ||
|
||
|
||
replace_all("inr"," ","") | ||
copy_field("inr","_id") | ||
|
||
replace_all("isil"," ","") | ||
replace_all("isil","/","-") | ||
if any_match("isil","NULL") | ||
remove_field("isil") | ||
end | ||
uri_encode("isil") | ||
replace_all("isil","%2D","-") | ||
replace_all("inr"," ","") | ||
copy_field("inr","_id") | ||
|
||
replace_all("isil"," ","") | ||
replace_all("isil","/","-") | ||
if any_match("isil","NULL") | ||
remove_field("isil") | ||
end | ||
uri_encode("isil") # z | ||
replace_all("isil","%2D","-") | ||
|
||
|
||
# <data source="lat" name="latDbs" /> | ||
# <data source="lon" name="lonDbs" /> | ||
copy_field("lat","latDbs") | ||
copy_field("lon","lonDbs") | ||
|
||
# TODO: What to do here? | ||
# <data source="_else"> | ||
# <not-equals string="NULL" /> | ||
# </data> | ||
copy_field("lat","latDbs") | ||
copy_field("lon","lonDbs") | ||
|
||
|
||
# <choose name="addressCountry"> | ||
# <data source="iso"> | ||
# <lookup in="iso3-iso2-map" /> | ||
# </data> | ||
# <data source="_id"> | ||
# <constant value="DE"/> | ||
# </data> | ||
# </choose> | ||
if exists("iso") | ||
copy_field("iso","dbs_addressCountry") | ||
lookup("dbs_addressCountry","iso3-iso2-map") | ||
else | ||
add_field("dbs_addressCountry","DE") | ||
end | ||
|
||
if exists("iso") | ||
copy_field("iso","dbs_addressCountry") | ||
lookup("dbs_addressCountry","iso3-iso2-map") | ||
else | ||
add_field("dbs_addressCountry","DE") | ||
end | ||
# TODO: What to do here? Is there a way to delete all Values, | ||
# that have a certain value e.g. configurable vacuum() | ||
|
||
vacuum() | ||
# <data source="_else"> | ||
# <not-equals string="NULL" /> | ||
# </data> | ||
|
||
# </rules> | ||
|
||
# </metamorph> | ||
vacuum() |
Oops, something went wrong.