cul_hydra 1.3.11 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/concept.rb +116 -0
- data/app/models/generic_resource.rb +0 -4
- data/config/predicate_mappings.yml +13 -1
- data/fixtures/spec/BLOB/dlc.md +16 -0
- data/fixtures/spec/FOXML/concept.xml.erb +58 -0
- data/lib/cul_hydra/solrizer/mods_fieldable.rb +1 -1
- data/lib/cul_hydra/version.rb +1 -1
- data/lib/cul_hydra/version.rb~ +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56762750be6ed49a11838c02405471f0b2c4a7bb
|
4
|
+
data.tar.gz: 6ab5f4b18bccce28ab939ea051c4fde0e2c96515
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4929148aa43d0bd601569210e913ad1b66094b2bff0951dd0e98d6236c50e8b195d51b203f74c26bc86f34cd13a4fd24cd56b14ea8417cf65c1a3e3be9cdeb16
|
7
|
+
data.tar.gz: 96a65e2a2953861a82aae4c302d9e34412cf67774c08039978699642be70314a09cf743613815645c8ea5f0bec1d278f94775052befa20859f4a3f1af0f64d27
|
data/app/models/concept.rb
CHANGED
@@ -5,6 +5,14 @@ class Concept < GenericAggregator
|
|
5
5
|
include ::ActiveFedora::DatastreamCollections
|
6
6
|
include ::Hydra::ModelMethods
|
7
7
|
include Cul::Hydra::Models::Common
|
8
|
+
include Cul::Hydra::Models::Aggregator
|
9
|
+
|
10
|
+
rdf_types(RDF::CUL.Aggregator)
|
11
|
+
rdf_types(RDF::PCDM.Object)
|
12
|
+
|
13
|
+
has_file_datastream :name => "descriptionText", :type=>::ActiveFedora::Datastream,
|
14
|
+
:versionable => false, :label => 'Textual Description of Concept',
|
15
|
+
:mimeType => 'text/markdown'
|
8
16
|
|
9
17
|
has_and_belongs_to_many :containers, :property=>:cul_member_of, :class_name=>'ActiveFedora::Base'
|
10
18
|
|
@@ -16,8 +24,116 @@ class Concept < GenericAggregator
|
|
16
24
|
"CONCEPT"
|
17
25
|
end
|
18
26
|
|
27
|
+
def abstract
|
28
|
+
get_singular_rel(:abstract)
|
29
|
+
end
|
30
|
+
|
31
|
+
def abstract=(val)
|
32
|
+
set_singular_rel(:abstract, val, true)
|
33
|
+
end
|
34
|
+
|
35
|
+
def description_ds
|
36
|
+
candidate =
|
37
|
+
relationships(:description).select { |v| v.to_s.index(self.internal_uri.to_s) == 0 }
|
38
|
+
candidate = candidate.first
|
39
|
+
candidate = candidate.to_s.split('/')[2]
|
40
|
+
datastreams[candidate] unless candidate.blank?
|
41
|
+
end
|
42
|
+
|
43
|
+
# a marked up description of this concept suitable for embedding in a web page
|
44
|
+
# http://purl.org/dc/terms/description
|
45
|
+
def description
|
46
|
+
ds = description_ds
|
47
|
+
return nil unless ds
|
48
|
+
ds.content.to_s
|
49
|
+
end
|
50
|
+
|
51
|
+
def description=(value)
|
52
|
+
return unless value
|
53
|
+
blob = (value.is_a? String) ? StringIO.new(value) : value
|
54
|
+
ds = description_ds
|
55
|
+
if ds
|
56
|
+
ds.content = value
|
57
|
+
else
|
58
|
+
add_relationship(:description, internal_uri.to_s + "/descriptionText")
|
59
|
+
datastreams['descriptionText'].content = value
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# a human readable PREMIS restriction ('Onsite', etc.)
|
64
|
+
# http://www.bbc.co.uk/ontologies/coreconcepts/slug
|
65
|
+
def restriction
|
66
|
+
get_singular_rel(:restriction)
|
67
|
+
end
|
68
|
+
|
69
|
+
def restriction=(val)
|
70
|
+
set_singular_rel(:restriction, val, true)
|
71
|
+
end
|
72
|
+
|
73
|
+
# a human readable URI segment for this concept
|
74
|
+
# http://www.bbc.co.uk/ontologies/coreconcepts/slug
|
75
|
+
def slug
|
76
|
+
get_singular_rel(:slug)
|
77
|
+
end
|
78
|
+
|
79
|
+
def slug=(val)
|
80
|
+
set_singular_rel(:slug, val, true)
|
81
|
+
end
|
82
|
+
|
83
|
+
# a URI property indicating the service endpoint associated with this concept
|
84
|
+
# http://purl.org/dc/terms/source
|
85
|
+
def source
|
86
|
+
get_singular_rel(:source)
|
87
|
+
end
|
88
|
+
|
89
|
+
def source=(val)
|
90
|
+
set_singular_rel(:source, val)
|
91
|
+
end
|
92
|
+
|
93
|
+
# a short or abbreviated title
|
94
|
+
# http://purl.org/ontology/bibo/shortTitle
|
95
|
+
def short_title
|
96
|
+
get_singular_rel(:short_title)
|
97
|
+
end
|
98
|
+
|
99
|
+
def short_title=(val)
|
100
|
+
set_singular_rel(:short_title, val, true)
|
101
|
+
end
|
102
|
+
|
103
|
+
# the full title
|
104
|
+
# http://purl.org/dc/terms/title
|
105
|
+
def title
|
106
|
+
get_singular_rel(:title)
|
107
|
+
end
|
108
|
+
|
109
|
+
def title=(val)
|
110
|
+
set_singular_rel(:title, val, true)
|
111
|
+
end
|
112
|
+
|
113
|
+
def get_singular_rel(predicate)
|
114
|
+
property = relationships(predicate).first
|
115
|
+
return nil unless property
|
116
|
+
return (property.kind_of? RDF::Literal) ? property.value : property
|
117
|
+
end
|
118
|
+
|
119
|
+
def set_singular_rel(predicate, value, literal=false)
|
120
|
+
raise "#{predicate} is a singular property" if value.respond_to? :each
|
121
|
+
clear_relationship(predicate)
|
122
|
+
add_relationship(predicate, value, literal)
|
123
|
+
end
|
124
|
+
|
19
125
|
def to_solr(solr_doc = Hash.new, opts={})
|
20
126
|
solr_doc = super(solr_doc, opts)
|
127
|
+
solr_doc[::ActiveFedora::SolrService.solr_name(:description_text, :displayable)] = description
|
21
128
|
solr_doc
|
22
129
|
end
|
130
|
+
class SingularRelValidator < ActiveModel::Validator
|
131
|
+
def validate(record)
|
132
|
+
[:abstract, :alternative, :restriction, :slug, :source, :title].each do |rel|
|
133
|
+
record.errors[rel] << "#{rel} must have 0 or 1 values" unless record.relationships(rel).length < 2
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
validates_with SingularRelValidator
|
23
139
|
end
|
@@ -104,7 +104,6 @@ class GenericResource < ::ActiveFedora::Base
|
|
104
104
|
rels.each do |dsuri, props|
|
105
105
|
if dsuri =~ /\/content$/ or not props[FORMAT_OF_PREDICATE].blank?
|
106
106
|
dsid = dsuri.split('/')[-1]
|
107
|
-
puts props.inspect
|
108
107
|
res = datastream_as_resource(dsid, props.with_indifferent_access)
|
109
108
|
results << res
|
110
109
|
end
|
@@ -163,11 +162,8 @@ class GenericResource < ::ActiveFedora::Base
|
|
163
162
|
end
|
164
163
|
|
165
164
|
def with_ds_resource(ds_id, fedora_content_filesystem_mounted=false, &block)
|
166
|
-
|
167
165
|
ds = self.datastreams[ds_id]
|
168
166
|
|
169
|
-
puts 'dsLocation.start_with?(self.pid) : ' + ds.dsLocation.start_with?(self.pid).to_s
|
170
|
-
|
171
167
|
# If the dsLocation starts with the pid, that means that we're dealing with an internally-managed ds,
|
172
168
|
# so we can't reference the file directly even if we do have the fedora content filesystem mounted.
|
173
169
|
if ! ds.dsLocation.start_with?(self.pid) && fedora_content_filesystem_mounted
|
@@ -55,11 +55,16 @@
|
|
55
55
|
:y_sampling: ySamplingFrequency
|
56
56
|
:sampling_unit: samplingFrequencyUnit
|
57
57
|
http://purl.org/dc/terms/:
|
58
|
+
:abstract: abstract
|
59
|
+
:alternative: alternative
|
58
60
|
:contributor: contributor
|
61
|
+
:description: description
|
59
62
|
:extent: extent
|
60
63
|
:format: format
|
61
64
|
:format_of: isFormatOf
|
62
65
|
:publisher: publisher
|
66
|
+
:source: source
|
67
|
+
:title: title
|
63
68
|
http://www.w3.org/2003/12/exif/ns#:
|
64
69
|
:image_width: imageWidth
|
65
70
|
:image_length: imageLength
|
@@ -77,6 +82,7 @@
|
|
77
82
|
:rdf_type: type
|
78
83
|
http://www.loc.gov/premis/rdf/v1#:
|
79
84
|
:original_name: hasOriginalName
|
85
|
+
:restriction: hasRestriction
|
80
86
|
http://pcdm.org/models#:
|
81
87
|
:pcdm_has_file: hasFile
|
82
88
|
:pcdm_file_of: fileOf
|
@@ -85,4 +91,10 @@
|
|
85
91
|
:pcdm_has_related_file: hasRelatedFile
|
86
92
|
:pcdm_related_file_of: relatedFileOf
|
87
93
|
:pcdm_has_related_object: hasRelatedObject
|
88
|
-
:pcdm_related_object_of: relatedObjectOf
|
94
|
+
:pcdm_related_object_of: relatedObjectOf
|
95
|
+
http://purl.org/ontology/bibo/:
|
96
|
+
:short_title: shortTitle
|
97
|
+
http://www.bbc.co.uk/ontologies/coreconcepts/:
|
98
|
+
:slug: slug
|
99
|
+
https://schema.org/:
|
100
|
+
:schema_image: image
|
@@ -0,0 +1,16 @@
|
|
1
|
+
The Digital Library Collections (DLC) website is a gateway to digital reproductions and descriptions of photographs, posters, drawings, objects, ephemera, and manuscripts as well as other archival material from Columbia's rare and special collections. It will continue to grow as more of our earlier digital projects are loaded in, as more of our special collections are digitized and described, and as hybrid and born-digital archival collections are acquired. The DLC website does not at present include scans of our rare or out-of-copyright digitized books or digitized newspapers, however; these and other historical digital content can be located by searching our [CLIO](http://clio.columbia.edu/) discovery system.
|
2
|
+
|
3
|
+
Digital content in the DLC website comes almost exclusively from Columbia University Libraries' distinctive collections, namely:
|
4
|
+
|
5
|
+
- [Avery Architectural & Fine Arts Library](http://library.columbia.edu/locations/avery.html)
|
6
|
+
- [Burke Library at Union Theological Seminary](http://library.columbia.edu/locations/burke.html)
|
7
|
+
- [C.V. Starr East Asian Library](http://library.columbia.edu/locations/eastasian.html)
|
8
|
+
- [Rare Book & Manuscript Library](http://library.columbia.edu/locations/rbml.html)
|
9
|
+
|
10
|
+
It is important to note that many collections in the DLC also have separate customized websites where the same content is displayed within a broader or thematic context. Where this is the case, links are provided so that content can be viewed in either context.
|
11
|
+
|
12
|
+
Columbia University is providing access to these materials for educational and research purposes only. For instructions about about obtaining reproductions of or republishing the items found in this site, please see the [Terms of Use](/terms_of_use) page.
|
13
|
+
|
14
|
+
More information about Columbia's archival collections, including collection finding aids, may be found within our [Archival Collections Portal](http://www.columbia.edu/cgi-bin/cul/resolve/?lweb0106).
|
15
|
+
|
16
|
+
Home page image credit: ["Empty steps, 1 AM"](https://www.flickr.com/photos/mmj171188/1836760843) by [Mira (on the wall)](https://www.flickr.com/photos/mmj171188/) is licensed under [CC BY NC SA 2.0](https://creativecommons.org/licenses/by-nc-sa/2.0/).
|
@@ -0,0 +1,58 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<foxml:digitalObject VERSION="1.1" PID="cul:vmcvdnck2d"
|
3
|
+
xmlns:foxml="info:fedora/fedora-system:def/foxml#"
|
4
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
5
|
+
xsi:schemaLocation="info:fedora/fedora-system:def/foxml# http://www.fedora.info/definitions/1/0/foxml1-1.xsd">
|
6
|
+
<foxml:objectProperties>
|
7
|
+
<foxml:property NAME="info:fedora/fedora-system:def/model#state" VALUE="Active"/>
|
8
|
+
<foxml:property NAME="info:fedora/fedora-system:def/model#label" VALUE="DLC Catalog"/>
|
9
|
+
<foxml:property NAME="info:fedora/fedora-system:def/model#ownerId" VALUE="fedoraAdmin"/>
|
10
|
+
<foxml:property NAME="info:fedora/fedora-system:def/model#createdDate" VALUE="2015-05-05T15:14:53.852Z"/>
|
11
|
+
<foxml:property NAME="info:fedora/fedora-system:def/view#lastModifiedDate" VALUE="2015-05-05T15:14:53.852Z"/>
|
12
|
+
</foxml:objectProperties>
|
13
|
+
<foxml:datastream ID="AUDIT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="false">
|
14
|
+
<foxml:datastreamVersion ID="AUDIT.0" LABEL="Audit Trail for this object" CREATED="2015-05-05T15:14:53.852Z" MIMETYPE="text/xml" FORMAT_URI="info:fedora/fedora-system:format/xml.fedora.audit">
|
15
|
+
<foxml:xmlContent>
|
16
|
+
<audit:auditTrail xmlns:audit="info:fedora/fedora-system:def/audit#">
|
17
|
+
</audit:auditTrail>
|
18
|
+
</foxml:xmlContent>
|
19
|
+
</foxml:datastreamVersion>
|
20
|
+
</foxml:datastream>
|
21
|
+
<foxml:datastream ID="DC" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
|
22
|
+
<foxml:datastreamVersion ID="DC1.0" LABEL="Dublin Core Record for this object" MIMETYPE="text/xml" FORMAT_URI="http://www.openarchives.org/OAI/2.0/oai_dc/">
|
23
|
+
<foxml:xmlContent>
|
24
|
+
<oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
|
25
|
+
<dc:title>DLC Catalog</dc:title>
|
26
|
+
<dc:type>Publish Target</dc:type>
|
27
|
+
<dc:identifier>cul:vmcvdnck2d</dc:identifier>
|
28
|
+
</oai_dc:dc>
|
29
|
+
</foxml:xmlContent>
|
30
|
+
</foxml:datastreamVersion>
|
31
|
+
</foxml:datastream>
|
32
|
+
<foxml:datastream ID="RELS-EXT" STATE="A" CONTROL_GROUP="X" VERSIONABLE="true">
|
33
|
+
<foxml:datastreamVersion ID="RELS-EXT.0" LABEL="Fedora Object-to-Object Relationship Metadata" MIMETYPE="application/rdf+xml">
|
34
|
+
<foxml:xmlContent>
|
35
|
+
<rdf:RDF xmlns:ns0="info:fedora/fedora-system:def/model#" xmlns:ns1="http://purl.oclc.org/NET/CUL/" xmlns:ns2="http://purl.org/dc/terms/" xmlns:ns3="http://www.bbc.co.uk/ontologies/coreconcepts/" xmlns:ns4="https://schema.org/" xmlns:ns5="http://purl.org/ontology/bibo/" xmlns:ns6="http://www.loc.gov/premis/rdf/v1#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
|
36
|
+
<rdf:Description rdf:about="info:fedora/cul:vmcvdnck2d">
|
37
|
+
<rdf:type rdf:resource="http://purl.oclc.org/NET/CUL/Aggregator"></rdf:type>
|
38
|
+
<ns0:hasModel rdf:resource="info:fedora/ldpd:Concept"></ns0:hasModel>
|
39
|
+
<ns2:title>Digital Library Collections</ns2:title>
|
40
|
+
<ns5:shortTitle>Digital Collections</ns5:shortTitle>
|
41
|
+
<ns2:source rdf:resource="https://dlc.library.columbia.edu/catalog"></ns2:source>
|
42
|
+
<ns2:abstract>The Digital Library Collections (DLC) website is a gateway to digital reproductions and descriptions of photographs, posters, drawings, objects, ephemera, and manuscripts as well as other archival material from Columbia's rare and special collections. As of January 2016 the DLC repository includes ca. 190,000 digital objects.</ns2:abstract>
|
43
|
+
<ns2:description rdf:resource="info:fedora/cul:vmcvdnck2d/description"></ns2:description>
|
44
|
+
<ns2:publisher rdf:resource="info:fedora/cul:vmcvdnck2d"></ns2:publisher>
|
45
|
+
<ns3:slug>catalog</ns3:slug>
|
46
|
+
<ns4:image rdf:resource="info:fedora/cul:1c59zw3rf4"></ns4:image>
|
47
|
+
<ns6:restriction>Onsite</ns6:restriction>
|
48
|
+
</rdf:Description>
|
49
|
+
</rdf:RDF>
|
50
|
+
</foxml:xmlContent>
|
51
|
+
</foxml:datastreamVersion>
|
52
|
+
</foxml:datastream>
|
53
|
+
<foxml:datastream ID="description" STATE="A" CONTROL_GROUP="M" VERSIONABLE="true">
|
54
|
+
<foxml:datastreamVersion ID="description.0" LABEL="Textual Description of Concept" MIMETYPE="text/markdown">
|
55
|
+
<foxml:binaryContent><%= Base64.encode64(description) %></foxml:binaryContent>
|
56
|
+
</foxml:datastreamVersion>
|
57
|
+
</foxml:datastream>
|
58
|
+
</foxml:digitalObject>
|
@@ -276,7 +276,7 @@ module Cul::Hydra::Solrizer
|
|
276
276
|
|
277
277
|
def item_in_context_url(node=mods)
|
278
278
|
item_in_context_url_val = []
|
279
|
-
node.xpath("./mods:location/mods:url[@access='object in context'
|
279
|
+
node.xpath("./mods:location/mods:url[@access='object in context']", MODS_NS).collect do |n|
|
280
280
|
item_in_context_url_val << ModsFieldable.normalize(n.text, true)
|
281
281
|
end
|
282
282
|
item_in_context_url_val
|
data/lib/cul_hydra/version.rb
CHANGED
data/lib/cul_hydra/version.rb~
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cul_hydra
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Armintor
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-11-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: blacklight
|
@@ -450,6 +450,7 @@ files:
|
|
450
450
|
- fixtures/cmodels/ldpd_sdep.StaticImageCore.xml
|
451
451
|
- fixtures/cmodels/ore_Proxy.xml
|
452
452
|
- fixtures/cmodels/pcdm_Collection.xml
|
453
|
+
- fixtures/spec/BLOB/dlc.md
|
453
454
|
- fixtures/spec/BLOB/test001.jpg
|
454
455
|
- fixtures/spec/CUL_DC/dc.xml
|
455
456
|
- fixtures/spec/CUL_MODS/mods-001.xml
|
@@ -485,6 +486,7 @@ files:
|
|
485
486
|
- fixtures/spec/CUL_MODS/mods-unmapped-project.xml
|
486
487
|
- fixtures/spec/CUL_SOLR/mods-001.xml
|
487
488
|
- fixtures/spec/CUL_SOLR/mods-001.yml
|
489
|
+
- fixtures/spec/FOXML/concept.xml.erb
|
488
490
|
- fixtures/spec/FOXML/content-aggregator.xml
|
489
491
|
- fixtures/spec/FOXML/content-cmodel.xml
|
490
492
|
- fixtures/spec/FOXML/image-cmodel.xml
|