Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/useFixInsteadOfMorph' into 128-p…
Browse files Browse the repository at this point in the history
…rovenanceInfo
  • Loading branch information
TobiasNx committed Jul 18, 2023
2 parents 2ba72b4 + a728939 commit 0e819d1
Show file tree
Hide file tree
Showing 9 changed files with 41,658 additions and 11,778 deletions.
21 changes: 20 additions & 1 deletion conf/context.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,25 @@
"PostalAddress": "https://schema.org/PostalAddress",
"Place": "https://schema.org/Place",
"GeoCoordinates": "https://schema.org/GeoCoordinates",
"ServiceChannel": "https://schema.org/ServiceChannel"
"ServiceChannel": "https://schema.org/ServiceChannel",
"picaPPN": "http://purl.org/lobid/lv#picaPPN",
"replacedBy": "https://schema.org/replacedBy",
"replaces" : "https://schema.org/replaces",
"gndIdentifier" : "https://d-nb.info/standards/elementset/gnd#gndIdentifier",
"note" : {
"@id" : "http://id.loc.gov/ontologies/bibframe/note",
"@container" : "@set"
},
"sigel": "http://purl.org/lobid/lv#sigel",
"worldcatRegistryId" : "http://purl.org/lobid/lv#worldcatRegistryId",
"parentOrganization": {
"@type": "@id",
"@id": "https://schema.org/parentOrganization"
},
"sourceOrganization": {
"@type": "@id",
"@id": "https://schema.org/sourceOrganization"
},
"librariesOrgID": "http://purl.org/lobid/lv#librariesOrgID"
}
}
86 changes: 23 additions & 63 deletions conf/fix-dbs.fix
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()
Loading

0 comments on commit 0e819d1

Please sign in to comment.