Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added volume issue and page range / extent #17

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions transform_to_workbench/islandora7_to_workbench_common.xquery
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ declare function tc:common_columns($metadata as node(), $cModel as xs:string, $i
"field_subjects_name" : tH:get_subject_name($metadata),
"field_table_of_contents" : tH:get_table_of_contents($metadata),
"field_temporal_subject" : tH:get_subject_temporal($metadata),
(:location/extent:)
"field_detailed_location_volume" : tH:get_detail_volume($metadata),
"field_detailed_location_issue" : tH:get_detail_issue($metadata),
"field_extent" : tH:get_detail_extent($metadata),
(: relatedItem :)
"field_related_item_boolean" : tH:get_related_item_place_boolean($metadata),
"field_related_item_title" : tH:get_related_item_title($metadata),
Expand Down
51 changes: 47 additions & 4 deletions transform_to_workbench/islandora7_to_workbench_utils.xquery
Original file line number Diff line number Diff line change
Expand Up @@ -1350,18 +1350,61 @@ declare function th:get_access_condition($node as node()) as xs:string
normalize-space(string-join($accessConditionList, $th:WORKBENCH_SEPARATOR))
};

(: mods/part/detail type="volume"/number :)

declare function th:get_detail_volume($node as node()) as xs:string
{if ($node/resource_metadata/mods:mods/mods:part/mods:detail[@type='volume']/mods:number/text())
then(string-join($node/resource_metadata/mods:mods/mods:part/mods:detail[@type='volume']/mods:number/text(), $th:WORKBENCH_SEPARATOR))
else (string-join($node/resource_metadata/mods:mods/mods:relatedItem/mods:part/mods:detail[@type='volume']/mods:number/text(), $th:WORKBENCH_SEPARATOR))
};

(: mods/part/detail[@type="issue"]/number :)

declare function th:get_detail_issue($node as node()) as xs:string

{if ($node/resource_metadata/mods:mods/mods:part/mods:detail[@type='issue']/mods:number/text())
then(string-join($node/resource_metadata/mods:mods/mods:part/mods:detail[@type='issue']/mods:number/text(), $th:WORKBENCH_SEPARATOR))
else (string-join($node/resource_metadata/mods:mods/mods:relatedItem/mods:part/mods:detail[@type='issue']/mods:number/text(), $th:WORKBENCH_SEPARATOR))
};


(: mods/part/extent[@unit="page"]/start :)
(: mods/part/extent[@unit="page"]/end :)
(: mods/part/extent[@unit="page"]/list :)


declare function th:get_detail_extent($node as node()) as xs:string

{if ($node/resource_metadata/mods:mods/mods:part/mods:extent/mods:list[text()])
then(string-join($node/resource_metadata/mods:mods/mods:part/mods:extent/mods:list/text(), $th:WORKBENCH_SEPARATOR))

else if($node/resource_metadata/mods:mods//mods:part/mods:extent[mods:start/text()and mods:end/text()])
then(
let $page_start:= $node/resource_metadata/mods:mods//mods:part/mods:extent/mods:start/text()
let $page_end:= $node/resource_metadata/mods:mods//mods:part/mods:extent/mods:end/text()
return string-join(concat($page_start,'-',$page_end), $th:WORKBENCH_SEPARATOR)
)
else if($node/resource_metadata/mods:mods//mods:part/mods:extent[mods:start/text()and not(mods:end/text())])
then(
let $page_start:= $node/resource_metadata/mods:mods//mods:part/mods:extent/mods:start/text()
return string-join(concat('from p. ',$page_start), $th:WORKBENCH_SEPARATOR) )
else if($node/resource_metadata/mods:mods//mods:part/mods:extent[mods:end/text()and not(mods:start/text())])
then(
let $page_end:= $node/resource_metadata/mods:mods//mods:part/mods:extent/mods:end/text()
return string-join(concat('to p. ',$page_end), $th:WORKBENCH_SEPARATOR) )

};

(: ToDo: :)
(: part :)
(: mods/part/detail/title :)
(: mods/part/date :)
(: mods/part/detail[@type="volume"]/number :)
(: mods/part/detail[@type="issue"]/number :)
(: mods/part/extent[@unit="page"]/start :)
(: mods/part/extent[@unit="page"]/end :)


(: ToDo: :)
(: extension :)
(: mods/extension :)


(: ToDo: :)
(: recordInfo :)