dpla-map 4.0.0.0.pre.11 → 4.0.0.0.pre.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/dpla-map.gemspec +0 -1
- data/lib/dpla/map.rb +1 -6
- data/lib/dpla/map/controlled/dcmitype.rb +2 -4
- data/lib/dpla/map/controlled/genre.rb +0 -4
- data/lib/dpla/map/controlled/language.rb +0 -4
- data/lib/dpla/map/source_resource.rb +0 -1
- data/lib/dpla/map/version.rb +1 -1
- data/spec/lib/dpla_spec.rb +32 -1
- metadata +2 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e236a1a3ba86fb86369bdec3c3ed2d1ab7574cac
|
4
|
+
data.tar.gz: b77d05ed046373454880c183274389e33b00833d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2f37276c9a897a15106d8cd4e7214b41ae0c393dd75e48df09774dd3cb179113046104cb8ab3e74b13bf98ce6f5805f27450680450bb18016a092c888f3cae98
|
7
|
+
data.tar.gz: 26a0832c886399b4926a71caa50f01e9a7fc712b345b00d55a90077e0fbee1a5d5ddf7dbf87b2b0518c315c0c070f6487868a9b3bf53d9bb0ba187e6c1e44846
|
data/dpla-map.gemspec
CHANGED
@@ -20,7 +20,6 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.require_paths = ['lib', 'lib/dpla', 'lib/dpla/map', 'lib/rdf']
|
21
21
|
|
22
22
|
s.add_dependency 'active-triples', '~>0.6.0'
|
23
|
-
s.add_dependency 'linked_vocabs', '~>0.2.0'
|
24
23
|
|
25
24
|
s.add_development_dependency 'rspec'
|
26
25
|
s.add_development_dependency 'pry'
|
data/lib/dpla/map.rb
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'active_triples'
|
2
|
-
require 'linked_vocabs'
|
3
2
|
|
4
3
|
require 'date'
|
5
4
|
|
5
|
+
require 'rdf/turtle'
|
6
6
|
require 'rdf/dpla'
|
7
7
|
|
8
8
|
require 'rdf/aat'
|
@@ -15,11 +15,6 @@ require 'rdf/ore'
|
|
15
15
|
|
16
16
|
module DPLA
|
17
17
|
module MAP
|
18
|
-
LinkedVocabs.add_vocabulary(:aat, 'http://vocab.getty.edu/aat/')
|
19
|
-
LinkedVocabs.add_vocabulary(:iso_639_3, 'http://lexvo.org/id/iso639-3/')
|
20
|
-
LinkedVocabs.add_vocabulary(:gn, 'http://www.geonames.org/ontology#', :source => 'http://www.geonames.org/ontology/ontology_v3.1.rdf', :fetch => true)
|
21
|
-
|
22
|
-
|
23
18
|
autoload :SourceResource, 'dpla/map/source_resource'
|
24
19
|
autoload :Collection, 'dpla/map/collection'
|
25
20
|
autoload :Place, 'dpla/map/place'
|
@@ -1,10 +1,8 @@
|
|
1
1
|
module DPLA::MAP
|
2
2
|
module Controlled
|
3
3
|
class DCMIType < DPLA::MAP::Concept
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
use_vocabulary :dcmitype
|
4
|
+
configure :type => RDF::RDFS.Class,
|
5
|
+
:base_uri => RDF::URI('http://purl.org/dc/dcmitype/')
|
8
6
|
end
|
9
7
|
end
|
10
8
|
end
|
@@ -1,11 +1,7 @@
|
|
1
1
|
module DPLA::MAP
|
2
2
|
module Controlled
|
3
3
|
class Genre < DPLA::MAP::Concept
|
4
|
-
include LinkedVocabs::Controlled
|
5
|
-
|
6
4
|
configure :base_uri => 'http://vocab.getty.edu/aat/', :type => 'http://vocab.getty.edu/ontology#Concept'
|
7
|
-
|
8
|
-
use_vocabulary :aat
|
9
5
|
end
|
10
6
|
end
|
11
7
|
end
|
@@ -1,13 +1,9 @@
|
|
1
1
|
module DPLA::MAP
|
2
2
|
module Controlled
|
3
3
|
class Language < DPLA::MAP::Concept
|
4
|
-
include LinkedVocabs::Controlled
|
5
|
-
|
6
4
|
configure :base_uri => "http://lexvo.org/id/iso639-3/",
|
7
5
|
:rdf_label => RDF::SKOS.prefLabel,
|
8
6
|
:type => RDF::DC.LinguisticSystem
|
9
|
-
|
10
|
-
use_vocabulary :iso_639_3
|
11
7
|
end
|
12
8
|
end
|
13
9
|
end
|
@@ -3,7 +3,6 @@ module DPLA::MAP
|
|
3
3
|
configure :base_uri => 'http://dp.la/api/items/', :type => RDF::DPLA.SourceResource
|
4
4
|
|
5
5
|
validates_presence_of :rights, :title
|
6
|
-
validates_vocabulary_of :dctype, :genre, :language
|
7
6
|
|
8
7
|
property :alternative, :predicate => RDF::DC.alternative
|
9
8
|
property :collection, :predicate => RDF::DC.isPartOf, :class_name => 'DPLA::MAP::Collection'
|
data/lib/dpla/map/version.rb
CHANGED
data/spec/lib/dpla_spec.rb
CHANGED
@@ -23,4 +23,35 @@ describe DPLA::MAP::SourceResource do
|
|
23
23
|
it 'has a dcterms:type that is a DPLA::MAP::Controlled::DCMIType' do
|
24
24
|
expect(subject.dctype).to contain_exactly(an_instance_of(DPLA::MAP::Controlled::DCMIType))
|
25
25
|
end
|
26
|
-
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe DPLA::MAP::Aggregation do
|
29
|
+
subject { build(:aggregation) }
|
30
|
+
|
31
|
+
it 'has nested values' do
|
32
|
+
expect(subject.sourceResource.first.subject.first.prefLabel)
|
33
|
+
.to contain_exactly('Gay activists')
|
34
|
+
end
|
35
|
+
|
36
|
+
context 'when built from parsed graph' do
|
37
|
+
let(:parsed) do
|
38
|
+
lang = DPLA::MAP::Controlled::Language.new
|
39
|
+
lang.providedLabel = label
|
40
|
+
subject.sourceResource.first.language = lang
|
41
|
+
|
42
|
+
uri = RDF::URI('http://example.org/moomin')
|
43
|
+
subject.set_subject!(uri)
|
44
|
+
|
45
|
+
agg = DPLA::MAP::Aggregation.new(uri)
|
46
|
+
agg << RDF::Reader.for(:ttl).new(subject.dump(:ttl))
|
47
|
+
agg
|
48
|
+
end
|
49
|
+
|
50
|
+
let(:label) { 'eng' }
|
51
|
+
|
52
|
+
it 'has nested values' do
|
53
|
+
expect(parsed.sourceResource.first.language.first.providedLabel)
|
54
|
+
.to contain_exactly(label)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dpla-map
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.0.0.pre.
|
4
|
+
version: 4.0.0.0.pre.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Johnson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: active-triples
|
@@ -24,20 +24,6 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 0.6.0
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: linked_vocabs
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.2.0
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.2.0
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: rspec
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|