solis 0.107.0 → 0.109.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/model.rb +5 -2
- data/lib/solis/query/filter.rb +5 -3
- 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: 977072c184dcf472778863270bf8f4fd913db4980883e39ed9e33273d857cfbb
|
|
4
|
+
data.tar.gz: 377f468cddf67e8472aba17f0bca40c3a7c98a03e648da9b931cfc434de53efb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '093ee81f1e9ea27941544ee43311ebe9a26bc89fc5194d7211355cdf1e2f8c296b29731f05308fb688d546317f45ae3fca8974396fc0e0ee77ec8445c5bfc1fa'
|
|
7
|
+
data.tar.gz: 4ab801e9a5b64b9ee826def3abf3a67b38438419fb3b205a4a15960c00a623678d5a2a9277badcb7a86a6e2fc19bcc097e9bb9252e1e0eee869a89ef79d253de
|
data/lib/solis/model.rb
CHANGED
|
@@ -409,6 +409,7 @@ values ?s {<#{self.graph_id}>}
|
|
|
409
409
|
self.metadata[:attributes].each do |attribute, attribute_metadata|
|
|
410
410
|
is_array = ((attribute_metadata[:maxcount].nil? || (attribute_metadata[:maxcount].to_i > 1)) && !attribute_metadata[:datatype].eql?(:lang_string))
|
|
411
411
|
attribute_name = is_array ? "#{attribute}[]" : attribute
|
|
412
|
+
attribute_name = attribute_metadata[:mincount].to_i > 0 ? "#{attribute_name}*" : attribute_name
|
|
412
413
|
if attribute_metadata.key?(:class) && !attribute_metadata[:class].nil? && attribute_metadata[:class].value =~ /#{self.graph_name}/ && level == 0
|
|
413
414
|
cm = self.graph.shape_as_model(self.metadata[:attributes][attribute][:datatype].to_s).model(level + 1)
|
|
414
415
|
m[:attributes][attribute_name.to_sym] = cm[:attributes]
|
|
@@ -661,7 +662,9 @@ values ?s {<#{self.graph_id}>}
|
|
|
661
662
|
else
|
|
662
663
|
RDF::Literal.new(d, language: @language)
|
|
663
664
|
end
|
|
664
|
-
elsif metadata[:datatype_rdf].eql?('http://www.w3.org/2001/XMLSchema#anyURI')
|
|
665
|
+
elsif metadata[:datatype_rdf].eql?('http://www.w3.org/2001/XMLSchema#anyURI')
|
|
666
|
+
RDF::Literal.new(d.to_s, datatype: RDF::XSD.anyURI)
|
|
667
|
+
elsif metadata[:node].is_a?(RDF::URI)
|
|
665
668
|
RDF::URI(d)
|
|
666
669
|
elsif metadata[:datatype_rdf] =~ /datatypes\/edtf/ || metadata[:datatype_rdf] =~ /edtf$/i
|
|
667
670
|
# Handle EDTF dates
|
|
@@ -776,7 +779,7 @@ values ?s {<#{self.graph_id}>}
|
|
|
776
779
|
RDF::Literal.new(d, language: self.class.language)
|
|
777
780
|
else
|
|
778
781
|
if metadata[:datatype_rdf].eql?('http://www.w3.org/2001/XMLSchema#anyURI')
|
|
779
|
-
RDF::
|
|
782
|
+
RDF::Literal.new(d.to_s, datatype: RDF::XSD.anyURI)
|
|
780
783
|
else
|
|
781
784
|
RDF::Literal.new(d, datatype: datatype)
|
|
782
785
|
end
|
data/lib/solis/query/filter.rb
CHANGED
|
@@ -123,8 +123,9 @@ module Solis
|
|
|
123
123
|
|
|
124
124
|
search_for = normalize_string(search_for)
|
|
125
125
|
filter += "FILTER(str(?__search#{i}) #{not_operator}#{value[:operator]} \"#{search_for}\"#{datatype}) .\n"
|
|
126
|
-
elsif
|
|
127
|
-
# Special handling for
|
|
126
|
+
elsif !metadata[:node].nil? && !metadata[:datatype_rdf].eql?('http://www.w3.org/2001/XMLSchema#anyURI') && ["=", "!="].include?(value[:operator])
|
|
127
|
+
# Special handling for URI references to other entities (object properties, only for equality/inequality)
|
|
128
|
+
# Note: xsd:anyURI literals are handled below with standard literal matching
|
|
128
129
|
model_graph_name = Solis::Options.instance.get.key?(:graphs) ? Solis::Options.instance.get[:graphs].select{|s| s['type'].eql?(:main)}&.first['name'] : @model.class.graph_name
|
|
129
130
|
if value[:is_not]
|
|
130
131
|
#filter = "filter( !exists {?concept <#{metadata[:path]}> ?__search#{i} . ?__search#{i} <#{model_graph_name}id> \"#{v}\"})"
|
|
@@ -139,7 +140,8 @@ module Solis
|
|
|
139
140
|
end
|
|
140
141
|
end
|
|
141
142
|
else # if "~" contains
|
|
142
|
-
if metadata[:datatype_rdf].eql?(
|
|
143
|
+
if !metadata[:node].nil? && !metadata[:datatype_rdf].eql?('http://www.w3.org/2001/XMLSchema#anyURI')
|
|
144
|
+
# Special handling for URI references to other entities (object properties)
|
|
143
145
|
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
|
|
144
146
|
filter = "?concept <#{metadata[:path]}> ?__search#{i} . ?__search#{i} <#{model_graph_name}id> ?__search#{i}_#{i} filter(?__search#{i}_#{i} = \"#{value[:value].first}\")."
|
|
145
147
|
else
|
data/lib/solis/version.rb
CHANGED