solis 0.90.0 → 0.91.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/graph.rb +2 -2
- data/lib/solis/query/filter.rb +7 -2
- data/lib/solis/query.rb +6 -1
- data/lib/solis/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dacf775d95599afe2f7c79ed72e4a53e8f4ec2b81c72ceaa9bc8f5e02d69a390
|
4
|
+
data.tar.gz: fc92c5539edc51b0db380f3aa22436fb5564b219434c8507f759796a91a050b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41579bf9a19a0b28182d305cf2e883dfc4d09cd00f41588de62c65ed01330950095372c2021110da032d29bfcaacbb61126107f088b01166c9a6f32aac5753f6
|
7
|
+
data.tar.gz: f34d470cdf896032ceeeaf70675c5e03d8aaf056936f740f78f995fd1e7801053d9f420636bfd4c4918c56ccabc6d14987331daddd109107b13f241e1c4eb66e
|
data/lib/solis/graph.rb
CHANGED
@@ -20,8 +20,8 @@ module Solis
|
|
20
20
|
|
21
21
|
@global_resource_stack = []
|
22
22
|
@graph = graph
|
23
|
-
@graph_name = cloned_options.delete(:graph_name) || '/'
|
24
|
-
@graph_prefix = cloned_options.delete(:graph_prefix) || 'pf0'
|
23
|
+
@graph_name = cloned_options.key?(:graph_name) ? cloned_options.delete(:graph_name) : cloned_options.key?(:graphs) ? cloned_options[:graphs].select{|s| s['type'].eql?(:main)}&.first['name'] || '/' : '/'
|
24
|
+
@graph_prefix = cloned_options.key?(:graph_prefix) ? cloned_options.delete(:graph_prefix) : cloned_options.key?(:graphs) ? cloned_options[:graphs].select{|s| s['type'].eql?(:main)}&.first['prefix'] || 'pf0' : 'pf0'
|
25
25
|
@sparql_endpoint = cloned_options.delete(:sparql_endpoint) || nil
|
26
26
|
|
27
27
|
if cloned_options&.key?(:hooks) && cloned_options[:hooks].is_a?(Hash)
|
data/lib/solis/query/filter.rb
CHANGED
@@ -117,8 +117,13 @@ module Solis
|
|
117
117
|
|
118
118
|
|
119
119
|
end
|
120
|
-
else
|
121
|
-
|
120
|
+
else # if "~" contains
|
121
|
+
if metadata[:datatype_rdf].eql?( 'http://www.w3.org/2001/XMLSchema#anyURI') || !metadata[:node].nil?
|
122
|
+
model_graph_name = Solis::Options.instance.get.key?(:graphs) ? Solis::Options.instance.get[:graphs].select{|s| s['type'].eql?(:data)}&.first['name'] : @model.class.graph_name
|
123
|
+
filter = "?CONCEPT <#{metadata[:path]}> ?__search#{i} . ?__search#{i} <#{model_graph_name}id> ?__search#{i}_#{i} FILTER(?__search#{i}_#{i} = \"#{value[:value].first}\")."
|
124
|
+
else
|
125
|
+
filter = "?concept <#{metadata[:path]}> ?__search#{i} FILTER(#{contains.empty? ? '""' : contains}) .\n"
|
126
|
+
end
|
122
127
|
end
|
123
128
|
end
|
124
129
|
end
|
data/lib/solis/query.rb
CHANGED
@@ -60,7 +60,12 @@ module Solis
|
|
60
60
|
@shapes = @model.class.shapes
|
61
61
|
@metadata = @model.class.metadata
|
62
62
|
@sparql_endpoint = @model.class.sparql_endpoint
|
63
|
-
|
63
|
+
if Solis::Options.instance.get.key?(:graphs) && Solis::Options.instance.get[:graphs].size > 0
|
64
|
+
@sparql_client = SPARQL::Client.new(@sparql_endpoint)
|
65
|
+
else
|
66
|
+
@sparql_client = SPARQL::Client.new(@sparql_endpoint, graph: @model.class.graph_name)
|
67
|
+
end
|
68
|
+
|
64
69
|
@filter = {values: ["VALUES ?type {#{target_class}}"], concepts: ['?concept a ?type .'] }
|
65
70
|
@sort = 'ORDER BY ?s'
|
66
71
|
@sort_select = ''
|
data/lib/solis/version.rb
CHANGED
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.
|
4
|
+
version: 0.91.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mehmet Celik
|
@@ -335,7 +335,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
335
335
|
- !ruby/object:Gem::Version
|
336
336
|
version: '0'
|
337
337
|
requirements: []
|
338
|
-
rubygems_version: 3.
|
338
|
+
rubygems_version: 3.7.1
|
339
339
|
specification_version: 4
|
340
340
|
summary: Turn any SHACL file into an API, ORM, documentation, ...
|
341
341
|
test_files: []
|