linked_vocabs 0.2.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5078355060b71f3b05b1d72b0d2cf66d5851ec7b
4
- data.tar.gz: 424415eb503470073eed8d1120e9120438ac7516
3
+ metadata.gz: 495f7f5fe04b27ba44fdf20501cd39e678f9e49b
4
+ data.tar.gz: ae2c6a6cd9c4ad1356ea65600439b7527a1bce40
5
5
  SHA512:
6
- metadata.gz: 88ebf20502f9385e0b56149e802d4481442c56c26d558213159b9082813b214fa694ac2caf30dfc74dd32f39ba7fd131a75c3afbb5e19673463da4e50bdd34f5
7
- data.tar.gz: 282e714d4e05d4a557b61244b167d2fbb0e87f73041146d71b9256fbea2c97e2def28db3b24c39bb241e68101e56a2f3013e039c39a93e8233cc84aeb96f83c9
6
+ metadata.gz: 379ca87aa3570f2f52a1c0e92e7348d30eefbc9e3f8c2e2ff97b989d18c62f9a187a537115683eaa8fbedaffab2aceac38a3fcdd7d9ea8d3768aeab2e080937d
7
+ data.tar.gz: 556ee30a0e885c8d5d3e67dcdb522bc550bdbe0cb99a715108b0ab06fc0dcc676051f55ab02ace9b7afa125dfa4d532a2fdd33b88044fb7e819429d5d3ae16a0
data/lib/linked_vocabs.rb CHANGED
@@ -2,7 +2,8 @@ require 'active_triples'
2
2
  require 'active_model'
3
3
  require 'rdf/cli/vocab-loader'
4
4
 
5
- Dir['./lib/rdf/*.rb'].each { |f| require f }
5
+ require 'rdf/vocab'
6
+ Dir['./lib/rdf/vocab/*.rb'].each { |f| require f }
6
7
 
7
8
  require 'linked_vocabs/version'
8
9
  require 'linked_vocabs/validators'
@@ -11,7 +11,7 @@ module LinkedVocabs
11
11
 
12
12
  def self.included(klass)
13
13
  klass.extend ClassMethods
14
- klass.property :hiddenLabel, :predicate => RDF::SKOS.hiddenLabel
14
+ klass.property :hiddenLabel, predicate: RDF::Vocab::SKOS.hiddenLabel
15
15
  klass.validates_with LinkedVocabs::Validators::AuthorityValidator
16
16
  end
17
17
 
@@ -54,24 +54,39 @@ module LinkedVocabs
54
54
  end
55
55
 
56
56
  def in_vocab?
57
- return false unless self.class.uses_vocab_prefix?(rdf_subject.to_s)
58
- self.class.vocabularies.each do |vocab, config|
59
- return false if rdf_subject == config[:prefix]
60
- return false if config[:class].strict? and not config[:class].respond_to? rdf_subject.to_s.gsub(config[:prefix], '').to_sym
61
- end
57
+ vocab, config = self.class.matching_vocab(rdf_subject.to_s)
58
+ return false unless vocab
59
+ return false if rdf_subject == config[:prefix]
60
+ return false if config[:class].strict? and not config[:class].respond_to? rdf_subject.to_s.gsub(config[:prefix], '').to_sym
62
61
  true
63
62
  end
64
63
 
65
64
  def rdf_label
66
- labels = Array(self.class.rdf_label)
67
- labels += default_labels
65
+ labels = Array(self.class.rdf_label) + default_labels
68
66
  labels.each do |label|
69
- values = get_values(label) if values.blank?
67
+ values = label_with_preferred_language(label) if values.blank?
70
68
  return values unless values.empty?
71
69
  end
72
70
  node? ? [] : [rdf_subject.to_s]
73
71
  end
74
72
 
73
+ def label_with_preferred_language(label)
74
+ values = get_values(label, :literal => true)
75
+ preferred_languages.each do |preferred_language|
76
+ result = filter_by_language(values, preferred_language)
77
+ return result.map(&:to_s) unless result.blank?
78
+ end
79
+ values.map(&:to_s)
80
+ end
81
+
82
+ def filter_by_language(values, language)
83
+ values.select { |x| x.language == language}
84
+ end
85
+
86
+ def preferred_languages
87
+ [:en, :"en-us"]
88
+ end
89
+
75
90
  ##
76
91
  # Class methods for adding and using controlled vocabularies
77
92
  module ClassMethods
@@ -113,10 +128,13 @@ module LinkedVocabs
113
128
  end
114
129
 
115
130
  def uses_vocab_prefix?(str)
116
- vocabularies.each do |vocab, config|
117
- return true if str.start_with? config[:prefix]
131
+ !!matching_vocab(str)
132
+ end
133
+
134
+ def matching_vocab(str)
135
+ vocabularies.find do |vocab, config|
136
+ str.start_with? config[:prefix]
118
137
  end
119
- false
120
138
  end
121
139
 
122
140
  def qa_interface
@@ -126,7 +144,7 @@ module LinkedVocabs
126
144
  private
127
145
 
128
146
  def name_to_class(name)
129
- "RDF::#{name.upcase.to_s}".constantize
147
+ "RDF::Vocab::#{name.upcase.to_s}".constantize
130
148
  end
131
149
 
132
150
  def load_vocab(name)
@@ -179,8 +197,8 @@ module LinkedVocabs
179
197
  def solutions_from_sparql_query(query)
180
198
  # @TODO: labels should be taken from ActiveTriples::Resource.
181
199
  # However, the default labels there are hidden behind a private method.
182
- labels = [RDF::SKOS.prefLabel,
183
- RDF::DC.title,
200
+ labels = [RDF::Vocab::SKOS.prefLabel,
201
+ RDF::Vocab::DC.title,
184
202
  RDF::RDFS.label]
185
203
  labels << @parent.rdf_label unless @parent.rdf_label.nil?
186
204
 
@@ -7,7 +7,7 @@ module LinkedVocabs::Validators
7
7
  unless v.try(:in_vocab?)
8
8
  term = v.try(:rdf_subject) || v
9
9
  vocabularies = record.class.properties[attribute.to_s].class_name.vocabularies.keys
10
- record.errors.add :base, "value `#{term} for `#{attribute}` property is not a term in a controlled vocabulary #{vocabularies.join(', ')}"
10
+ record.errors.add :base, "value `#{term}' for `#{attribute}' property is not a term in a controlled vocabulary #{vocabularies.join(', ')}"
11
11
  end
12
12
  end
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module LinkedVocabs
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
@@ -1,7 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  # This file generated automatically using vocab-fetch from http://id.loc.gov/authorities/subjects/
3
3
  require 'rdf'
4
- module RDF
4
+ module RDF::Vocab
5
5
  class LCSH < RDF::Vocabulary("http://id.loc.gov/authorities/subjects/")
6
6
  # terms not fetched by vocab-fetch
7
7
  end
@@ -25,6 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency 'rake'
26
26
  spec.add_dependency 'active-triples', '>=0.6.0'
27
27
  spec.add_dependency 'rdf', '>=1.1.2.1'
28
+ spec.add_dependency 'rdf-vocab'
28
29
  spec.add_dependency 'sparql'
29
30
  spec.add_dependency 'sparql-client'
30
31
 
@@ -6,8 +6,8 @@ describe LinkedVocabs::Controlled do
6
6
  class DummyAuthority < ActiveTriples::Resource
7
7
  include LinkedVocabs::Controlled
8
8
  configure :repository => :default
9
- use_vocabulary :dcmitype
10
- property :title, :predicate => RDF::DC.title
9
+ use_vocabulary :dcmitype, class: RDF::Vocab::DCMIType
10
+ property :title, predicate: RDF::Vocab::DC.title
11
11
  end
12
12
  end
13
13
 
@@ -29,7 +29,7 @@ describe LinkedVocabs::Controlled do
29
29
  expect(subject.vocabularies).to include :dcmitype
30
30
  end
31
31
  it 'should find its vocabulary class' do
32
- expect(subject.vocabularies[:dcmitype][:class]).to eq RDF::DCMITYPE
32
+ expect(subject.vocabularies[:dcmitype][:class]).to eq RDF::Vocab::DCMIType
33
33
  end
34
34
  it 'should allow multiple vocabularies' do
35
35
  subject.use_vocabulary :lcsh
@@ -62,27 +62,29 @@ describe LinkedVocabs::Controlled do
62
62
  expect(subject.title).to eq ["English", "French"]
63
63
  end
64
64
  end
65
- # context "when there are english labels" do
66
- # before do
67
- # subject.title = RDF::Literal.new("English", :langauge => :en)
68
- # end
69
- # context "and plain labels" do
70
- # before do
71
- # subject.title = ["Plain", RDF::Literal.new("English", :language => :en)]
72
- # end
73
- # it "should return the english label" do
74
- # expect(subject.rdf_label).to eq ["English"]
75
- # end
76
- # end
77
- # context "and other language labels" do
78
- # before do
79
- # subject.title = [RDF::Literal.new("French", :language => :fr), RDF::Literal.new("English", :language => :en)]
80
- # end
81
- # it "should return the english label" do
82
- # expect(subject.rdf_label).to eq ["English"]
83
- # end
84
- # end
85
- # end
65
+
66
+ context "when there are english labels" do
67
+ before do
68
+ subject.title = RDF::Literal.new("English", :langauge => :en)
69
+ end
70
+ context "and plain labels" do
71
+ before do
72
+ subject.title = ["Plain", RDF::Literal.new("English", :language => :en)]
73
+ end
74
+ it "should return the english label" do
75
+ expect(subject.rdf_label).to eq ["English"]
76
+ end
77
+ end
78
+
79
+ context "and other language labels" do
80
+ before do
81
+ subject.title = [RDF::Literal.new("French", :language => :fr), RDF::Literal.new("English", :language => :en)]
82
+ end
83
+ it "should return the english label" do
84
+ expect(subject.rdf_label).to eq ["English"]
85
+ end
86
+ end
87
+ end
86
88
  end
87
89
 
88
90
  describe '#load_vocabularies' do
@@ -108,7 +110,7 @@ describe LinkedVocabs::Controlled do
108
110
  describe 'non-label matches' do
109
111
  before do
110
112
  doc = subject.new('Text')
111
- doc << RDF::Statement(doc.rdf_subject, RDF::DC.description, "This is not an image!")
113
+ doc << RDF::Statement(doc.rdf_subject, RDF::Vocab::DC.description, "This is not an image!")
112
114
  doc.persist!
113
115
  end
114
116
 
@@ -127,18 +129,18 @@ describe LinkedVocabs::Controlled do
127
129
  describe 'uris' do
128
130
  it 'should use a vocabulary uri' do
129
131
  dummy = DummyAuthority.new('Image')
130
- expect(dummy.rdf_subject).to eq RDF::DCMITYPE.Image
132
+ expect(dummy.rdf_subject).to eq RDF::Vocab::DCMIType.Image
131
133
  end
132
134
  it 'should accept a full uri' do
133
- dummy = DummyAuthority.new(RDF::DCMITYPE.Image)
134
- expect(dummy.rdf_subject).to eq RDF::DCMITYPE.Image
135
+ dummy = DummyAuthority.new(RDF::Vocab::DCMIType.Image)
136
+ expect(dummy.rdf_subject).to eq RDF::Vocab::DCMIType.Image
135
137
  end
136
138
  it 'should accept a string for a full uri' do
137
- dummy = DummyAuthority.new(RDF::DCMITYPE.Image.to_s)
138
- expect(dummy.rdf_subject).to eq RDF::DCMITYPE.Image
139
+ dummy = DummyAuthority.new(RDF::Vocab::DCMIType.Image.to_s)
140
+ expect(dummy.rdf_subject).to eq RDF::Vocab::DCMIType.Image
139
141
  end
140
142
  it 'raises an error if the term is not in the vocabulary' do
141
- expect{ DummyAuthority.new('FakeTerm') }.to raise_error
143
+ expect { DummyAuthority.new('FakeTerm') }.to raise_error RuntimeError, "could not make a valid RDF::URI from FakeTerm"
142
144
  end
143
145
  it 'is invalid if the uri is not in the vocabulary' do
144
146
  d = DummyAuthority.new(RDF::URI('http://example.org/blah'))
@@ -162,15 +164,38 @@ describe LinkedVocabs::Controlled do
162
164
  DummyAuthority.use_vocabulary :geonames
163
165
  end
164
166
  it 'should make uri for terms not defined' do
165
- expect(DummyAuthority.new('http://sws.geonames.org/FakeTerm').rdf_subject).to eq RDF::GEONAMES.FakeTerm
166
- p end
167
+ expect(DummyAuthority.new('http://id.loc.gov/authorities/subjects/FakeTerm').rdf_subject).to eq RDF::Vocab::LCSH.FakeTerm
168
+ end
167
169
  it 'should use strict uri when one is available' do
168
- expect(DummyAuthority.new('Image').rdf_subject).to eq RDF::DCMITYPE.Image
170
+ expect(DummyAuthority.new('Image').rdf_subject).to eq RDF::Vocab::DCMIType.Image
169
171
  end
170
172
  it 'should raise error for terms that are not clear' do
171
173
  DummyAuthority.use_vocabulary :lcsh
172
- expect{ DummyAuthority.new('FakeTerm').rdf_subject }.to raise_error
174
+ expect { DummyAuthority.new('FakeTerm').rdf_subject }.to raise_error RuntimeError, 'could not make a valid RDF::URI from FakeTerm'
173
175
  end
174
176
  end
175
177
  end
178
+
179
+ describe "#in_vocab?" do
180
+ context "with more than one vocabulary" do
181
+ before do
182
+ class DummyAuthorityWithTwoVocabs < ActiveTriples::Resource
183
+ include LinkedVocabs::Controlled
184
+ configure :repository => :default
185
+ use_vocabulary :dcmitype, class: RDF::Vocab::DCMIType
186
+ use_vocabulary :lcsh
187
+ property :title, predicate: RDF::Vocab::DC.title
188
+ end
189
+ end
190
+
191
+ after do
192
+ Object.send(:remove_const, 'DummyAuthorityWithTwoVocabs')
193
+ end
194
+
195
+ let(:uri) { RDF::URI.new('http://id.loc.gov/authorities/subjects/sh85062487') }
196
+ subject { DummyAuthorityWithTwoVocabs.new(uri) }
197
+
198
+ it { is_expected.to be_in_vocab }
199
+ end
200
+ end
176
201
  end
@@ -4,15 +4,15 @@ describe LinkedVocabs::Validators::PropertyValidator do
4
4
  before do
5
5
  class DummyAuthority < ActiveTriples::Resource
6
6
  include LinkedVocabs::Controlled
7
- use_vocabulary :dcmitype
7
+ use_vocabulary :dcmitype, class: RDF::Vocab::DCMIType
8
8
 
9
- property :dctype, :predicate => RDF::DC.type, :class_name => DummyAuthority
9
+ property :dctype, predicate: RDF::Vocab::DC.type, class_name: DummyAuthority
10
10
  end
11
11
 
12
12
  class DummyResource < ActiveTriples::Resource
13
13
  validates_vocabulary_of :dctype
14
14
 
15
- property :dctype, :predicate => RDF::DC.type, :class_name => DummyAuthority
15
+ property :dctype, predicate: RDF::Vocab::DC.type, class_name: DummyAuthority
16
16
  end
17
17
  end
18
18
 
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,3 @@
1
- require 'rspec/autorun'
2
-
3
1
  require 'linked_vocabs'
4
2
 
5
3
  RSpec.configure do |config|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linked_vocabs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
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-03-19 00:00:00.000000000 Z
11
+ date: 2016-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,6 +108,20 @@ dependencies:
108
108
  - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: 1.1.2.1
111
+ - !ruby/object:Gem::Dependency
112
+ name: rdf-vocab
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: sparql
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -156,9 +170,7 @@ files:
156
170
  - lib/linked_vocabs/validators/property_validator.rb
157
171
  - lib/linked_vocabs/version.rb
158
172
  - lib/linked_vocabs/vocabularies.rb
159
- - lib/rdf/dcmitype.rb
160
- - lib/rdf/geonames.rb
161
- - lib/rdf/lcsh.rb
173
+ - lib/rdf/vocab/lcsh.rb
162
174
  - linked_vocabs.gemspec
163
175
  - spec/controlled_spec.rb
164
176
  - spec/linked_vocabs_spec.rb
@@ -184,7 +196,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
196
  version: '0'
185
197
  requirements: []
186
198
  rubyforge_project:
187
- rubygems_version: 2.2.1
199
+ rubygems_version: 2.2.0
188
200
  signing_key:
189
201
  specification_version: 4
190
202
  summary: Linked Data Controlled Vocabularies for ActiveFedora::Rdf.
data/lib/rdf/dcmitype.rb DELETED
@@ -1,138 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- # This file generated automatically using vocab-fetch from http://dublincore.org/2012/06/14/dctype.rdf
3
- require 'rdf'
4
- module RDF
5
- class DCMITYPE < RDF::StrictVocabulary("http://purl.org/dc/dcmitype/")
6
-
7
- # Class definitions
8
- term :Collection,
9
- comment: %(An aggregation of resources.).freeze,
10
- "dc:description" => %(A collection is described as a group; its parts may also be separately described.).freeze,
11
- "dc:hasVersion" => %(http://dublincore.org/usage/terms/history/#Collection-003).freeze,
12
- "dc:issued" => %(2000-07-11).freeze,
13
- "dc:modified" => %(2008-01-14).freeze,
14
- "http://purl.org/dc/dcam/memberOf" => %(dc:DCMIType).freeze,
15
- label: "Collection".freeze,
16
- "rdfs:isDefinedBy" => %(dcmitype:).freeze,
17
- type: "rdfs:Class".freeze
18
- term :Dataset,
19
- comment: %(Data encoded in a defined structure.).freeze,
20
- "dc:description" => %(Examples include lists, tables, and databases. A dataset may be useful for direct machine processing.).freeze,
21
- "dc:hasVersion" => %(http://dublincore.org/usage/terms/history/#Dataset-003).freeze,
22
- "dc:issued" => %(2000-07-11).freeze,
23
- "dc:modified" => %(2008-01-14).freeze,
24
- "http://purl.org/dc/dcam/memberOf" => %(dc:DCMIType).freeze,
25
- label: "Dataset".freeze,
26
- "rdfs:isDefinedBy" => %(dcmitype:).freeze,
27
- type: "rdfs:Class".freeze
28
- term :Event,
29
- comment: %(A non-persistent, time-based occurrence.).freeze,
30
- "dc:description" => %(Metadata for an event provides descriptive information that is the basis for discovery of the purpose, location, duration, and responsible agents associated with an event. Examples include an exhibition, webcast, conference, workshop, open day, performance, battle, trial, wedding, tea party, conflagration.).freeze,
31
- "dc:hasVersion" => %(http://dublincore.org/usage/terms/history/#Event-003).freeze,
32
- "dc:issued" => %(2000-07-11).freeze,
33
- "dc:modified" => %(2008-01-14).freeze,
34
- "http://purl.org/dc/dcam/memberOf" => %(dc:DCMIType).freeze,
35
- label: "Event".freeze,
36
- "rdfs:isDefinedBy" => %(dcmitype:).freeze,
37
- type: "rdfs:Class".freeze
38
- term :Image,
39
- comment: %(A visual representation other than text.).freeze,
40
- "dc:description" => %(Examples include images and photographs of physical objects, paintings, prints, drawings, other images and graphics, animations and moving pictures, film, diagrams, maps, musical notation. Note that Image may include both electronic and physical representations.).freeze,
41
- "dc:hasVersion" => %(http://dublincore.org/usage/terms/history/#Image-004).freeze,
42
- "dc:issued" => %(2000-07-11).freeze,
43
- "dc:modified" => %(2008-01-14).freeze,
44
- "http://purl.org/dc/dcam/memberOf" => %(dc:DCMIType).freeze,
45
- label: "Image".freeze,
46
- "rdfs:isDefinedBy" => %(dcmitype:).freeze,
47
- type: "rdfs:Class".freeze
48
- term :InteractiveResource,
49
- comment: %(A resource requiring interaction from the user to be understood, executed, or experienced.).freeze,
50
- "dc:description" => %(Examples include forms on Web pages, applets, multimedia learning objects, chat services, or virtual reality environments.).freeze,
51
- "dc:hasVersion" => %(http://dublincore.org/usage/terms/history/#InteractiveResource-003).freeze,
52
- "dc:issued" => %(2000-07-11).freeze,
53
- "dc:modified" => %(2008-01-14).freeze,
54
- "http://purl.org/dc/dcam/memberOf" => %(dc:DCMIType).freeze,
55
- label: "Interactive Resource".freeze,
56
- "rdfs:isDefinedBy" => %(dcmitype:).freeze,
57
- type: "rdfs:Class".freeze
58
- term :MovingImage,
59
- comment: %(A series of visual representations imparting an impression of motion when shown in succession.).freeze,
60
- "dc:description" => %(Examples include animations, movies, television programs, videos, zoetropes, or visual output from a simulation. Instances of the type Moving Image must also be describable as instances of the broader type Image.).freeze,
61
- "dc:hasVersion" => %(http://dublincore.org/usage/terms/history/#MovingImage-003).freeze,
62
- "dc:issued" => %(2003-11-18).freeze,
63
- "dc:modified" => %(2008-01-14).freeze,
64
- "http://purl.org/dc/dcam/memberOf" => %(dc:DCMIType).freeze,
65
- label: "Moving Image".freeze,
66
- "rdfs:isDefinedBy" => %(dcmitype:).freeze,
67
- subClassOf: "dcmitype:Image".freeze,
68
- type: "rdfs:Class".freeze
69
- term :PhysicalObject,
70
- comment: %(An inanimate, three-dimensional object or substance.).freeze,
71
- "dc:description" => %(Note that digital representations of, or surrogates for, these objects should use Image, Text or one of the other types.).freeze,
72
- "dc:hasVersion" => %(http://dublincore.org/usage/terms/history/#PhysicalObject-003).freeze,
73
- "dc:issued" => %(2002-07-13).freeze,
74
- "dc:modified" => %(2008-01-14).freeze,
75
- "http://purl.org/dc/dcam/memberOf" => %(dc:DCMIType).freeze,
76
- label: "Physical Object".freeze,
77
- "rdfs:isDefinedBy" => %(dcmitype:).freeze,
78
- type: "rdfs:Class".freeze
79
- term :Service,
80
- comment: %(A system that provides one or more functions.).freeze,
81
- "dc:description" => %(Examples include a photocopying service, a banking service, an authentication service, interlibrary loans, a Z39.50 or Web server.).freeze,
82
- "dc:hasVersion" => %(http://dublincore.org/usage/terms/history/#Service-003).freeze,
83
- "dc:issued" => %(2000-07-11).freeze,
84
- "dc:modified" => %(2008-01-14).freeze,
85
- "http://purl.org/dc/dcam/memberOf" => %(dc:DCMIType).freeze,
86
- label: "Service".freeze,
87
- "rdfs:isDefinedBy" => %(dcmitype:).freeze,
88
- type: "rdfs:Class".freeze
89
- term :Software,
90
- comment: %(A computer program in source or compiled form.).freeze,
91
- "dc:description" => %(Examples include a C source file, MS-Windows .exe executable, or Perl script.).freeze,
92
- "dc:hasVersion" => %(http://dublincore.org/usage/terms/history/#Software-003).freeze,
93
- "dc:issued" => %(2000-07-11).freeze,
94
- "dc:modified" => %(2008-01-14).freeze,
95
- "http://purl.org/dc/dcam/memberOf" => %(dc:DCMIType).freeze,
96
- label: "Software".freeze,
97
- "rdfs:isDefinedBy" => %(dcmitype:).freeze,
98
- type: "rdfs:Class".freeze
99
- term :Sound,
100
- comment: %(A resource primarily intended to be heard.).freeze,
101
- "dc:description" => %(Examples include a music playback file format, an audio compact disc, and recorded speech or sounds.).freeze,
102
- "dc:hasVersion" => %(http://dublincore.org/usage/terms/history/#Sound-003).freeze,
103
- "dc:issued" => %(2000-07-11).freeze,
104
- "dc:modified" => %(2008-01-14).freeze,
105
- "http://purl.org/dc/dcam/memberOf" => %(dc:DCMIType).freeze,
106
- label: "Sound".freeze,
107
- "rdfs:isDefinedBy" => %(dcmitype:).freeze,
108
- type: "rdfs:Class".freeze
109
- term :StillImage,
110
- comment: %(A static visual representation.).freeze,
111
- "dc:description" => %(Examples include paintings, drawings, graphic designs, plans and maps. Recommended best practice is to assign the type Text to images of textual materials. Instances of the type Still Image must also be describable as instances of the broader type Image.).freeze,
112
- "dc:hasVersion" => %(http://dublincore.org/usage/terms/history/#StillImage-003).freeze,
113
- "dc:issued" => %(2003-11-18).freeze,
114
- "dc:modified" => %(2008-01-14).freeze,
115
- "http://purl.org/dc/dcam/memberOf" => %(dc:DCMIType).freeze,
116
- label: "Still Image".freeze,
117
- "rdfs:isDefinedBy" => %(dcmitype:).freeze,
118
- subClassOf: "dcmitype:Image".freeze,
119
- type: "rdfs:Class".freeze
120
- term :Text,
121
- comment: %(A resource consisting primarily of words for reading.).freeze,
122
- "dc:description" => %(Examples include books, letters, dissertations, poems, newspapers, articles, archives of mailing lists. Note that facsimiles or images of texts are still of the genre Text.).freeze,
123
- "dc:hasVersion" => %(http://dublincore.org/usage/terms/history/#Text-003).freeze,
124
- "dc:issued" => %(2000-07-11).freeze,
125
- "dc:modified" => %(2008-01-14).freeze,
126
- "http://purl.org/dc/dcam/memberOf" => %(dc:DCMIType).freeze,
127
- label: "Text".freeze,
128
- "rdfs:isDefinedBy" => %(dcmitype:).freeze,
129
- type: "rdfs:Class".freeze
130
-
131
- # Extra definitions
132
- term :"",
133
- "dc:modified" => %(2012-06-14).freeze,
134
- "dc:publisher" => %(http://purl.org/dc/aboutdcmi#DCMI).freeze,
135
- "dc:title" => %(DCMI Type Vocabulary).freeze,
136
- label: "".freeze
137
- end
138
- end
data/lib/rdf/geonames.rb DELETED
@@ -1,8 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- # This file generated automatically using vocab-fetch from http://sws.geonames.org/
3
- require 'rdf'
4
- module RDF
5
- class GEONAMES < RDF::Vocabulary("http://sws.geonames.org/")
6
- # terms not fetched by vocab-fetch
7
- end
8
- end