rdf-marmotta 0.0.4 → 0.0.6

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: ca8d084b6dd3a1127eace872b52c7b6ca941b766
4
- data.tar.gz: 22b92c906a5e092328e735fa60b8b00f3963b7c9
3
+ metadata.gz: 4d25c88d77d8ced4a8c4bcb17822f614bce46248
4
+ data.tar.gz: ceba3df460c114a78b5eea6b146f79d007404c39
5
5
  SHA512:
6
- metadata.gz: a15e863ab6c6af68a43c7ff133fa608bfe45159ebdbb7d82665b2a5e4a346483e05c504275314d79dc9a84f9c58efe928cae6e28708ac8cd05d6d3733739adc8
7
- data.tar.gz: 309eba551ec09d8b647476d3d9daf0615afca7ccc663633a08189b6e6dd4f07f1219234bcbcd611456da2defbf80ba52dca8792c8a32abbb1f2203184b0006d8
6
+ metadata.gz: 4e1e5c2b40b5db654e827a3347cc8f1ea89f4218da9b850fca6acc313fae889b649838baebaa28db4d1d6926d18f83c64dda6962bdd41117d21889cbe70be4c1
7
+ data.tar.gz: d234bc13325174069d95f206ec97408aa04c3be62d19a2825c0379c174ca609ac427b7111fd2142a196eafbebe28853fc91132cef27902a2f83d6d84c94233a6
@@ -0,0 +1,3 @@
1
+ Gemfile.lock
2
+ *.gem
3
+ tmp
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ bundler_args: --without debug
3
+ script: "bundle exec rake ci"
4
+ rvm:
5
+ - 2.1.3
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  RDF::Marmotta
2
2
  =============
3
3
 
4
- A Ruby RDF::Repository implementation for Apache Marmotta.
4
+ A Ruby RDF::Repository implementation for [Apache Marmotta](http://marmotta.apache.org).
5
5
 
6
6
  Installing & Using
7
7
  ------------------
@@ -0,0 +1,23 @@
1
+ require 'rspec/core'
2
+ require 'rspec/core/rake_task'
3
+
4
+ require 'jettywrapper'
5
+
6
+ import 'lib/tasks/jetty.rake'
7
+
8
+ MARMOTTA_HOME = ENV['MARMOTTA_HOME'] ||
9
+ File.expand_path(File.join(Jettywrapper.app_root, 'marmotta'))
10
+
11
+ Jettywrapper.url =
12
+ 'https://github.com/dpla/marmotta-jetty/archive/3.3.0-solr-4.9.0.zip'
13
+
14
+ desc "Run all specs in spec directory"
15
+ task :ci => ['jetty:clean'] do
16
+ Jettywrapper.wrap(quiet: true, jetty_port: 8983, :startup_wait => 30) do
17
+ Rake::Task["spec"].invoke
18
+ end
19
+ end
20
+
21
+ desc "Run all specs in spec directory (excluding plugin specs)"
22
+ RSpec::Core::RakeTask.new(:spec)
23
+ task :default => :ci
@@ -0,0 +1,24 @@
1
+ This is free and unencumbered software released into the public domain.
2
+
3
+ Anyone is free to copy, modify, publish, use, compile, sell, or
4
+ distribute this software, either in source code form or as a compiled
5
+ binary, for any purpose, commercial or non-commercial, and by any
6
+ means.
7
+
8
+ In jurisdictions that recognize copyright laws, the author or authors
9
+ of this software dedicate any and all copyright interest in the
10
+ software to the public domain. We make this dedication for the benefit
11
+ of the public at large and to the detriment of our heirs and
12
+ successors. We intend this dedication to be an overt act of
13
+ relinquishment in perpetuity of all present and future rights to this
14
+ software under copyright law.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19
+ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20
+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ For more information, please refer to <http://unlicense.org/>
File without changes
@@ -14,11 +14,25 @@ module RDF
14
14
  :ldpath => 'ldpath'
15
15
  }
16
16
 
17
+ ##
18
+ # Supported Accept headers for Marmotta. As of 3.3.0, Marmotta will reject
19
+ # a request if the first content type listed is not suppported.
20
+ #
21
+ # @see https://issues.apache.org/jira/browse/MARMOTTA-585
22
+ CTYPES = RDF::Format.content_types.select do |key, values|
23
+ !(values.map(&:to_s) & ['RDF::RDFXML::Format',
24
+ 'RDF::Turtle::Format',
25
+ 'RDF::TriG::Format',
26
+ 'RDF::TriX::Format',
27
+ 'RDF::N3::Format']).empty?
28
+ end
29
+
17
30
  def initialize(base_url, options = {})
18
31
  @endpoints = DEFAULT_OPTIONS
19
32
  @endpoints.merge!(options)
20
33
  @endpoints.each do |k, v|
21
- @endpoints[k] = URI(base_url.to_s + v.to_s) unless v.is_a? ::URI
34
+ next unless RDF::URI(v.to_s).relative?
35
+ @endpoints[k] = (RDF::URI(base_url.to_s) / v.to_s)
22
36
  end
23
37
  end
24
38
 
@@ -69,11 +83,24 @@ module RDF
69
83
  end
70
84
 
71
85
  class Client < SPARQL::Client
86
+ MARMOTTA_GRAPH_ALL = (Marmotta::CTYPES.keys + ['*/*;p=0.1'])
87
+ .join(', ').freeze
88
+
72
89
  def initialize(url, options = {}, &block)
73
90
  options[:method] ||= :get
74
91
  options[:protocol] ||= '1.1'
75
92
  super
76
93
  end
94
+
95
+ ##
96
+ # Limit to accepted content types per comment on RDF::Marmotta::CTYPES
97
+ def request(query, headers={}, &block)
98
+ headers['Accept'] ||= MARMOTTA_GRAPH_ALL if
99
+ (query.respond_to?(:expects_statements?) ?
100
+ query.expects_statements? :
101
+ (query =~ /CONSTRUCT|DESCRIBE|DELETE|CLEAR/))
102
+ super
103
+ end
77
104
  end
78
105
  end
79
106
  end
@@ -0,0 +1,19 @@
1
+ require 'fileutils'
2
+ require 'jettywrapper'
3
+
4
+ namespace :jetty do
5
+
6
+ desc 'Configure solr schema'
7
+ task :config do
8
+ cp('solr_conf/schema.xml', 'jetty/solr/development-core/conf/schema.xml')
9
+ cp('solr_conf/solrconfig.xml',
10
+ 'jetty/solr/development-core/conf/solrconfig.xml')
11
+ end
12
+
13
+ desc 'Remove the jetty and marmotta directories and recreate them'
14
+ task :clean do
15
+ FileUtils.rm_rf(MARMOTTA_HOME)
16
+ Jettywrapper.clean
17
+ end
18
+
19
+ end
@@ -3,25 +3,29 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "rdf-marmotta"
6
- s.version = '0.0.4'
6
+ s.version = '0.0.6'
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Tom Johnson"]
9
9
  s.homepage = 'https://github.com/dpla/rdf-marmotta'
10
10
  s.email = 'tom@dp.la'
11
11
  s.summary = %q{RDF::Repository layer for Apache Marmotta.}
12
12
  s.description = %q{RDF::Repository layer for Apache Marmotta.}
13
- s.license = "undeclared"
13
+ s.license = "Unlicense"
14
14
  s.required_ruby_version = '>= 1.9.3'
15
15
 
16
16
  s.files = `git ls-files`.split("\n")
17
17
  s.test_files = `git ls-files -- {spec}/*`.split("\n")
18
18
 
19
+ s.add_dependency('rake')
19
20
  s.add_dependency('rdf', '~> 1.1')
20
21
  s.add_dependency('nokogiri')
21
22
  s.add_dependency('rdf-rdfxml', '~> 1.1')
22
23
  s.add_dependency('sparql-client', '~> 1.1')
24
+ s.add_development_dependency('jettywrapper')
25
+ s.add_development_dependency('linkeddata')
23
26
  s.add_development_dependency('rspec')
24
27
  s.add_development_dependency('rspec-its')
25
28
  s.add_development_dependency('rdf-spec')
26
29
  s.add_development_dependency('pry')
30
+
27
31
  end
@@ -8,7 +8,7 @@ require 'rdf/marmotta'
8
8
 
9
9
  describe RDF::Marmotta do
10
10
 
11
- let(:base_url) { 'http://localhost:8080/marmotta/' }
11
+ let(:base_url) { 'http://localhost:8983/marmotta/' }
12
12
  let(:opts) { {} }
13
13
  let(:statement) { RDF::Statement(RDF::URI('http://api.dp.la/example/item/1234'), RDF::DC.title, 'Moomin') }
14
14
  let(:statements) {
@@ -1,3 +1,4 @@
1
+ require 'linkeddata'
1
2
  require 'bundler/setup'
2
3
  Bundler.setup
3
4
 
@@ -6,7 +7,7 @@ Dir['./spec/support/**/*.rb'].each { |f| require f }
6
7
  RSpec.configure do |config|
7
8
  config.color = true
8
9
  config.tty = true
9
-
10
+
10
11
  # Uncomment the following line to get errors and backtrace for deprecation warnings
11
12
  # config.raise_errors_for_deprecations!
12
13
 
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-marmotta
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Johnson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-12 00:00:00.000000000 Z
11
+ date: 2015-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: rdf
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +80,34 @@ dependencies:
66
80
  - - "~>"
67
81
  - !ruby/object:Gem::Version
68
82
  version: '1.1'
83
+ - !ruby/object:Gem::Dependency
84
+ name: jettywrapper
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: linkeddata
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
69
111
  - !ruby/object:Gem::Dependency
70
112
  name: rspec
71
113
  requirement: !ruby/object:Gem::Requirement
@@ -128,15 +170,21 @@ executables: []
128
170
  extensions: []
129
171
  extra_rdoc_files: []
130
172
  files:
173
+ - ".gitignore"
174
+ - ".travis.yml"
131
175
  - Gemfile
132
176
  - README.md
177
+ - Rakefile
178
+ - UNLICENSE
179
+ - jetty/.gitkeep
133
180
  - lib/rdf/marmotta.rb
181
+ - lib/tasks/jetty.rake
134
182
  - rdf-marmotta.gemspec
135
183
  - spec/marmotta_spec.rb
136
184
  - spec/spec_helper.rb
137
185
  homepage: https://github.com/dpla/rdf-marmotta
138
186
  licenses:
139
- - undeclared
187
+ - Unlicense
140
188
  metadata: {}
141
189
  post_install_message:
142
190
  rdoc_options: []