https://github.com/zuki/ruby-bibframe
https://github.com/zuki/ruby-bibframe
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zuki/ruby-bibframe
- Owner: zuki
- License: mit
- Created: 2014-07-15T06:22:46.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-21T08:11:05.000Z (almost 12 years ago)
- Last Synced: 2024-12-27T13:10:20.725Z (over 1 year ago)
- Language: Ruby
- Size: 414 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Bibframe
[marc2bibframe](https://github.com/lcnetdev/marc2bibframe)のXQueryをRubyに変換した、MARCXMLレコードを[Bibframe](http://www.loc.gov/bibframe/)形式に変換するRubyGem。
## インストール
以下をアプリケーションのGemfileに追加する:
gem 'ruby-bibframe', :git => "https://github.com/zuki/ruby-bibframe.git"
bundleコマンドを実行する:
$ bundle
## 利用法
````
require 'rdf'
require 'marc'
require 'bibframe'
require 'rdf/rdfxml'
reader = MARC::XMLReader.new('/path/to/MARCXML.xml')
repo = RDF::Repository.new
# 典拠IDを付加し、名前付きグラフにする
for record in reader
repo << Bibframe::BFRDF(record, resolve: true, repository: repo).graph
end
RDF::RDFXML::Writer.open('/path/to/output.rdf') do |writer|
writer << repo
end
````
## TODO
- Testの追加
- コードのリファイン
- Bibframeの進捗状況に合わせた改訂