solis 0.91.0 → 0.93.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dacf775d95599afe2f7c79ed72e4a53e8f4ec2b81c72ceaa9bc8f5e02d69a390
4
- data.tar.gz: fc92c5539edc51b0db380f3aa22436fb5564b219434c8507f759796a91a050b6
3
+ metadata.gz: 64e83a503bd969f31420c26a39d34caa135a923facd034c87b49d2c3c99d3816
4
+ data.tar.gz: '08085672c31de214783632756d11750dc188b5512fe69b3572f7242b209d2dd9'
5
5
  SHA512:
6
- metadata.gz: 41579bf9a19a0b28182d305cf2e883dfc4d09cd00f41588de62c65ed01330950095372c2021110da032d29bfcaacbb61126107f088b01166c9a6f32aac5753f6
7
- data.tar.gz: f34d470cdf896032ceeeaf70675c5e03d8aaf056936f740f78f995fd1e7801053d9f420636bfd4c4918c56ccabc6d14987331daddd109107b13f241e1c4eb66e
6
+ metadata.gz: bccabb0614de2446d1f6ce802f2e5b28e1982395015dc1783f3509becd4c76c016ab285325816f079e096f7f2d9dfaa740630ea1782e1b9872f9656dcbd0fc9a
7
+ data.tar.gz: b2f70fdb4f6ad3d981b15406d3e034e6375db3e28b03eb19131639ef00992a51fefb76be50782be885ef51752db87e4e3ef26f02fcae993e44cacfadd47ca296
@@ -7,7 +7,7 @@ class Solis::Query::Runner
7
7
  context = JSON.parse %(
8
8
  {
9
9
  "@context": {
10
- "@vocab": "#{Solis::Options.instance.get[:graph_name]}",
10
+ "@vocab": "#{graph_name}",
11
11
  "id": "@id"
12
12
  },
13
13
  "@type": "#{entity}",
@@ -15,7 +15,7 @@ class Solis::Query::Runner
15
15
  }
16
16
  )
17
17
 
18
- c = Solis::Store::Sparql::Client.new(Solis::Options.instance.get[:sparql_endpoint], Solis::Options.instance.get[:graph_name])
18
+ c = Solis::Store::Sparql::Client.new(Solis::Options.instance.get[:sparql_endpoint], graph_name)
19
19
  r = c.query(query, options)
20
20
  if r.is_a?(SPARQL::Client)
21
21
  g = RDF::Graph.new
@@ -107,4 +107,8 @@ class Solis::Query::Runner
107
107
  Solis::LOGGER.error(e.message)
108
108
  data
109
109
  end
110
+
111
+ def self.graph_name
112
+ Solis::Options.instance.get.key?(:graphs) ? Solis::Options.instance.get[:graphs].select{|s| s['type'].eql?(:main)}&.first['name'] : ''
113
+ end
110
114
  end
data/lib/solis/query.rb CHANGED
@@ -36,7 +36,7 @@ module Solis
36
36
  ids = [ids] unless ids.is_a?(Array)
37
37
  ids = ids.map do |m|
38
38
  if URI(m).class.eql?(URI::Generic)
39
- "<#{Solis::Options.instance.get[:graph_name]}#{entity.tableize}/#{m}>"
39
+ "<#{graph_name}#{entity.tableize}/#{m}>"
40
40
  else
41
41
  "<#{m}>"
42
42
  end
@@ -54,6 +54,10 @@ module Solis
54
54
  raise e
55
55
  end
56
56
 
57
+ def self.graph_name
58
+ Solis::Options.instance.get.key?(:graphs) ? Solis::Options.instance.get[:graphs].select{|s| s['type'].eql?(:main)}&.first['name'] : ''
59
+ end
60
+
57
61
  def initialize(model)
58
62
  @construct_cache = File.absolute_path(Solis::Options.instance.get[:cache])
59
63
  @model = model
@@ -365,5 +369,6 @@ PREFIX #{@model.class.graph_prefix}: <#{@model.class.graph_name}>"
365
369
  # result << solution_model.new(data) unless data.empty?
366
370
  result
367
371
  end
372
+
368
373
  end
369
374
  end
data/lib/solis/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Solis
2
- VERSION = "0.91.0"
2
+ VERSION = "0.93.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.91.0
4
+ version: 0.93.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mehmet Celik