Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge to master: Release 2.4.2 - Multilingual & Submission compression #96

Merged
merged 9 commits into from
Dec 5, 2023
Merged
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ gem 'rest-client'
gem 'rsolr', '~> 1.0'
gem 'rubyzip', '~> 1.0'
gem 'thin'
gem 'request_store'

# Testing
group :test do
Expand Down
49 changes: 24 additions & 25 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/ontoportal-lirmm/goo.git
revision: bd7154217438c3b9160e0e9b495c7c718b55fbf8
revision: 74ea47defc7f6260b045a6c6997bbe6a59c7bf62
branch: master
specs:
goo (0.0.2)
Expand Down Expand Up @@ -36,18 +36,16 @@ GEM
public_suffix (>= 2.0.2, < 6.0)
ansi (1.5.0)
ast (2.4.2)
base64 (0.1.1)
bcrypt (3.1.19)
bcrypt (3.1.20)
builder (3.2.4)
coderay (1.1.3)
concurrent-ruby (1.2.2)
connection_pool (2.4.1)
cube-ruby (0.0.3)
daemons (1.4.1)
date (3.3.3)
date (3.3.4)
docile (1.4.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
domain_name (0.6.20231109)
email_spec (2.2.2)
htmlentities (~> 4.3.3)
launchy (~> 2.1)
Expand Down Expand Up @@ -84,13 +82,13 @@ GEM
domain_name (~> 0.5)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
json (2.6.3)
json_pure (2.6.3)
json (2.7.1)
json_pure (2.7.1)
language_server-protocol (3.17.0.3)
launchy (2.5.2)
addressable (~> 2.8)
libxml-ruby (2.9.0)
logger (1.5.3)
logger (1.6.0)
macaddr (1.7.2)
systemu (~> 2.6.5)
mail (2.8.1)
Expand All @@ -112,12 +110,12 @@ GEM
multi_json (1.15.0)
multipart-post (2.3.0)
net-http-persistent (2.9.4)
net-imap (0.4.1)
net-imap (0.4.7)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
net-protocol (0.2.2)
timeout
net-smtp (0.4.0)
net-protocol
Expand All @@ -136,20 +134,22 @@ GEM
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (5.0.3)
racc (1.7.1)
public_suffix (5.0.4)
racc (1.7.3)
rack (1.6.13)
rack-test (0.8.3)
rack (>= 1.0, < 3)
rainbow (3.1.1)
rake (10.5.0)
rdf (1.0.8)
addressable (>= 2.2)
redis (5.0.7)
redis-client (>= 0.9.0)
redis-client (0.17.0)
redis (5.0.8)
redis-client (>= 0.17.0)
redis-client (0.18.0)
connection_pool
regexp_parser (2.8.2)
regexp_parser (2.8.3)
request_store (1.5.1)
rack (>= 1.4)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
Expand All @@ -158,19 +158,18 @@ GEM
rexml (3.2.6)
rsolr (1.1.2)
builder (>= 2.1.2)
rubocop (1.57.1)
base64 (~> 0.1.1)
rubocop (1.58.0)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.2.2.4)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.28.1, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.29.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
Expand All @@ -192,16 +191,15 @@ GEM
eventmachine (~> 1.0, >= 1.0.4)
rack (>= 1, < 3)
thread_safe (0.3.6)
timeout (0.4.0)
timeout (0.4.1)
tzinfo (0.3.62)
unf (0.1.4)
unf_ext
unf_ext (0.0.8.2)
unicode-display_width (2.5.0)
uuid (2.3.9)
macaddr (~> 1.0)

PLATFORMS
x86_64-darwin-21
x86_64-darwin-23
x86_64-linux

DEPENDENCIES
Expand All @@ -224,6 +222,7 @@ DEPENDENCIES
rack (~> 1.0)
rack-test (~> 0.6)
rake (~> 10.0)
request_store
rest-client
rsolr (~> 1.0)
rubocop
Expand Down
41 changes: 35 additions & 6 deletions config/solr/term_search/schema.xml
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,39 @@
<field name="resource_id" type="string" indexed="true" stored="true" multiValued="false" required="true" />

<!-- searchable fields -->
<field name="prefLabel" type="text_general" indexed="true" stored="true" multiValued="false" />
<field name="prefLabelExact" type="string_ci" indexed="true" stored="true" multiValued="false" />
<field name="prefLabelSuggest" type="text_suggest" indexed="true" stored="true" omitNorms="true" />
<field name="prefLabelSuggestEdge" type="text_suggest_edge" indexed="true" stored="true" />
<field name="prefLabelSuggestNgram" type="text_suggest_ngram" indexed="true" stored="true" omitNorms="true" />
<!-- all languages fields -->
<field name="prefLabel" type="text_general" indexed="true" stored="true" multiValued="true" />
<field name="prefLabelExact" type="string_ci" indexed="true" stored="true" multiValued="true" />
<field name="prefLabelSuggest" type="text_suggest" indexed="true" stored="true" multiValued="true" omitNorms="true" />
<field name="prefLabelSuggestEdge" type="text_suggest_edge" indexed="true" stored="true" multiValued="true" />
<field name="prefLabelSuggestNgram" type="text_suggest_ngram" indexed="true" stored="true" multiValued="true" omitNorms="true" />

<!-- language specific fields (e.g prefLabel_en or prefLabel_fr) -->
<dynamicField name="prefLabel_*" type="text_general" indexed="true" stored="true" multiValued="true" />
<dynamicField name="prefLabelExact_*" type="string_ci" indexed="true" stored="true" multiValued="true" />
<dynamicField name="prefLabelSuggest_*" type="text_suggest" indexed="true" stored="true" omitNorms="true" multiValued="true" />
<dynamicField name="prefLabelSuggestEdge_*" type="text_suggest_edge" indexed="true" stored="true" multiValued="true" />
<dynamicField name="prefLabelSuggestNgram_*" type="text_suggest_ngram" indexed="true" stored="true" omitNorms="true" multiValued="true" />


<field name="synonym" type="text_general" indexed="true" stored="true" multiValued="true" />
<field name="synonymExact" type="string_ci" indexed="true" stored="true" multiValued="true" />
<field name="synonymSuggest" type="text_suggest" indexed="true" stored="true" omitNorms="true" multiValued="true" />
<field name="synonymSuggestEdge" type="text_suggest_edge" indexed="true" stored="true" multiValued="true" />
<field name="synonymSuggestNgram" type="text_suggest_ngram" indexed="true" stored="true" omitNorms="true" multiValued="true" />

<dynamicField name="synonym_*" type="text_general" indexed="true" stored="true" multiValued="true" />
<dynamicField name="synonymExact_*" type="string_ci" indexed="true" stored="true" multiValued="true" />
<dynamicField name="synonymSuggest_*" type="text_suggest" indexed="true" stored="true" omitNorms="true" multiValued="true" />
<dynamicField name="synonymSuggestEdge_*" type="text_suggest_edge" indexed="true" stored="true" multiValued="true" />
<dynamicField name="synonymSuggestNgram_*" type="text_suggest_ngram" indexed="true" stored="true" omitNorms="true" multiValued="true" />


<field name="notation" type="text_general" indexed="true" stored="true" multiValued="false" />

<field name="definition" type="string" indexed="true" stored="true" multiValued="true" />
<field name="definition" type="string" indexed="true" stored="true" multiValued="true" />
<dynamicField name="definition_*" type="string" indexed="true" stored="true" multiValued="true" />

<field name="submissionAcronym" type="string" indexed="true" stored="true" multiValued="false" />
<field name="parents" type="string" indexed="true" stored="true" multiValued="true" />
<field name="ontologyType" type="ontologyType" indexed="true" stored="true" multiValued="false" />
Expand Down Expand Up @@ -251,6 +269,17 @@
<copyField source="synonym" dest="synonymSuggestEdge" />
<copyField source="synonym" dest="synonymSuggestNgram" />

<copyField source="prefLabel_*" dest="prefLabelExact_*" />
<copyField source="prefLabel_*" dest="prefLabelSuggest_*" />
<copyField source="prefLabel_*" dest="prefLabelSuggestEdge_*" />
<copyField source="prefLabel_*" dest="prefLabelSuggestNgram_*" />


<copyField source="synonym_*" dest="synonymExact_*" />
<copyField source="synonym_*" dest="synonymSuggest_*" />
<copyField source="synonym_*" dest="synonymSuggestEdge_*" />
<copyField source="synonym_*" dest="synonymSuggestNgram_*" />

<copyField source="notation" dest="_text_"/>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def create_mapping_process(mapping_process_hash, source_uri, object_uri, user)
process.relation = relations_array
process.creator = user

process.subject_source_id = RDF::URI.new(source_uri || mapping_process_hash[:subject_source_id])
process.object_source_id = RDF::URI.new(object_uri || mapping_process_hash[:object_source_id])
process.subject_source_id = create_uri(source_uri || mapping_process_hash[:subject_source_id])
process.object_source_id = create_uri(object_uri || mapping_process_hash[:object_source_id])
process.date = mapping_process_hash[:date] ? DateTime.parse(mapping_process_hash[:date]) : DateTime.now
process_fields = %i[source source_name comment name source_contact_info]
process_fields.each do |att|
Expand All @@ -92,6 +92,9 @@ def create_mapping_process(mapping_process_hash, source_uri, object_uri, user)
end

private
def create_uri(value)
RDF::URI.new(value) unless value.nil?
end

def save_rest_mapping(classes, process)
LinkedData::Mappings.create_rest_mapping(classes, process)
Expand Down
Loading