Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
f3fe7f9
Use logical search targets for term and property indexes
mdorf Mar 31, 2026
e3d953e
Gemfile.lock update
mdorf Mar 31, 2026
07e5a8c
Use alias-backed bootstrap collections for ontology search bindings
mdorf Mar 31, 2026
8bd3f27
made num_shard and replication_factor configurable for Solr; removed …
mdorf Apr 1, 2026
da61d89
updated branch target in Gemfile
mdorf Apr 1, 2026
8d5090a
Gemfile.lock update
mdorf Apr 1, 2026
3a6e8a8
Merge branch 'develop' into feature/solrcloud-alias-indexing-codex
mdorf Apr 1, 2026
cdbf8f6
Gemfile & Gemfile.lock update
mdorf Apr 28, 2026
6c8a8b5
Use final Solr alias and bootstrap collection names
mdorf May 14, 2026
e3d27a8
Gemfile.lock update
mdorf May 14, 2026
38237da
Merge branch 'feature/solrcloud-alias-indexing-codex' of github.com:n…
mdorf May 14, 2026
7663aca
Stabilize OLD test suite for Solr alias changes
mdorf May 18, 2026
6bc0969
Reset Solr schemas before OLD test runs
mdorf May 18, 2026
7eac5fe
Make search bootstrap collections configurable
mdorf May 19, 2026
55c4603
Apply configured Solr bootstrap targets after model registration
mdorf May 19, 2026
e152f63
Allow config loading without Goo connection initialization
mdorf May 19, 2026
5d80bbb
Refresh SolrCloud search topology config
mdorf May 19, 2026
c910658
Merge remote-tracking branch 'origin/develop' into feature/solrcloud-…
mdorf May 19, 2026
210e36c
Merge pull request #269 from ncbo/feature/solrcloud-alias-indexing-codex
mdorf May 19, 2026
bd01bf6
Gemfile & Gemfile.lock update
mdorf May 19, 2026
4982c24
Merge branch 'master' into develop
mdorf May 21, 2026
d4492a5
fixed a randomly failing unit test
mdorf May 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ group :development do
gem 'rubocop', require: false
end
# NCBO gems (can be from a local dev path or from rubygems/git)
gem 'goo', github: 'ncbo/goo', branch: 'main'
gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'main'
gem 'goo', github: 'ncbo/goo', branch: 'development'
gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'development'


gem 'public_suffix', '~> 5.1.1'
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ GIT

GIT
remote: https://github.com/ncbo/goo.git
revision: ee72f43daa37f02362da1b747f037c442cfbf112
branch: main
revision: 0187c6c0ba3871fa8b67055c1a1adfdea38b2189
branch: development
specs:
goo (0.0.2)
addressable (~> 2.8)
Expand All @@ -27,7 +27,7 @@ GIT
GIT
remote: https://github.com/ncbo/sparql-client.git
revision: 2ac20b217bb7ad2b11305befe0ee77d75e44eac5
branch: main
branch: development
specs:
sparql-client (3.2.2)
net-http-persistent (~> 4.0, >= 4.0.2)
Expand Down
4 changes: 4 additions & 0 deletions config/config.rb.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ LinkedData.config do |config|
config.goo_host = "localhost"
config.search_server_url = "http://localhost:8983/solr"
config.property_search_server_url = "http://localhost:8983/solr"
config.term_search_num_shards = 1
config.term_search_replication_factor = 1
config.property_search_num_shards = 1
config.property_search_replication_factor = 1
config.repository_folder = "./test/data/ontology_files/repo"
config.rest_url_prefix = "http://localhost:9393/"
config.enable_security = false
Expand Down
32 changes: 18 additions & 14 deletions config/config.test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,24 @@
SOLR_PROP_SEARCH_URL = ENV.include?("SOLR_PROP_SEARCH_URL") ? ENV["SOLR_PROP_SEARCH_URL"] : 'http://localhost:8983/solr'

LinkedData.config do |config|
config.goo_backend_name = GOO_BACKEND_NAME.to_s
config.goo_host = GOO_HOST.to_s
config.goo_port = GOO_PORT.to_i
config.goo_path_query = GOO_PATH_QUERY.to_s
config.goo_path_data = GOO_PATH_DATA.to_s
config.goo_path_update = GOO_PATH_UPDATE.to_s
config.goo_redis_host = REDIS_HOST.to_s
config.goo_redis_port = REDIS_PORT.to_i
config.http_redis_host = REDIS_HOST.to_s
config.http_redis_port = REDIS_PORT.to_i
config.ontology_analytics_redis_host = REDIS_HOST.to_s
config.ontology_analytics_redis_port = REDIS_PORT.to_i
config.search_server_url = SOLR_TERM_SEARCH_URL.to_s
config.property_search_server_url = SOLR_PROP_SEARCH_URL.to_s
config.goo_backend_name = GOO_BACKEND_NAME.to_s
config.goo_host = GOO_HOST.to_s
config.goo_port = GOO_PORT.to_i
config.goo_path_query = GOO_PATH_QUERY.to_s
config.goo_path_data = GOO_PATH_DATA.to_s
config.goo_path_update = GOO_PATH_UPDATE.to_s
config.goo_redis_host = REDIS_HOST.to_s
config.goo_redis_port = REDIS_PORT.to_i
config.http_redis_host = REDIS_HOST.to_s
config.http_redis_port = REDIS_PORT.to_i
config.ontology_analytics_redis_host = REDIS_HOST.to_s
config.ontology_analytics_redis_port = REDIS_PORT.to_i
config.search_server_url = SOLR_TERM_SEARCH_URL.to_s
config.property_search_server_url = SOLR_PROP_SEARCH_URL.to_s
config.term_search_num_shards = 1
config.term_search_replication_factor = 1
config.property_search_num_shards = 1
config.property_search_replication_factor = 1
# config.enable_notifications = false

config.oauth_providers = {
Expand Down
21 changes: 20 additions & 1 deletion lib/ontologies_linked_data/config/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,17 @@ def config(&block)
@settings.goo_path_update ||= '/update/'
@settings.search_server_url ||= 'http://localhost:8983/solr'
@settings.property_search_server_url ||= 'http://localhost:8983/solr'
@settings.term_search_num_shards ||= 1
@settings.term_search_replication_factor ||= 1
@settings.term_search_bootstrap_collection ||= :term_search_bootstrap
@settings.property_search_num_shards ||= 1
@settings.property_search_replication_factor ||= 1
@settings.property_search_bootstrap_collection ||= :property_search_bootstrap
@settings.repository_folder ||= './test/data/ontology_files/repo'
@settings.rest_url_prefix ||= DEFAULT_PREFIX
@settings.enable_security ||= false
@settings.enable_slices ||= false
@settings.skip_connect_goo ||= ENV['LINKEDDATA_SKIP_CONNECT_GOO'] == 'true'

# Java/JVM options
@settings.java_max_heap_size ||= '10240M'
Expand Down Expand Up @@ -95,6 +102,7 @@ def config(&block)

# Override defaults
yield @settings, overide_connect_goo if block_given?
configure_search_collections

# Check to make sure url prefix has trailing slash
@settings.rest_url_prefix = "#{@settings.rest_url_prefix}/" unless @settings.rest_url_prefix[-1].eql?('/')
Expand All @@ -105,7 +113,7 @@ def config(&block)
puts "(LD) >> Using HTTP Redis instance at #{@settings.http_redis_host}:#{@settings.http_redis_port}"
puts "(LD) >> Using Goo Redis instance at #{@settings.goo_redis_host}:#{@settings.goo_redis_port}"

connect_goo unless overide_connect_goo
connect_goo unless overide_connect_goo || @settings.skip_connect_goo
end

##
Expand Down Expand Up @@ -137,6 +145,17 @@ def connect_goo
end
end

def configure_search_collections
Goo.set_search_collection_bootstrap(:term_search, @settings.term_search_bootstrap_collection)
Goo.set_search_collection_bootstrap(:property_search, @settings.property_search_bootstrap_collection)
Goo.set_search_collection_topology(:term_search,
num_shards: @settings.term_search_num_shards,
replication_factor: @settings.term_search_replication_factor)
Goo.set_search_collection_topology(:property_search,
num_shards: @settings.property_search_num_shards,
replication_factor: @settings.property_search_replication_factor)
end

##
# Configure ontologies_linked_data namespaces
# We do this at initial runtime because goo needs namespaces for its DSL
Expand Down
6 changes: 5 additions & 1 deletion lib/ontologies_linked_data/models/class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,11 @@ def self.index_schema(schema_generator)
schema_generator.add_dynamic_field('definition_*', 'text_general', indexed: true, stored: true, multi_valued: true)
end

enable_indexing(:term_search_core1) do |schema_generator|
enable_indexing(:term_search,
:main,
bootstrap_collection: LinkedData.settings.term_search_bootstrap_collection,
num_shards: LinkedData.settings.term_search_num_shards,
replication_factor: LinkedData.settings.term_search_replication_factor) do |schema_generator|
index_schema(schema_generator)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ class AnnotationProperty < LinkedData::Models::OntologyProperty
LinkedData::Hypermedia::Link.new("descendants", lambda {|m| "#{self.ontology_link(m)}/properties/#{CGI.escape(m.id.to_s)}/descendants"}, self.uri_type),
LinkedData::Hypermedia::Link.new("tree", lambda {|m| "#{self.ontology_link(m)}/properties/#{CGI.escape(m.id.to_s)}/tree"}, self.uri_type)

enable_indexing(:prop_search_core1, :property) do |schema_generator|
enable_indexing(:property_search,
:property,
bootstrap_collection: LinkedData.settings.property_search_bootstrap_collection,
num_shards: LinkedData.settings.property_search_num_shards,
replication_factor: LinkedData.settings.property_search_replication_factor) do |schema_generator|
index_schema(schema_generator)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ class DatatypeProperty < LinkedData::Models::OntologyProperty
LinkedData::Hypermedia::Link.new("descendants", lambda {|m| "#{self.ontology_link(m)}/properties/#{CGI.escape(m.id.to_s)}/descendants"}, self.uri_type),
LinkedData::Hypermedia::Link.new("tree", lambda {|m| "#{self.ontology_link(m)}/properties/#{CGI.escape(m.id.to_s)}/tree"}, self.uri_type)

enable_indexing(:prop_search_core1, :property) do |schema_generator|
enable_indexing(:property_search,
:property,
bootstrap_collection: LinkedData.settings.property_search_bootstrap_collection,
num_shards: LinkedData.settings.property_search_num_shards,
replication_factor: LinkedData.settings.property_search_replication_factor) do |schema_generator|
index_schema(schema_generator)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ class ObjectProperty < LinkedData::Models::OntologyProperty
LinkedData::Hypermedia::Link.new("descendants", lambda {|m| "#{self.ontology_link(m)}/properties/#{CGI.escape(m.id.to_s)}/descendants"}, self.uri_type),
LinkedData::Hypermedia::Link.new("tree", lambda {|m| "#{self.ontology_link(m)}/properties/#{CGI.escape(m.id.to_s)}/tree"}, self.uri_type)

enable_indexing(:prop_search_core1, :property) do |schema_generator|
enable_indexing(:property_search,
:property,
bootstrap_collection: LinkedData.settings.property_search_bootstrap_collection,
num_shards: LinkedData.settings.property_search_num_shards,
replication_factor: LinkedData.settings.property_search_replication_factor) do |schema_generator|
index_schema(schema_generator)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ def self.index_schema(schema_generator)
end
end

enable_indexing(:prop_search_core1, :property) do |schema_generator|
enable_indexing(:property_search,
:property,
bootstrap_collection: LinkedData.settings.property_search_bootstrap_collection,
num_shards: LinkedData.settings.property_search_num_shards,
replication_factor: LinkedData.settings.property_search_replication_factor) do |schema_generator|
index_schema(schema_generator)
end

Expand Down
6 changes: 5 additions & 1 deletion lib/ontologies_linked_data/models/provisional_class.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ class ProvisionalClass < LinkedData::Models::Base
end
}, Goo.vocabulary["Ontology"])

enable_indexing(:term_search_core1) do |schema_generator|
enable_indexing(:term_search,
:main,
bootstrap_collection: LinkedData.settings.term_search_bootstrap_collection,
num_shards: LinkedData.settings.term_search_num_shards,
replication_factor: LinkedData.settings.term_search_replication_factor) do |schema_generator|
Class.index_schema(schema_generator)
end

Expand Down
10 changes: 7 additions & 3 deletions test/models/test_provisional_class.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
require_relative "./test_ontology_common"

class TestProvisionalClass < LinkedData::TestOntologyCommon
TEST_ONTOLOGY_ACRONYM = "PROV-CLASS".freeze
TEST_ONTOLOGY_NAME = "#{TEST_ONTOLOGY_ACRONYM} Ontology".freeze

def self.before_suite
@@user = LinkedData::Models::User.new({username: "test_user_prov_class",
email: "test_user_prov_class@example.org", password: "password"})
@@user.save

ont_count, ont_names, ont_models = LinkedData::SampleData::Ontology.create_ontologies_and_submissions(ont_count: 1,
submission_count: 1)
submission_count: 1,
acronym: TEST_ONTOLOGY_ACRONYM,
acronym_suffix: "")
@@ontology = ont_models.first
@@ontology.bring(:name)
@@ontology.bring(:acronym)
Expand Down Expand Up @@ -275,8 +279,8 @@ def test_provisional_class_ontology
pc = @@provisional_class
pc.ontology = @@ontology
assert pc.valid?, "#{pc.errors}"
assert_equal(true, pc.ontology.acronym == "TEST-ONT-0")
assert_equal(true, pc.ontology.name == "TEST-ONT-0 Ontology")
assert_equal(true, pc.ontology.acronym == TEST_ONTOLOGY_ACRONYM)
assert_equal(true, pc.ontology.name == TEST_ONTOLOGY_NAME)
end

def test_provisional_class_search_indexing
Expand Down
1 change: 1 addition & 0 deletions test/test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ module MinitestRunHooks
def run(*args)
LinkedData::TestCase.setup_test_repository_folder
LinkedData::TestCase.backend_4s_delete
Goo.init_search_connections(true)
super
ensure
LinkedData::TestCase.backend_4s_delete
Expand Down
7 changes: 4 additions & 3 deletions test/util/test_ontology_csv_writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ def enclosed_in_square_brackets_with_quotes?(string)
end

def get_csv_string_from_path(csv_path)
gz = Zlib::GzipReader.open(csv_path)
gz.read
Zlib::GzipReader.open(csv_path) do |gz|
gz.read.force_encoding(Encoding::UTF_8)
end
end

def test_csv_writer_valid
Expand Down Expand Up @@ -337,4 +338,4 @@ def test_for_non_array_values
end
end

end
end
Loading