台大圖書館系統資訊組 江玉婷
2019/03/26
NTU Scholars
文件資料處理
TAIR團隊
陳光華館長、陳慧華組長
吳瑟量、江玉婷、林柏源、蔡玉紋、邱莉媛
大綱
• 系統資料結構
• 資料移轉
• 相關設定
資料架構
研究人員視角(學術庫) 文件視角(機構典藏)
檔案 檔案集
文件 系所
學院
Community
Collection
Item Item
Collection
Item
Bundle
Bitstream Bitstream
Bundle
Bitstream Item
子單位
單位
研究
RP Relation
人員(Authority)
資料架構
機構典藏文件 (機構成員產出)
學術庫收錄文件
(現職人員著作)
資料結構
• Metadata內容種類
• Descriptive Metadata
• 描述物件相關資訊,可以提供檢索
• 預設為Dublin Core
• Administrative Metadata
• 管理用資訊,如版權,存取權限,版本控制等
• Structural Metadata
• 描述欄位與其他欄位的關係
• Preservation Metadata
• 物件建立及變更等歷史資訊
資料結構
• 所有物件都有Metadata
• Communities, Collections, Items, EPeople, Groups
• 使用預設DC格式
• Metadatavalue table
• Collection name: dc.title
資料結構
• 彈性的Metadata 資料欄位 (table: metadatavalue)
• Text-Field:欄位內容
• Authority:權威資料代碼參照
• Confidence:可信度
• Place:出現順序
• Lang :語言
• Resource_type
• 新增其他物件如:eperson group(6), eperson(7)…
resource_type resource_id metadata_field metadata_value
Item 55 title 臺灣原住民基本法之回…
Item 55 author 王泰升
item 55 date 1997
title author date
臺灣原住民基本法之回… 王泰升 1997
資料移轉 • Community & Collection
• 文件及檔案
• 帳號
• 權限
• 姓名權威資料
注意事項
由於新舊系統架構差異,
請勿直接於資料庫表格中新增/編輯資料,
均需透過系統後台或command line指令工具
Community & Collection
• 資料架構
• Collection:Dspace裝資料的容器,item一定要放在collection下
• Community:collection的類別,可以有一層或多層
• 建議
• 以異動性低的最小實體單位為collection
• 不再以資料類型作collection
• 建立方式
• 單筆重新建立
• 以xml檔匯入
Community & Collection
• xml匯入資料格式
• 匯入指令
[dspace]/bin/dspace structure-builder -f /path/to/source.xml -o path/to/output.xml -e admin@user.com
<community identifier="123456789/1">
<name>Community Name</name>
<description>Descriptive text</description>
<intro>Introductory text</intro>
<copyright>Special copyright notice</copyright>
<sidebar>Sidebar text</sidebar>
<community identifier="123456789/2">
<name>Sub Community Name</name>
<community identifier="123456789/3"> ...[ad infinitum]...
</community>
</community>
<collection identifier="123456789/4">
<name>Collection Name</name>
<description>Descriptive text</description>
…….
<license>Special licence</license>
<provenance>Provenance information</provenance>
</collection>
</community>
</import_structure>
Community & Collection
• Community架構設定
• 建立解除關聯
[dspace]/bin/dspace community-filiator --set --parent=parentID -- child=childID
[dspace]/bin/dspace community-filiator --remove --parent=parentID -
-child=childID
OAI資料同步
• 安裝NTUR patch程式以支援OAI-ORE
• Open Archives Initiative Object Exchange and Reuse
• 設定更新
• config/dspace.cfg
• config/oaicat.properties
• 程式更新
org.dspace.app.oai.DSpaceRecordCatalog org.dspace.app.oai.PluginCrosswalk
org.dspace.content.crosswalk.OREDisseminationCrosswalk org.dspace.content.crosswalk.OREIngestionCrosswalk
org.dspace.content.crosswalk.XHTMLHeadDisseminationCrosswalk Crosswalks.ore=org.dspace.app.oai.PluginCrosswalk
ore.authoritative.source = oai
plugin.named.org.dspace.content.crosswalk.IngestionCrosswalk = \
…..
org.dspace.content.crosswalk.OREIngestionCrosswalk= ORE
plugin.selfnamed.org.dspace.content.crosswalk.IngestionCrosswalk = ……
org.dspace.content.crosswalk.OREIngestionCrosswalk
OAI資料同步
(Open Archives Initiative Object Exchange and Reuse)
• 欄位轉換及對應
• 自動產生所需欄位
• dc.date.issued
• dc.contributor.author (dc.creator)
• dc.relation.journalVolume, dc.relation.journalIssue, dc.relation.pages (dc.relation)
• 多值欄位切分:dc.subject及dc.contributor.author
• 以利權威代碼資料對應
• 隱藏資料無法移轉
OAI資料同步
• 設定collection OAI來源
• 後台設定
• 資料表直接設定
• harvested_collection
• 排程:定時與來源資料端同步
$DSPACE/bin/dspace oai import
• 手動同步單一collection
dspace dsrun
org.dspace.app.harvest.Harvest -r -e admin@ntu.edu.tw -c [collection
internal id]
整批匯入
• 將舊系統資料匯出,整理成CRIS系統所需資料格式
• 需選擇特定collection
• 內容格式
• DSpace Simple Archive Format
• CSV Metadata:管理介面匯出資料
• DSpace Simple Archive Format (SAF)
archive_directory/
item_000/
dublin_core.xml -- qualified Dublin Core metadata for metadata fields belonging to the dc schema
metadata_[prefix].xml -- metadata in another schema, the prefix is the name of the schema as registered with the metadata registry
contents -- text file containing one line per filename
collections -- text file that contains the handles of the collections the item will belong two. Optional. Each handle in a row.
-- Collection in first line will be the owning collection file_1.doc -- files to be added as bitstreams to the item
file_2.pdf item_001/
dublin_core.xml contents
file_1.png ...
整批匯入— SAF
整批匯入— SAF
• NTUR SAF匯出
[dspace]/bin/dspace export --type=COLLECTION --id=collectionID_or_handle - -dest=/path/to/destination --number=seq_num
• 執行匯入
• 管理整批匯入(有檔案大小限制)
• 伺服器執行指令
[dspace]/bin/dspace import
--add --eperson=joe@user.com
--collection=CollectionID
--source=items_dir
整批匯入— MetadataOnly
• 匯出現有清單
• 後台文件管理瀏覽 單一系統後匯出
• 整理成所需格式
• 轉換為utf-8 csv檔
• 內容結構
• 標題列:id,
collection, action, [metadata_column]
• 新增:在id欄位寫+
整批匯入— MetadataOnly
• 匯入執行方式
• 管理介面
• 有筆數限制,可設定
${dspace.dir}/config/module/bulkedit.cfg
• 可一次匯入多個collection
• 管理內容匯入後設資料
• 執行指令
${dspace.dir}/bin/metadata-import –f [file full path] –e [eperson
email]
整批匯入— MetadataOnly
整批匯入—MetadataOnly
• 其他匯入格式
• 管理內容整批匯入
• Biblio-Transformation-Engine (BTE)
• arXiv
• BibTeX (*.bib)
• CiNii
• CrossRef
• CSV (*.csv)
• EndNote
• OAI-PMH
• PubMed
• RIS (*.ris)
• TSV (*.tsv)
[dspace]/bin/dspace import -b -m mapFile -e [email] -c 123456789/1 -s
path-to-my-
資料取得介面(API) —資料物件
• REST API http://<dspace-webapp>/rest/
• 資料物件處理
• 登入/登出
功能
Community Collection Item Bitstream
查詢所有列表 V V V V
查詢子物件 V V V
查詢單一物件資訊 V V V V
建立物件 V V V V
更新物件及Metadata V V V V
刪除物件 V V V V
查詢/更新存取政策 V V
資料取得介面(API)—資料物件
• 執行方式
• GET:查詢
• GET /communities/{communityId}/collections - Returns an array of collections
• GET /items/{item id}/metadata - Return metadata of the specified item.
• POST:新增、修改、刪除、登入
• POST /items/{item id}/bitstreams - Add a bitstream to the specified item.
• DELETE /communities/{communityId}/collections/{collectionId}
• POST /login - Method for logging into the DSpace RESTful API.
{"email":"test@dspace","password":"pass"}. Returns a token which must be included in future requests in the "rest-dspace-token" header.
• 回傳物件: JSON OR XML
Item Object
{"id":14301,"name":"2015 Annual
Report","handle":"123456789/13470","type":"item","link":"/rest/items/14301","lastModi
登入授權機制(Authentication)
• 本地端密碼登入
• SSO標準協定
• Shibboleth
• LDAP
• X.509
• IP授權
${dspace.dir}/config/dspace.cfg
plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.IPAuthentication
${dspace.dir}/config/modules/authentication-ip.cfg
ip.GROUPNAME = iprange[, iprange ...]
• 外部登入
• ORCiD
• 客製化:NTUAuthentication
登入授權機制(Authentication)
${dspace.dir}/config/modules/authentication.cfg
plugin.sequence.org.dspace.authenticate.AuthenticationMethod = org.dspace.authenticate.OAuthAuthenticationMethod,
org.dspace.authenticate.PasswordAuthentication, org.dspace.authenticate.NTUAuthentication
${dspace.dir}/config/modules/authentication-[method].cfg
帳號
• 主機本地端帳號:Dspace EPerson
• 新系統管理介面無整批建立帳號功能
• command line使用者操作
• 新增,修改,刪除
• 整批處理
• 刪除久未登入的使用者
[dspace]/bin/dspace user --add --email jquser@example.com -g John -s User --password hiddensecret [dspace]/bin/dspace user --modify -m george@example.com
[dspace]/bin/dspace user --delete -n martha
[DSpace]/bin/dsrun org.dspace.eperson.Groomer -a -b 07/20/1969
[DSpace]/bin/dsrun org.dspace.eperson.Groomer -a -b 07/20/1969 -d
帳號
• ORCiD
• 不存在的帳號自動建立
config/modules/authentication-oauth.cfg autoregister=true
• 單一簽入(台大規格)
• 提供single sign on 之介接API (web service)
• 需有技術人員開發界接程式
• 運作概念
• 遠端認證介面 (各校提供url)
• 回傳認證結果 (各校提供 session)
• 若認證通過,以session number取回使用者資料 (各校提供API)
• 若使用者第一次登入,則新建帳號 (NTUR)
依使用者所屬系所自動授予上傳權限給名稱相同的社群 (NTUR)
權限—系統功能使用權限
• 功能使用權限:EpersonGroup
• 讀取、上傳、編輯、刪除、審核、整批上傳、類別管理
• 系統無提供整批設定工具
• 資料庫處理
• 取得新舊資料表之collection_id, eperson_id, epersongroup_id對應後,
以程式整批處理
• epersongroup:群組主表
• 到metadatavalue table查詢群組名稱:resource_type_id=6
• 命名規則:COLLECTION_[collection_id]_ACTION_NAME
• Epersongroup2eperson:群組與使用者關聯
• Group2group:群組間關聯
資料取用控制(Authorization)
• 資料主體
• Community
• Collection
• Item
• Bitstream
• 授權對象
• Eperson
• Eperson Group
• Anonymous
• Administrator
• COLLECTION_XXX_SUBMIT
• COLLECTION_XXX_WORKFLOW
• COLLECTION_XXX_ADMIN
• 存取權限
• 適用日期
POLICY NAME
說明 適用物件READ 讀取 Community
Collection ItemBitstream
WRITE 寫入/編輯
ADD/REMOVE 新增/刪除
WORKFLOW XX 審核
ADMIN 管理
DEFAULT_ITEM_READ 預設讀取文件 Collection DEFAULT_BITSTREAM_READ 預設讀取檔案
WITHDRAWN_READ 讀者隱藏文件
資料取用控制(Authorization)
• 一般使用者權限設定
• Collection上傳權限:COLLECTION_XXXX_SUBMIT
• 上傳後之item並無自動給予WRITE/REMOVE權限
• 需具有COLLECTION_ADMIN以上角色的使用者(群組)才能修改和刪除
• 以版本控制取代文件編輯:上傳者可建立版本
資料取用控制(Authorization)
• 資料認領 (claim publication)
• 資料存取申請 (request a copy)
• 檔案不開放下載時,向原上傳者申請資料存取權
權限—資料存取
• 權限設定元件
• 設定資料主體:社群、類別、文件、檔案
• 授權對象:使用者或群組
• 動作:讀取、新增、編輯、刪除、審核、類別管理員、整批 上傳…
• 存取日期限制:正向標示可讀取日期
• 整批設定
• 管理存取控制授權進階/文件大量政策管理工具
• 無法整批設定開放存取日期
• 以IP群組設定方式取代舊有各文件瀏覽限制設定
${dspace.dir}/config/modules/authentication-ip.cfg
ip.GROUPNAME = iprange[, iprange ...]
姓名權威資料
• NTUR做法:
• 於後台建立作者姓名變異表
• 以作者查詢文件時,系統自動做詞彙擴展,增加搜尋廣度
• 無法解決同名同姓問題
• NTU Scholars做法:
• 於研究人員(RP)主檔中建立別名
• 查詢研究人員時,會依作者各種姓名的建檔查詢可能符合資料,再選 擇特定研究人員進入取得其所屬文件
• 匯入研究人員主檔時,可一併匯入姓名權威資料
相關設定
• 權威資料及下拉式選單
• 外部資料來源參照
• 各種key值設定
• SOLR索引
• 背景排程工作
權威資料管理 (Authority Management)
• 權威代碼 (Authority Key)
• 欄位權威參照設定
${dspace.dir}/config/dspace.cfg
• 研究物件權威資料定義 (ChoiceAuthority plugin)
• 欄位關聯設定
• 新增文件資料時
• 自動建立新的權威物件
• 自動建立文件與權威物件連結
choices.plugin.dc.contributor.author = RPAuthority choices.presentation.dc.contributor.author = suggest authority.controlled.dc.contributor.author = true
plugin.named.org.dspace.content.authority.ChoiceAuthority = org.dspace.app.cris.integration.RPAuthority = RPAuthority,\
org.dspace.app.cris.integration.OUAuthority = OUAuthority,\
權威資料管理 (Authority Management)
• 設定item與權威物件之關聯
權威資料管理 (Authority Management)
• 權威資料參照統計:管理內容權威管埋
資料選擇管理 (Choice Management)
• 應用時機
• 單筆資料上傳
• 單筆資料編輯
• Metadata輸入之選項參照
• Input-form.xml檔內簡單參照
• 階層性控制詞彙
• OWL或RDF相容
choices.plugin.dc.type = common_types choices.presentation.dc.type = select
${dspace.dir}/config/input-forms.xml
<field>
<dc-schema>dc</dc-schema>
<dc-element>type</dc-element>
<dc-qualifier></dc-qualifier>
<repeatable>true</repeatable>
<label>Type</label>
<input-type value-pairs-
name="common_types">dropdown</input-type>
<hint></hint>
<required></required>
<vocabulary closed=“false”>abc</vocabulary>
</field>
…
<select name="common_types">
<option VALUE=“article">Article</option>
<option VALUE=“book”>Book</option>
……
</select>
config/controlled-vocabularies/abc.xml
外部資料來源參照欄位對應
• Biblio-Transformation-Engine (BTE)
• 整批匯入指令
[dspace]/bin/dspace import -b -m mapFile -e example@email.com -c 123456789/1 -s path-to-my-xxxxx-file -i
[xxxxXML]
• 欄位對應設定[dspace]/config/spring/api/bte.xml
<bean name="wosInputMap" class="java.util.HashMap"
scope="prototype">
<constructor-arg>
<map key-type="java.lang.String" value- type="java.lang.String">
<entry key="isiId" value="isiId" />
<entry key="doi" value="doi" />
<entry key="issn" value="jissn" />
<entry key="journalTitle" value="journal" />
<entry key="title" value="title" />
<entry key="year" value="issued" />
<entry key="volume" value="volume" />
<bean name="outputMap" class="java.util.HashMap" scope="prototype">
<constructor-arg>
<map key-type="java.lang.String" value-type="java.lang.String">
<entry value="jissn" key="dc.identifier.issn" />
<entry value="jeissn" key="dc.identifier.eissn" />
<entry value="pisbn" key="dc.identifier.isbn" />
<entry value="eisbn" key="dc.identifier.eisbn" />
<entry value="journal" key="dc.relation.ispartof" />
<entry value="proceedingsPaper.journal"
key="dc.relation.ispartofbook" />
外部資料來源參照欄位對應
• crosswalks
[dspace]/config/crosswalks/
• oaidc.properties
• orcid-work-metadata.properties
• bibtex.template
• citation.template
• endnote.template
# <schema>.<element>.(<qualifier|*>) = element oai_dc
# you can map more then one metadata to the same oai_dc element,
# see for example (dc.contributor.editor, dc.contributor.advisor, etc.) dc.title.* = title
dc.contributor.author = creator dc.contributor = contributor dc.contributor.editor = contributor dc.contributor.advisor = contributor dc.contributor.illustrator = contributor dc.contributor.other = contributor dc.date.* = date
dc.description = description
dc.description.abstract = description dc.description.sponsorship = description
dc.description.statementofresponsibility = description
外部資料來源參照欄位對應
• Google索引優化
• Google Scholar Metadata對應
• Highwire press tag (in HTML HEAD tag)
• Prefix: citation_
• 系統設定
• 開啟highware press tag功能
${dspace.dir}/config/dspace.cfg google-metadata.enable = true
• 設定欄位對應
${dspace.dir}/config/crosswalks/google-metadata.properties
google.citation_title = dc.title
google.citation_publisher = dc.publisher
<meta name="citation_keywords" content="article" />
<meta name="citation_title" content="Examining the socio-technical determinants influencing government agencies' open data publication: A study in Taiwan"
<meta name="citation_issn" content="0740-624X" />
<meta name="citation_language" content="aaa" />
<meta name="citation_author" content="TUNG-MOU YANG" />
<meta name="citation_date" content="2016" />
<meta name="citation_abstract_html_url" content="https://scholars.lib.ntu.edu.tw/handle/123456789/25612" />
各種key值設定
• google:[dspace]/config/dspace.cfg
jspui.google.analytics.key=
key.googleapi.maps =
• 查詢外部資料庫API [dspace]/config/dspace.cfg
#### Lookup submission provider ####
submission.lookup.scopus.apikey =
submission.lookup.scivalcontent.apikey =
submission.lookup.webofknowledge.ip.authentication = true submission.lookup.webofknowledge.user =
submission.lookup.webofknowledge.password =
Solr索引
• 索引指令
[dspace]/bin/dspace index-discovery [-cbhf[r <item handle>]]
• 索引設定
• [dspace]/config/modules/discovery.cfg
discovery.search.server
discovery.search.server=[http://localhost:8080/solr/search]
discovery.index.authority.ignore[.field]
discovery.index.authority.ignore=true
discovery.index.authority.ignore.dc.contributor.author=false discovery.index.authority.ignore-prefered[.field]
discovery.index.authority.ignore-prefered=true
discovery.index.authority.ignore-prefered.dc.contributor.author=false
Solr索引設定
• [dspace]/config/spring/api/discovery.xml
• Sidebar facets:searchFilterAuthor,searchFilterSubject,searchFilterIssued
• Search filters:searchFilterTitle , searchFilterAuthor , searchFilterSubject ,
searchFilterIssued
• Sort fields:sortTitle,sortDateIssued
• defaultFilterQueries
• Recent Submissions.
• Hit highlighting
• The fields dc.title, dc.contributor.author & dc.subject can contain hit highlighting.
• The dc.description.abstract & full text field are used to render search snippets.
• Non indexed metadata fields