solis 0.91.0 → 0.92.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 +4 -4
- data/lib/solis/query/run.rb +6 -2
- data/lib/solis/query.rb +2 -1
- data/lib/solis/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e85831535e206873d8f7b40cd0a9cb5de13c31e9e726b57331ce81e641acd54b
|
4
|
+
data.tar.gz: 6a590a9130caa22dbf386e7431c3320c09920e6c8995c70071709ef6b68b2a1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3eb2c16098538ce61eea28aec3f7938fe679c5571976b89004e180679ad7bbdc676013dd6d71cc87e438faf6f2055a806f878437fc0de5cf5c0a9824b51b0d38
|
7
|
+
data.tar.gz: 5ad01cb9131bfbfefc5c0e21e05bf3b0c804cc1272b5b53933812d457f6705c65a5eec22185b0928cce79d864915f3e388ac84bf965583f28f6f613f14301789
|
data/lib/solis/query/run.rb
CHANGED
@@ -7,7 +7,7 @@ class Solis::Query::Runner
|
|
7
7
|
context = JSON.parse %(
|
8
8
|
{
|
9
9
|
"@context": {
|
10
|
-
"@vocab": "#{
|
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],
|
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
|
-
"<#{
|
39
|
+
"<#{@model.class.graph_name}#{entity.tableize}/#{m}>"
|
40
40
|
else
|
41
41
|
"<#{m}>"
|
42
42
|
end
|
@@ -365,5 +365,6 @@ PREFIX #{@model.class.graph_prefix}: <#{@model.class.graph_name}>"
|
|
365
365
|
# result << solution_model.new(data) unless data.empty?
|
366
366
|
result
|
367
367
|
end
|
368
|
+
|
368
369
|
end
|
369
370
|
end
|
data/lib/solis/version.rb
CHANGED