rdf-virtuoso 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -97,11 +97,11 @@ module ActiveRDF
97
97
 
98
98
  # TODO: set baseurl via config
99
99
  def subject_for(id)
100
- RDF::URI('http://data.deichman.no') / self.name.downcase / "#" / id
100
+ RDF::URI('http://data.deichman.no') / self.name.downcase / "/id_" / id
101
101
  end
102
102
 
103
103
  def id_for(subject)
104
- subject.to_s.split("#").last
104
+ subject.to_s.split("/").last.gsub('id_', '')
105
105
  end
106
106
 
107
107
  def destroy_all
@@ -2,7 +2,7 @@ module ActiveRDF
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 14
5
+ TINY = 15
6
6
  PRE = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
@@ -93,9 +93,17 @@ module RDF
93
93
  end
94
94
 
95
95
  def api_get(query, options = {})
96
- self.class.endpoint @sparql_endpoint
97
- get '/', :extra_query => { :query => query }.merge(options),
98
- :transform => RDF::Virtuoso::Parser::JSON
96
+ # prefer sparul endpoint with auth if present to allow SELECT/CONSTRUCT access to protected graphs
97
+ if @sparul_endpoint
98
+ self.class.endpoint @sparul_endpoint
99
+ get '/', :extra_query => { :query => query }.merge(options),
100
+ :extra_request => extra_request_options,
101
+ :transform => RDF::Virtuoso::Parser::JSON
102
+ else
103
+ self.class.endpoint @sparql_endpoint
104
+ get '/', :extra_query => { :query => query }.merge(options),
105
+ :transform => RDF::Virtuoso::Parser::JSON
106
+ end
99
107
  end
100
108
 
101
109
  def api_post(query, options = {})
@@ -1,5 +1,5 @@
1
1
  module RDF
2
2
  module Virtuoso
3
- VERSION = "0.0.14"
3
+ VERSION = "0.0.15"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf-virtuoso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-09-03 00:00:00.000000000 Z
13
+ date: 2012-10-22 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rspec