om 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +21 -0
- data/History.textile +1 -0
- data/LICENSE +20 -0
- data/README.rdoc +17 -0
- data/Rakefile +52 -0
- data/VERSION +1 -0
- data/lib/om/xml/accessors.rb +130 -0
- data/lib/om/xml/container.rb +32 -0
- data/lib/om/xml/properties.rb +380 -0
- data/lib/om/xml/property_value_operators.rb +111 -0
- data/lib/om/xml/validation.rb +63 -0
- data/lib/om/xml.rb +23 -0
- data/lib/om.rb +9 -0
- data/om.gemspec +89 -0
- data/spec/fixtures/CBF_MODS/ARS0025_016.xml +94 -0
- data/spec/fixtures/RUBRIC_mods_article_template.xml +89 -0
- data/spec/fixtures/mods-3-2.xsd +1 -24
- data/spec/fixtures/mods_articles/hydrangea_article1.xml +90 -0
- data/spec/fixtures/test_dummy_mods.xml +36 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +14 -0
- data/spec/unit/accessors_spec.rb +156 -0
- data/spec/unit/container_spec.rb +60 -0
- data/spec/unit/properties_spec.rb +247 -0
- data/spec/unit/property_value_operators_spec.rb +245 -0
- data/spec/unit/validation_spec.rb +78 -0
- data/spec/unit/xml_spec.rb +21 -0
- metadata +174 -0
@@ -0,0 +1,111 @@
|
|
1
|
+
require "open-uri"
|
2
|
+
require "logger"
|
3
|
+
|
4
|
+
class OM::XML::ParentNodeNotFoundError < RuntimeError; end
|
5
|
+
module OM::XML::PropertyValueOperators
|
6
|
+
|
7
|
+
def property_values(lookup_args)
|
8
|
+
result = []
|
9
|
+
lookup(lookup_args).each {|node| result << node.text }
|
10
|
+
return result
|
11
|
+
end
|
12
|
+
|
13
|
+
def property_values_append(opts={})
|
14
|
+
parent_select = Array( opts[:parent_select] )
|
15
|
+
child_index = opts[:child_index]
|
16
|
+
template = opts[:template]
|
17
|
+
new_values = Array( opts[:values] )
|
18
|
+
|
19
|
+
# If template is a string, use it as the template, otherwise use it as arguments to builder_template
|
20
|
+
unless template.instance_of?(String)
|
21
|
+
template_args = Array(template)
|
22
|
+
if template_args.last.kind_of?(Hash)
|
23
|
+
template_opts = template_args.delete_at(template_args.length - 1)
|
24
|
+
else
|
25
|
+
template_opts = {}
|
26
|
+
end
|
27
|
+
template = self.class.builder_template( template_args, template_opts )
|
28
|
+
end
|
29
|
+
|
30
|
+
parent_nodeset = lookup(parent_select[0], parent_select[1])
|
31
|
+
parent_node = node_from_set(parent_nodeset, child_index)
|
32
|
+
|
33
|
+
if parent_node.nil?
|
34
|
+
raise OX::ParentNodeNotFoundError, "Failed to find a parent node to insert values into based on :parent_select #{parent_select.inspect} with :child_index #{child_index.inspect}"
|
35
|
+
end
|
36
|
+
|
37
|
+
builder = Nokogiri::XML::Builder.with(parent_node) do |xml|
|
38
|
+
new_values.each do |builder_new_value|
|
39
|
+
builder_arg = eval('"'+ template + '"') # this inserts builder_new_value into the builder template
|
40
|
+
eval(builder_arg)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
# Nokogiri::XML::Node.new(builder.to_xml, foo)
|
45
|
+
|
46
|
+
return parent_node
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
def property_value_update(opts={})
|
51
|
+
parent_select = Array( opts[:parent_select] )
|
52
|
+
child_index = opts[:child_index]
|
53
|
+
template = opts[:template]
|
54
|
+
new_value = opts[:value]
|
55
|
+
xpath_select = opts[:select]
|
56
|
+
|
57
|
+
if !xpath_select.nil?
|
58
|
+
node = lookup(xpath_select, nil).first
|
59
|
+
else
|
60
|
+
parent_nodeset = lookup(parent_select[0], parent_select[1])
|
61
|
+
node = node_from_set(parent_nodeset, child_index)
|
62
|
+
end
|
63
|
+
|
64
|
+
node.content = new_value
|
65
|
+
|
66
|
+
end
|
67
|
+
|
68
|
+
# def property_value_set(property_ref, query_opts, node_index, new_value)
|
69
|
+
# end
|
70
|
+
|
71
|
+
def property_value_delete(opts={})
|
72
|
+
parent_select = Array( opts[:parent_select] )
|
73
|
+
parent_index = opts[:parent_index]
|
74
|
+
child_index = opts[:child_index]
|
75
|
+
xpath_select = opts[:select]
|
76
|
+
|
77
|
+
if !xpath_select.nil?
|
78
|
+
node = lookup(xpath_select, nil).first
|
79
|
+
else
|
80
|
+
parent_nodeset = lookup(parent_select, parent_select)
|
81
|
+
# parent_nodeset = lookup(parent_select[0])
|
82
|
+
|
83
|
+
if parent_index.nil?
|
84
|
+
node = node_from_set(parent_nodeset, child_index)
|
85
|
+
else
|
86
|
+
parent = node_from_set(parent_nodeset, parent_index)
|
87
|
+
# this next line is a hack around the fact that element_children() sometimes doesn't work.
|
88
|
+
node = node_from_set(parent.xpath("*"), child_index)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
node.remove
|
93
|
+
end
|
94
|
+
|
95
|
+
|
96
|
+
# Allows you to provide an array index _or_ a symbol representing the function to call on the nodeset in order to retrieve the node.
|
97
|
+
def node_from_set(nodeset, index)
|
98
|
+
if index.kind_of?(Integer)
|
99
|
+
node = nodeset[index]
|
100
|
+
elsif index.kind_of?(Symbol) && nodeset.respond_to?(index)
|
101
|
+
node = nodeset.send(index)
|
102
|
+
else
|
103
|
+
raise "Could not retrieve node using index #{index}."
|
104
|
+
end
|
105
|
+
|
106
|
+
return node
|
107
|
+
end
|
108
|
+
|
109
|
+
private :node_from_set
|
110
|
+
|
111
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
module OM::XML::Validation
|
2
|
+
|
3
|
+
# Class Methods -- These methods will be available on classes that include this Module
|
4
|
+
|
5
|
+
module ClassMethods
|
6
|
+
attr_accessor :schema_url
|
7
|
+
attr_writer :schema_file
|
8
|
+
|
9
|
+
##
|
10
|
+
# Validation Support
|
11
|
+
##
|
12
|
+
|
13
|
+
# Validate the given document against the Schema provided by the root_property for this class
|
14
|
+
def validate(doc)
|
15
|
+
schema.validate(doc).each do |error|
|
16
|
+
puts error.message
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
# Retrieve the Nokogiri Schema for this class
|
21
|
+
def schema
|
22
|
+
@schema ||= Nokogiri::XML::Schema(schema_file.read)
|
23
|
+
end
|
24
|
+
|
25
|
+
# Retrieve the schema file for this class
|
26
|
+
# If the schema file is not already set, it will be loaded from the schema url provided in the root_property configuration for the class
|
27
|
+
def schema_file
|
28
|
+
@schema_file ||= file_from_url(schema_url)
|
29
|
+
end
|
30
|
+
|
31
|
+
# Retrieve file from a url (used by schema_file method to retrieve schema file from the schema url)
|
32
|
+
def file_from_url( url )
|
33
|
+
# parsed_url = URI.parse( url )
|
34
|
+
#
|
35
|
+
# if parsed_url.class != URI::HTTP
|
36
|
+
# raise "Invalid URL. Could not parse #{url} as a HTTP url."
|
37
|
+
# end
|
38
|
+
|
39
|
+
begin
|
40
|
+
file = open( url )
|
41
|
+
return file
|
42
|
+
rescue OpenURI::HTTPError => e
|
43
|
+
raise "Could not retrieve file from #{url}. Error: #{e}"
|
44
|
+
rescue Exception => e
|
45
|
+
raise "Could not retrieve file from #{url}. Error: #{e}"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
private :file_from_url
|
50
|
+
|
51
|
+
end
|
52
|
+
|
53
|
+
# Instance Methods -- These methods will be available on instances of classes that include this module
|
54
|
+
|
55
|
+
def self.included(klass)
|
56
|
+
klass.extend(ClassMethods)
|
57
|
+
end
|
58
|
+
|
59
|
+
def validate
|
60
|
+
self.class.validate(self)
|
61
|
+
end
|
62
|
+
|
63
|
+
end
|
data/lib/om/xml.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
require "om/xml/container"
|
2
|
+
require "om/xml/accessors"
|
3
|
+
require "om/xml/validation"
|
4
|
+
require "om/xml/properties"
|
5
|
+
require "om/xml/property_value_operators"
|
6
|
+
|
7
|
+
module OM::XML
|
8
|
+
|
9
|
+
attr_accessor :ng_xml
|
10
|
+
|
11
|
+
# Instance Methods -- These methods will be available on instances of classes that include this module
|
12
|
+
|
13
|
+
def self.included(klass)
|
14
|
+
klass.send(:include, OM::XML::Container)
|
15
|
+
klass.send(:include, OM::XML::Accessors)
|
16
|
+
klass.send(:include, OM::XML::Validation)
|
17
|
+
klass.send(:include, OM::XML::Properties)
|
18
|
+
klass.send(:include, OM::XML::PropertyValueOperators)
|
19
|
+
|
20
|
+
# klass.send(:include, OM::XML::Schema)
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
data/lib/om.rb
ADDED
data/om.gemspec
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{om}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Matt Zumwalt"]
|
12
|
+
s.date = %q{2010-06-20}
|
13
|
+
s.description = %q{OM (Opinionated Metadata): A library to help you tame sprawling XML schemas like MODS. Wraps Nokogiri documents in objects with miscellaneous helper methods for doing things like retrieve generated xpath queries or look up properties based on a simplified DSL}
|
14
|
+
s.email = %q{matt.zumwalt@yourmediashelf.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE",
|
17
|
+
"README.rdoc"
|
18
|
+
]
|
19
|
+
s.files = [
|
20
|
+
".document",
|
21
|
+
".gitignore",
|
22
|
+
"History.textile",
|
23
|
+
"LICENSE",
|
24
|
+
"README.rdoc",
|
25
|
+
"Rakefile",
|
26
|
+
"VERSION",
|
27
|
+
"lib/om.rb",
|
28
|
+
"lib/om/xml.rb",
|
29
|
+
"lib/om/xml/accessors.rb",
|
30
|
+
"lib/om/xml/container.rb",
|
31
|
+
"lib/om/xml/properties.rb",
|
32
|
+
"lib/om/xml/property_value_operators.rb",
|
33
|
+
"lib/om/xml/validation.rb",
|
34
|
+
"om.gemspec",
|
35
|
+
"spec/fixtures/CBF_MODS/ARS0025_016.xml",
|
36
|
+
"spec/fixtures/RUBRIC_mods_article_template.xml",
|
37
|
+
"spec/fixtures/mods-3-2.xsd",
|
38
|
+
"spec/fixtures/mods_articles/hydrangea_article1.xml",
|
39
|
+
"spec/fixtures/test_dummy_mods.xml",
|
40
|
+
"spec/spec.opts",
|
41
|
+
"spec/spec_helper.rb",
|
42
|
+
"spec/unit/accessors_spec.rb",
|
43
|
+
"spec/unit/container_spec.rb",
|
44
|
+
"spec/unit/properties_spec.rb",
|
45
|
+
"spec/unit/property_value_operators_spec.rb",
|
46
|
+
"spec/unit/validation_spec.rb",
|
47
|
+
"spec/unit/xml_spec.rb"
|
48
|
+
]
|
49
|
+
s.homepage = %q{http://github.com/mediashelf/om}
|
50
|
+
s.rdoc_options = ["--charset=UTF-8"]
|
51
|
+
s.require_paths = ["lib"]
|
52
|
+
s.rubygems_version = %q{1.3.7}
|
53
|
+
s.summary = %q{OM (Opinionated Metadata): A library to help you tame sprawling XML schemas like MODS.}
|
54
|
+
s.test_files = [
|
55
|
+
"spec/spec_helper.rb",
|
56
|
+
"spec/unit/accessors_spec.rb",
|
57
|
+
"spec/unit/container_spec.rb",
|
58
|
+
"spec/unit/properties_spec.rb",
|
59
|
+
"spec/unit/property_value_operators_spec.rb",
|
60
|
+
"spec/unit/validation_spec.rb",
|
61
|
+
"spec/unit/xml_spec.rb"
|
62
|
+
]
|
63
|
+
|
64
|
+
if s.respond_to? :specification_version then
|
65
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
66
|
+
s.specification_version = 3
|
67
|
+
|
68
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
69
|
+
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
70
|
+
s.add_runtime_dependency(%q<facets>, [">= 0"])
|
71
|
+
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
72
|
+
s.add_development_dependency(%q<mocha>, [">= 0.9.8"])
|
73
|
+
s.add_development_dependency(%q<ruby-debug>, [">= 0"])
|
74
|
+
else
|
75
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
76
|
+
s.add_dependency(%q<facets>, [">= 0"])
|
77
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
78
|
+
s.add_dependency(%q<mocha>, [">= 0.9.8"])
|
79
|
+
s.add_dependency(%q<ruby-debug>, [">= 0"])
|
80
|
+
end
|
81
|
+
else
|
82
|
+
s.add_dependency(%q<nokogiri>, [">= 0"])
|
83
|
+
s.add_dependency(%q<facets>, [">= 0"])
|
84
|
+
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
85
|
+
s.add_dependency(%q<mocha>, [">= 0.9.8"])
|
86
|
+
s.add_dependency(%q<ruby-debug>, [">= 0"])
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
@@ -0,0 +1,94 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
2
|
+
<ns3:mods xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-2.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://www.loc.gov/mods/v3" xmlns:ns2="http://www.w3.org/1999/xlink">
|
3
|
+
<ns3:titleInfo>
|
4
|
+
<ns3:title>Brandenburg concerto no. 1 in F major</ns3:title>
|
5
|
+
</ns3:titleInfo>
|
6
|
+
<ns3:language>
|
7
|
+
<ns3:languageTerm type="code" authority="iso639-2b">No_linguistic_content</ns3:languageTerm>
|
8
|
+
<ns3:languageTerm type="text">No linguistic content</ns3:languageTerm>
|
9
|
+
</ns3:language>
|
10
|
+
<ns3:typeOfResource>sound recording-musical</ns3:typeOfResource>
|
11
|
+
<ns3:originInfo>
|
12
|
+
<ns3:dateCreated>07/23/1962</ns3:dateCreated>
|
13
|
+
</ns3:originInfo>
|
14
|
+
<ns3:name type="personal" authority="ingest">
|
15
|
+
<ns3:role>
|
16
|
+
<ns3:roleTerm type="text" authority="marcrelator">creator</ns3:roleTerm>
|
17
|
+
<ns3:roleTerm type="code" authority="marcrelator">cre</ns3:roleTerm>
|
18
|
+
</ns3:role>
|
19
|
+
<ns3:namePart type="family">Bach, Johann Sebastian, 1685-1750</ns3:namePart>
|
20
|
+
<ns3:displayForm>Bach, Johann Sebastian, 1685-1750</ns3:displayForm>
|
21
|
+
</ns3:name>
|
22
|
+
<ns3:name type="personal" authority="ingest">
|
23
|
+
<ns3:role>
|
24
|
+
<ns3:roleTerm type="text" authority="marcrelator">creator</ns3:roleTerm>
|
25
|
+
<ns3:roleTerm type="code" authority="marcrelator">cre</ns3:roleTerm>
|
26
|
+
</ns3:role>
|
27
|
+
<ns3:namePart type="family">Bergstone, Fred</ns3:namePart>
|
28
|
+
<ns3:displayForm>Bergstone, Fred</ns3:displayForm>
|
29
|
+
</ns3:name>
|
30
|
+
<ns3:name type="personal" authority="ingest">
|
31
|
+
<ns3:role>
|
32
|
+
<ns3:roleTerm type="text" authority="marcrelator">creator</ns3:roleTerm>
|
33
|
+
<ns3:roleTerm type="code" authority="marcrelator">cre</ns3:roleTerm>
|
34
|
+
</ns3:role>
|
35
|
+
<ns3:namePart type="family">Dust\u00E9, Raymond</ns3:namePart>
|
36
|
+
<ns3:displayForm>Dust\u00E9, Raymond</ns3:displayForm>
|
37
|
+
</ns3:name>
|
38
|
+
<ns3:name type="personal" authority="ingest">
|
39
|
+
<ns3:role>
|
40
|
+
<ns3:roleTerm type="text" authority="marcrelator">creator</ns3:roleTerm>
|
41
|
+
<ns3:roleTerm type="code" authority="marcrelator">cre</ns3:roleTerm>
|
42
|
+
</ns3:role>
|
43
|
+
<ns3:namePart type="family">Kates, Philip</ns3:namePart>
|
44
|
+
<ns3:displayForm>Kates, Philip</ns3:displayForm>
|
45
|
+
</ns3:name>
|
46
|
+
<ns3:name type="personal" authority="ingest">
|
47
|
+
<ns3:role>
|
48
|
+
<ns3:roleTerm type="text" authority="marcrelator">creator</ns3:roleTerm>
|
49
|
+
<ns3:roleTerm type="code" authority="marcrelator">cre</ns3:roleTerm>
|
50
|
+
</ns3:role>
|
51
|
+
<ns3:namePart type="family">Price, Charles Gower, 1939-</ns3:namePart>
|
52
|
+
<ns3:displayForm>Price, Charles Gower, 1939-</ns3:displayForm>
|
53
|
+
</ns3:name>
|
54
|
+
<ns3:name type="personal" authority="ingest">
|
55
|
+
<ns3:role>
|
56
|
+
<ns3:roleTerm type="text" authority="marcrelator">creator</ns3:roleTerm>
|
57
|
+
<ns3:roleTerm type="code" authority="marcrelator">cre</ns3:roleTerm>
|
58
|
+
</ns3:role>
|
59
|
+
<ns3:namePart type="family">Taylor, Ross, arranger</ns3:namePart>
|
60
|
+
<ns3:displayForm>Taylor, Ross, arranger</ns3:displayForm>
|
61
|
+
</ns3:name>
|
62
|
+
<ns3:name type="personal" authority="ingest">
|
63
|
+
<ns3:role>
|
64
|
+
<ns3:roleTerm type="text" authority="marcrelator">creator</ns3:roleTerm>
|
65
|
+
<ns3:roleTerm type="code" authority="marcrelator">cre</ns3:roleTerm>
|
66
|
+
</ns3:role>
|
67
|
+
<ns3:namePart type="family">Waller, Rosemary</ns3:namePart>
|
68
|
+
<ns3:displayForm>Waller, Rosemary</ns3:displayForm>
|
69
|
+
</ns3:name>
|
70
|
+
<ns3:subject authority="lcsh">
|
71
|
+
<ns3:topic>Concerti grossi</ns3:topic>
|
72
|
+
</ns3:subject>
|
73
|
+
<ns3:note displayLabel="Uniform title">Bach, Johann Sebastian, 1685-1750. Brandenburgische Konzerte. Nr. 1
|
74
|
+
|
75
|
+
</ns3:note>
|
76
|
+
<ns3:physicalDescription>
|
77
|
+
<ns3:note displayLabel="General Physical Description note">1 7 in. open reel audio tape</ns3:note>
|
78
|
+
</ns3:physicalDescription>
|
79
|
+
<ns3:relatedItem type="host">
|
80
|
+
<ns3:titleInfo>
|
81
|
+
<ns3:title>Carmel Bach Festival Tape Collection</ns3:title>
|
82
|
+
</ns3:titleInfo>
|
83
|
+
<ns3:originInfo>
|
84
|
+
<ns3:dateCreated>1962-1982</ns3:dateCreated>
|
85
|
+
<ns3:dateCreated point="start">1962</ns3:dateCreated>
|
86
|
+
<ns3:dateCreated point="end">1982</ns3:dateCreated>
|
87
|
+
</ns3:originInfo>
|
88
|
+
<ns3:identifier type="local">ARS.0025</ns3:identifier>
|
89
|
+
</ns3:relatedItem>
|
90
|
+
<ns3:note displayLabel="Digital object made available by ">Archive of Recorded Sound, Braun Music Center, 541 Lasuen Mall, Stanford University, Stanford, California, 94305-3076, USA, (http://library.stanford.edu/depts/ars)</ns3:note>
|
91
|
+
<ns3:identifier displayLabel="Audio-Streaming">ARS0025_016_a_sl.mp3</ns3:identifier>
|
92
|
+
<ns3:identifier displayLabel="Audio-Service">ARS0025_016_a_sh.wav</ns3:identifier>
|
93
|
+
<ns3:identifier displayLabel="Audio-Master">ARS0025_016_a_pm.wav</ns3:identifier>
|
94
|
+
</ns3:mods>
|
@@ -0,0 +1,89 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!-- Based on MODS JOURNAL ARTICLE TEMPLATE edited with XMLSpy v2006 rel. 3 sp1
|
3
|
+
(http://www.altova.com) by Neil Godfrey (RUBRIC) -->
|
4
|
+
<!-- NOTE: For further details on more granular and other
|
5
|
+
applications of elements, see the MODS User Guidelines
|
6
|
+
at http://www.loc.gov/standards/mods/v3/mods-userguide-elements.html
|
7
|
+
Modifications will be necessary for local harvesting and mapping
|
8
|
+
requirements -->
|
9
|
+
|
10
|
+
<mods version="3.0" xsi:schemaLocation="http://www.loc.gov/mods/v3
|
11
|
+
http://www.loc.gov/standards/mods/v3/mods-3-0.xsd" xmlns="http://www.loc.gov/mods/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
12
|
+
|
13
|
+
<titleInfo>
|
14
|
+
<nonSort>THE</nonSort>
|
15
|
+
<title>ARTICLE TITLE</title>
|
16
|
+
<subTitle>SUBTITLE</subTitle>
|
17
|
+
</titleInfo>
|
18
|
+
<titleInfo type="alternative">
|
19
|
+
<title>VARYING FORM OF TITLE</title>
|
20
|
+
</titleInfo>
|
21
|
+
|
22
|
+
<name type="personal">
|
23
|
+
<namePart type="family">FAMILY NAME</namePart>
|
24
|
+
<namePart type="given">GIVEN NAMES</namePart>
|
25
|
+
<namePart type="termsOfAddress">DR.</namePart>
|
26
|
+
<displayForm>NAME AS IT APPEARS</displayForm>
|
27
|
+
<affiliation>FACULTY, UNIVERSITY</affiliation>
|
28
|
+
<role>
|
29
|
+
<roleTerm authority="marcrelator" type="text">creator</roleTerm>
|
30
|
+
</role>
|
31
|
+
<role>
|
32
|
+
<roleTerm type="text">submitter</roleTerm>
|
33
|
+
</role>
|
34
|
+
</name>
|
35
|
+
|
36
|
+
<typeOfResource>text</typeOfResource>
|
37
|
+
<genre authority="local">journal article</genre>
|
38
|
+
|
39
|
+
<abstract>ABSTRACT</abstract>
|
40
|
+
<subject>
|
41
|
+
<topic>TOPIC 1</topic>
|
42
|
+
<topic>TOPIC 2</topic>
|
43
|
+
</subject>
|
44
|
+
<subject authority="AUTHORITY SOURCE (RFCD, LCSH)">
|
45
|
+
<topic>CONTROLLED TERM</topic>
|
46
|
+
</subject>
|
47
|
+
|
48
|
+
<language>
|
49
|
+
<languageTerm authority="iso639-2b" type="code">en-aus </languageTerm>
|
50
|
+
</language>
|
51
|
+
|
52
|
+
<physicalDescription>
|
53
|
+
<internetMediaType>application/pdf</internetMediaType>
|
54
|
+
<extent>36 p.</extent>
|
55
|
+
</physicalDescription>
|
56
|
+
|
57
|
+
<relatedItem type="host">
|
58
|
+
<titleInfo>
|
59
|
+
<title>TITLE OF HOST JOURNAL</title>
|
60
|
+
</titleInfo>
|
61
|
+
<originInfo>
|
62
|
+
<publisher>PUBLISHER</publisher>
|
63
|
+
<dateIssued>DATE</dateIssued>
|
64
|
+
</originInfo>
|
65
|
+
<identifier type="issn">0013-8908</identifier>
|
66
|
+
<part>
|
67
|
+
<detail type="volume">
|
68
|
+
<number>2</number>
|
69
|
+
</detail>
|
70
|
+
<detail type="level">
|
71
|
+
<number>2</number>
|
72
|
+
</detail>
|
73
|
+
<extent unit="pages">
|
74
|
+
<start>195</start>
|
75
|
+
<end>230</end>
|
76
|
+
</extent>
|
77
|
+
<date>FEB. 2007</date>
|
78
|
+
</part>
|
79
|
+
</relatedItem>
|
80
|
+
|
81
|
+
<identifier type="uri">http://URL.edu.au/</identifier>
|
82
|
+
<identifier type="doi">doi:10.1006/jmbi.1995.0238</identifier>
|
83
|
+
<location>
|
84
|
+
<url>http://URL.edu.au/</url>
|
85
|
+
</location>
|
86
|
+
<accessCondition type="restrictionOnAccess">EMBARGO NOTE</accessCondition>
|
87
|
+
<accessCondition type="use and reproduction">OPEN ACCESS</accessCondition>
|
88
|
+
|
89
|
+
</mods>
|
@@ -0,0 +1 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
Tentative plan for 4.0 is to make it an element instead of an attribute,
|
1
3
|
and wrap <url> and <urlNote> together. Can't do that in 3.2
|
2
4
|
because it would not be compatible with 3.1.
|
3
5
|
but had not been explicitly typed, are now typed.
|
4
6
|
http://www.loc.gov/standards/xlink.xsd.
|
5
7
|
(It was previously http://www.loc.gov/standards/mods/xlink.xsd.
|
6
8
|
The schema now resides in both places so that earlier versions
|
7
9
|
will not be affected, but it is now intended that the new copy
|
8
10
|
be referenced, outside of the mods directory,
|
9
11
|
so that other projects, e.g. mets, may reference it.)
|
10
12
|
(1) a single MODS record:
|
11
13
|
record definintion, and also relatedItem.
|
12
14
|
Difference is that mods requires at least one element
|
13
15
|
and relatedItem does not.
|
14
|
-
->
|
15
|
-
->
|
16
16
|
|
17
17
|
********** titleInfoType definition **********
|
18
18
|
-->
|
19
19
|
********** nameType definition **********
|
20
|
-
->
|
21
|
-
->
|
22
|
-
->
|
23
20
|
</xsd:documentation>
|
24
|
-
->
|
25
21
|
-->
|
26
|
-
->
|
27
22
|
********** originInfoType definition **********
|
28
|
-
->
|
29
|
-
->
|
30
|
-
->
|
31
23
|
-->
|
32
24
|
-->
|
33
25
|
-->
|
34
26
|
-->
|
35
27
|
-->
|
36
28
|
********** subjectType definition **********
|
37
|
-
->
|
38
|
-
->
|
39
|
-
->
|
40
|
-
->
|
41
|
-
->
|
42
|
-
->
|
43
29
|
-->
|
44
30
|
|
45
31
|
-->
|
46
32
|
-->
|
47
|
-
->
|
48
|
-
->
|
49
|
-
->
|
50
|
-
->
|
51
|
-
->
|
52
|
-
->
|
53
|
-
->
|
54
33
|
********** language attribute group definition **********
|
55
|
-
->
|
56
34
|
********** definition of codeOrText type used by type attribute
|
57
35
|
for elements that distinguish code from text **********
|
58
36
|
-->
|
59
37
|
********** definition of placeAuthority type used by authority attribute
|
60
38
|
for placeType and geographic **********
|
61
39
|
-->
|
62
40
|
********** definition of nameTypeAttribute used by name attribute
|
63
41
|
"type" **********
|
64
42
|
-->
|
@@ -0,0 +1,90 @@
|
|
1
|
+
<mods version="3.0" xsi:schemaLocation="http://www.loc.gov/mods/v3
|
2
|
+
http://www.loc.gov/standards/mods/v3/mods-3-0.xsd" xmlns="http://www.loc.gov/mods/v3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
3
|
+
|
4
|
+
<titleInfo>
|
5
|
+
<nonSort>THE</nonSort>
|
6
|
+
<title>ARTICLE TITLE HYDRANGEA ARTICLE 1</title>
|
7
|
+
<subTitle>SUBTITLE</subTitle>
|
8
|
+
</titleInfo>
|
9
|
+
<titleInfo lang="finnish">
|
10
|
+
<title>Artikkelin otsikko Hydrangea artiklan 1</title>
|
11
|
+
</titleInfo>
|
12
|
+
|
13
|
+
<name type="personal">
|
14
|
+
<namePart type="family">FAMILY NAME</namePart>
|
15
|
+
<namePart type="given">GIVEN NAMES</namePart>
|
16
|
+
<namePart type="termsOfAddress">DR.</namePart>
|
17
|
+
<displayForm>NAME AS IT APPEARS</displayForm>
|
18
|
+
<affiliation>FACULTY, UNIVERSITY</affiliation>
|
19
|
+
<role>
|
20
|
+
<roleTerm authority="marcrelator" type="text">creator</roleTerm>
|
21
|
+
</role>
|
22
|
+
<role>
|
23
|
+
<roleTerm type="text">submitter</roleTerm>
|
24
|
+
</role>
|
25
|
+
</name>
|
26
|
+
|
27
|
+
<name type="personal">
|
28
|
+
<namePart type="family">Gautama</namePart>
|
29
|
+
<namePart type="given">Siddartha</namePart>
|
30
|
+
<namePart type="termsOfAddress">Prince</namePart>
|
31
|
+
<affiliation>Nirvana</affiliation>
|
32
|
+
<role>
|
33
|
+
<roleTerm authority="marcrelator" type="text">teacher</roleTerm>
|
34
|
+
</role>
|
35
|
+
</name>
|
36
|
+
|
37
|
+
<typeOfResource>text</typeOfResource>
|
38
|
+
<genre authority="local">journal article</genre>
|
39
|
+
|
40
|
+
<abstract>ABSTRACT</abstract>
|
41
|
+
<subject>
|
42
|
+
<topic>TOPIC 1</topic>
|
43
|
+
<topic>TOPIC 2</topic>
|
44
|
+
</subject>
|
45
|
+
<subject authority="AUTHORITY SOURCE (RFCD, LCSH)">
|
46
|
+
<topic>CONTROLLED TERM</topic>
|
47
|
+
</subject>
|
48
|
+
|
49
|
+
<language>
|
50
|
+
<languageTerm authority="iso639-2b" type="code">en-aus </languageTerm>
|
51
|
+
</language>
|
52
|
+
|
53
|
+
<physicalDescription>
|
54
|
+
<internetMediaType>application/pdf</internetMediaType>
|
55
|
+
<extent>36 p.</extent>
|
56
|
+
</physicalDescription>
|
57
|
+
|
58
|
+
<relatedItem type="host">
|
59
|
+
<titleInfo>
|
60
|
+
<title>TITLE OF HOST JOURNAL</title>
|
61
|
+
</titleInfo>
|
62
|
+
<originInfo>
|
63
|
+
<publisher>PUBLISHER</publisher>
|
64
|
+
<dateIssued>DATE</dateIssued>
|
65
|
+
</originInfo>
|
66
|
+
<identifier type="issn">0013-8908</identifier>
|
67
|
+
<part>
|
68
|
+
<detail type="volume">
|
69
|
+
<number>2</number>
|
70
|
+
</detail>
|
71
|
+
<detail type="level">
|
72
|
+
<number>2</number>
|
73
|
+
</detail>
|
74
|
+
<extent unit="pages">
|
75
|
+
<start>195</start>
|
76
|
+
<end>230</end>
|
77
|
+
</extent>
|
78
|
+
<date>FEB. 2007</date>
|
79
|
+
</part>
|
80
|
+
</relatedItem>
|
81
|
+
|
82
|
+
<identifier type="uri">http://URL.edu.au/</identifier>
|
83
|
+
<identifier type="doi">doi:10.1006/jmbi.1995.0238</identifier>
|
84
|
+
<location>
|
85
|
+
<url>http://URL.edu.au/</url>
|
86
|
+
</location>
|
87
|
+
<accessCondition type="restrictionOnAccess">EMBARGO NOTE</accessCondition>
|
88
|
+
<accessCondition type="use and reproduction">OPEN ACCESS</accessCondition>
|
89
|
+
|
90
|
+
</mods>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
2
|
+
<ns3:mods xsi:schemaLocation="http://www.loc.gov/mods/v3 http://www.loc.gov/standards/mods/v3/mods-3-2.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns3="http://www.loc.gov/mods/v3" xmlns:ns2="http://www.w3.org/1999/xlink">
|
3
|
+
<ns3:name type="personal">
|
4
|
+
<ns3:namePart type="family">Berners-Lee</ns3:namePart>
|
5
|
+
<ns3:namePart type="given">Tim</ns3:namePart>
|
6
|
+
<ns3:role>
|
7
|
+
<ns3:roleTerm type="text" authority="marcrelator">creator</ns3:roleTerm>
|
8
|
+
<ns3:roleTerm type="code" authority="marcrelator">cre</ns3:roleTerm>
|
9
|
+
</ns3:role>
|
10
|
+
</ns3:name>
|
11
|
+
<ns3:name type="personal">
|
12
|
+
<ns3:namePart type="family">Jobs</ns3:namePart>
|
13
|
+
<ns3:namePart type="given">Steve</ns3:namePart>
|
14
|
+
<ns3:namePart type="date">2004</ns3:namePart>
|
15
|
+
<ns3:role>
|
16
|
+
<ns3:roleTerm type="text" authority="marcrelator">creator</ns3:roleTerm>
|
17
|
+
<ns3:roleTerm type="code" authority="marcrelator">cre</ns3:roleTerm>
|
18
|
+
</ns3:role>
|
19
|
+
</ns3:name>
|
20
|
+
<ns3:name type="personal">
|
21
|
+
<ns3:namePart type="family">Wozniak</ns3:namePart>
|
22
|
+
<ns3:namePart type="given">The Woz</ns3:namePart>
|
23
|
+
</ns3:name>
|
24
|
+
<ns3:name type="personal">
|
25
|
+
<ns3:namePart type="family">Klimt</ns3:namePart>
|
26
|
+
<ns3:namePart type="given">Gustav</ns3:namePart>
|
27
|
+
<ns3:role>
|
28
|
+
<ns3:roleTerm type="text" authority="marcrelator">creator</ns3:roleTerm>
|
29
|
+
<ns3:roleTerm type="code" authority="marcrelator">cre</ns3:roleTerm>
|
30
|
+
</ns3:role>
|
31
|
+
<ns3:role>
|
32
|
+
<ns3:roleTerm type="text" authority="marcrelator">visionary</ns3:roleTerm>
|
33
|
+
<ns3:roleTerm type="code" authority="marcrelator">vry</ns3:roleTerm>
|
34
|
+
</ns3:role>
|
35
|
+
</ns3:name>
|
36
|
+
</ns3:mods>
|