From cba62960577231e268a596225d22a14a35d72a2c Mon Sep 17 00:00:00 2001 From: Peter Stadler Date: Fri, 3 Nov 2023 23:11:08 +0100 Subject: [PATCH] fix xpath for updated GND RDF --- modules/app.xqm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/app.xqm b/modules/app.xqm index 1c3bb9fb1..6ec0f1c02 100644 --- a/modules/app.xqm +++ b/modules/app.xqm @@ -1114,8 +1114,12 @@ declare function app:dnb($node as node(), $model as map(*), $lang as xs:string) as map(*) { let $gnd := query:get-gnd($model('doc')) let $dnbContent := er:grabExternalResource('dnb', $gnd, ()) - let $dnbOccupations := ($dnbContent//rdf:RDF/rdf:Description/gndo:professionOrOccupation ! er:resolve-rdf-resource(.))//gndo:preferredNameForTheSubjectHeading/str:normalize-space(.) - let $subjectHeadings := (($dnbContent//rdf:RDF/rdf:Description/gndo:broaderTermInstantial | $dnbContent//rdf:RDF/rdf:Description/gndo:formOfWorkAndExpression) ! er:resolve-rdf-resource(.))//gndo:preferredNameForTheSubjectHeading/str:normalize-space(.) + let $dnbOccupations := + try { ($dnbContent//rdf:RDF/rdf:Description/gndo:professionOrOccupation//rdf:*[starts-with(@rdf:resource, 'https://d-nb.info')] ! er:resolve-rdf-resource(.))//gndo:preferredNameForTheSubjectHeading/str:normalize-space(.) } + catch * { wega-util:log-to-file('warn', string-join(($err:code, $err:description), ' ;; ')) } + let $subjectHeadings := + try { (($dnbContent//rdf:RDF/rdf:Description/gndo:broaderTermInstantial | $dnbContent//rdf:RDF/rdf:Description/gndo:formOfWorkAndExpression) ! er:resolve-rdf-resource(.))//gndo:preferredNameForTheSubjectHeading/str:normalize-space(.) } + catch * { wega-util:log-to-file('warn', string-join(($err:code, $err:description), ' ;; ')) } return map { 'docType' : config:get-doctype-by-id($model?docID),