diff --git a/zml2lido/data/xsl/zml2lido/classificationWrap.xsl b/zml2lido/data/xsl/zml2lido/classificationWrap.xsl index b4e0cdb..5c7f49e 100644 --- a/zml2lido/data/xsl/zml2lido/classificationWrap.xsl +++ b/zml2lido/data/xsl/zml2lido/classificationWrap.xsl @@ -128,36 +128,41 @@ - - - - - - - - classification from Objekttyp - - - - - - - - - - - - - - - - - + + + + + + + + + Objekttyp für CCC-Portal + + + + - - + + + + + + + + + + + + + + @@ -249,10 +254,10 @@ - + diff --git "a/zml2lido/data/xsl/zml2lido/event-Auff\303\274hrung.xsl" "b/zml2lido/data/xsl/zml2lido/event-Auff\303\274hrung.xsl" index 604ce9e..16fa028 100644 --- "a/zml2lido/data/xsl/zml2lido/event-Auff\303\274hrung.xsl" +++ "b/zml2lido/data/xsl/zml2lido/event-Auff\303\274hrung.xsl" @@ -25,7 +25,7 @@ and z:vocabularyReference/z:vocabularyReferenceItem/z:formattedValue = $aufführendeRollen]"/> - + Aufführung diff --git a/zml2lido/data/xsl/zml2lido/event-Auftrag.xsl b/zml2lido/data/xsl/zml2lido/event-Auftrag.xsl index fc5fe0f..9cba1a5 100644 --- a/zml2lido/data/xsl/zml2lido/event-Auftrag.xsl +++ b/zml2lido/data/xsl/zml2lido/event-Auftrag.xsl @@ -24,7 +24,7 @@ and z:vocabularyReference/z:vocabularyReferenceItem/z:formattedValue = $beauftragendeRollen]"/> - + Auftrag diff --git a/zml2lido/data/xsl/zml2lido/event-Ausgrabung.xsl b/zml2lido/data/xsl/zml2lido/event-Ausgrabung.xsl index 42afdd6..5ce20e1 100644 --- a/zml2lido/data/xsl/zml2lido/event-Ausgrabung.xsl +++ b/zml2lido/data/xsl/zml2lido/event-Ausgrabung.xsl @@ -20,7 +20,7 @@ and z:vocabularyReference/z:vocabularyReferenceItem/z:formattedValue = $grabendeRollen]"/> - + Ausgrabung diff --git a/zml2lido/data/xsl/zml2lido/event-Ausstellung.xsl b/zml2lido/data/xsl/zml2lido/event-Ausstellung.xsl index b1e495b..0c842bb 100644 --- a/zml2lido/data/xsl/zml2lido/event-Ausstellung.xsl +++ b/zml2lido/data/xsl/zml2lido/event-Ausstellung.xsl @@ -20,7 +20,7 @@ - + Ausstellung diff --git a/zml2lido/data/xsl/zml2lido/event-Benin.xsl b/zml2lido/data/xsl/zml2lido/event-Benin.xsl index e0a7d50..b0545fe 100644 --- a/zml2lido/data/xsl/zml2lido/event-Benin.xsl +++ b/zml2lido/data/xsl/zml2lido/event-Benin.xsl @@ -17,7 +17,7 @@ z:vocabularyReference[@name = 'PublicationVoc' and z:vocabularyReferenceItem/@id = '1810139'] ]"> - + This is an "artificial" event to identify all Benin objects for 3 Wege Projekt Herstellung diff --git a/zml2lido/data/xsl/zml2lido/event-Entwurf.xsl b/zml2lido/data/xsl/zml2lido/event-Entwurf.xsl index cc8fdfe..2a22397 100644 --- a/zml2lido/data/xsl/zml2lido/event-Entwurf.xsl +++ b/zml2lido/data/xsl/zml2lido/event-Entwurf.xsl @@ -22,7 +22,7 @@ and z:vocabularyReference/z:vocabularyReferenceItem/z:formattedValue = $entwerfendeRollen]"/> - + Entwerfen diff --git a/zml2lido/data/xsl/zml2lido/event-Erwerb.xsl b/zml2lido/data/xsl/zml2lido/event-Erwerb.xsl index eb3c8a5..3dacfa2 100644 --- a/zml2lido/data/xsl/zml2lido/event-Erwerb.xsl +++ b/zml2lido/data/xsl/zml2lido/event-Erwerb.xsl @@ -30,7 +30,7 @@ - + Erwerb diff --git a/zml2lido/data/xsl/zml2lido/event-Fund.xsl b/zml2lido/data/xsl/zml2lido/event-Fund.xsl index a712c99..f511ad5 100644 --- a/zml2lido/data/xsl/zml2lido/event-Fund.xsl +++ b/zml2lido/data/xsl/zml2lido/event-Fund.xsl @@ -52,7 +52,7 @@ ]"/> - + Fund (Aktivität) diff --git a/zml2lido/data/xsl/zml2lido/event-Herstellung.xsl b/zml2lido/data/xsl/zml2lido/event-Herstellung.xsl index 1f4905b..cc2741f 100644 --- a/zml2lido/data/xsl/zml2lido/event-Herstellung.xsl +++ b/zml2lido/data/xsl/zml2lido/event-Herstellung.xsl @@ -125,7 +125,7 @@ or z:repeatableGroup[@name = 'ObjMaterialTechniqueGrp'] or z:repeatableGroup[@name = 'ObjCulturalContextGrp'] "> - + Herstellung diff --git a/zml2lido/data/xsl/zml2lido/event-Sammeln.xsl b/zml2lido/data/xsl/zml2lido/event-Sammeln.xsl index 6bf21e5..7b80ba1 100644 --- a/zml2lido/data/xsl/zml2lido/event-Sammeln.xsl +++ b/zml2lido/data/xsl/zml2lido/event-Sammeln.xsl @@ -26,7 +26,7 @@ and z:vocabularyReference/z:vocabularyReferenceItem/z:formattedValue = $sammelndeRollen]"/> - + Sammeln diff --git "a/zml2lido/data/xsl/zml2lido/event-Ver\303\266ffentlichung.xsl" "b/zml2lido/data/xsl/zml2lido/event-Ver\303\266ffentlichung.xsl" index fe07b35..7cd3bf7 100644 --- "a/zml2lido/data/xsl/zml2lido/event-Ver\303\266ffentlichung.xsl" +++ "b/zml2lido/data/xsl/zml2lido/event-Ver\303\266ffentlichung.xsl" @@ -19,7 +19,7 @@ and z:vocabularyReference/z:vocabularyReferenceItem/z:formattedValue = $veröffentlichendeRollen]"/> - + Veröffentlichung diff --git a/zml2lido/data/xsl/zml2lido/event-Zuordnung.xsl b/zml2lido/data/xsl/zml2lido/event-Zuordnung.xsl index 0baea07..dec60ce 100644 --- a/zml2lido/data/xsl/zml2lido/event-Zuordnung.xsl +++ b/zml2lido/data/xsl/zml2lido/event-Zuordnung.xsl @@ -17,7 +17,7 @@ - + - + geistige Schöpfung diff --git a/zml2lido/data/xsl/zml2lido/event-unknown.xsl b/zml2lido/data/xsl/zml2lido/event-unknown.xsl index d20f152..eab32a0 100644 --- a/zml2lido/data/xsl/zml2lido/event-unknown.xsl +++ b/zml2lido/data/xsl/zml2lido/event-unknown.xsl @@ -33,7 +33,7 @@ z:vocabularyReference/@name = 'RoleVoc' and z:vocabularyReference/z:vocabularyReferenceItem/z:formattedValue = $zugeordnet]"/> - + Unbekanntes Ereignis diff --git a/zml2lido/data/xsl/zml2lido/func.xsl b/zml2lido/data/xsl/zml2lido/func.xsl index a939e60..5f843cd 100644 --- a/zml2lido/data/xsl/zml2lido/func.xsl +++ b/zml2lido/data/xsl/zml2lido/func.xsl @@ -204,7 +204,7 @@ @name eq normalize-space($target) and @lang eq normalize-space($lang) ]/text()"/> - + ERROR: src-term empty! diff --git a/zml2lido/linkChecker.py b/zml2lido/linkChecker.py index 9693b11..e4a78fe 100644 --- a/zml2lido/linkChecker.py +++ b/zml2lido/linkChecker.py @@ -38,7 +38,8 @@ def __init__(self, *, src: str | Path, chunks: bool = False) -> None: self.data = etree.parse(str(src)) user, pw, baseURL = get_credentials() self.client = MpApi(baseURL=baseURL, user=user, pw=pw) - self.rwc = RelWorksCache(maxSize=20_000) + cache_dir = Path(src).parent + self.rwc = RelWorksCache(maxSize=20_000, cache_dir=cache_dir) self.rwc.load_cache_file() # load file if it exists if chunks: diff --git a/zml2lido/relWorksCache.py b/zml2lido/relWorksCache.py index 219ecbe..59e1da0 100644 --- a/zml2lido/relWorksCache.py +++ b/zml2lido/relWorksCache.py @@ -35,13 +35,12 @@ # from zml2lido import NSMAP NSMAP = {"l": "http://www.lido-schema.org"} -cache_path = Path("relWorks_cache.xml") - class RelWorksCache: - def __init__(self, *, maxSize: int = 20_000) -> None: + def __init__(self, *, maxSize: int = 20_000, cache_dir: Path) -> None: self.cache = Module() self.maxSize = maxSize + self.cache_path = cache_dir / "relWorks_cache.xml" user, pw, baseURL = get_credentials() self.client = MpApi(baseURL=baseURL, user=user, pw=pw) @@ -116,25 +115,27 @@ def length(self) -> int: """ return len(self.cache) - def load_cache_file(self, *, path: Path = cache_path) -> Path: + def load_cache_file(self) -> Path: """ Load a cache file. If it doesn't exist, do nothing. The content of file is added to the existing in-memory cache. Returns the path used for the cache file. """ + path: Path = self.cache_path if path.exists(): newM = Module(file=path) self.cache += newM return path - def save(self, *, path: Path = cache_path) -> Path: + def save(self) -> Path: """ Save current in-memory cache with relWork information to disk. Supply a path if you want a non-default file path. Returns the path used for the cache file. """ + path: Path = self.cache_path self.cache.toFile(path=path) return path