Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 12 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ GIT

GIT
remote: https://github.com/ncbo/ontologies_linked_data.git
revision: f614b4feb4361eaa4fb13289139fd029a2622872
revision: 93e0844e19c3632bbd613a3e33869e267a6f2e25
branch: master
specs:
ontologies_linked_data (0.0.1)
Expand Down Expand Up @@ -119,7 +119,7 @@ GEM
bcrypt (3.1.20)
bcrypt_pbkdf (1.1.1)
bcrypt_pbkdf (1.1.1-arm64-darwin)
bigdecimal (3.1.9)
bigdecimal (3.2.2)
builder (3.3.0)
capistrano (3.19.2)
airbrussh (>= 1.0.0)
Expand Down Expand Up @@ -150,7 +150,7 @@ GEM
logger
faraday-follow_redirects (0.3.0)
faraday (>= 1, < 3)
faraday-net_http (3.4.0)
faraday-net_http (3.4.1)
net-http (>= 0.5.0)
faraday-retry (2.3.1)
faraday (~> 2.0)
Expand Down Expand Up @@ -218,15 +218,15 @@ GEM
domain_name (~> 0.5)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
json (2.11.3)
json (2.12.2)
json-schema (2.8.1)
addressable (>= 2.4)
json_pure (2.8.1)
jwt (2.10.1)
base64
kgio (2.11.4)
language_server-protocol (3.17.0.4)
libxml-ruby (5.0.3)
libxml-ruby (5.0.4)
lint_roller (1.1.0)
logger (1.7.0)
macaddr (1.7.2)
Expand All @@ -237,10 +237,10 @@ GEM
net-pop
net-smtp
method_source (1.1.0)
mime-types (3.6.2)
mime-types (3.7.0)
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2025.0429)
mime-types-data (~> 3.2025, >= 3.2025.0507)
mime-types-data (3.2025.0701)
mini_mime (1.1.5)
minitest (5.25.5)
minitest-hooks (1.5.2)
Expand All @@ -255,7 +255,7 @@ GEM
net-http (0.6.0)
uri
net-http-persistent (2.9.4)
net-imap (0.5.8)
net-imap (0.5.9)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -271,13 +271,13 @@ GEM
net-ssh (7.3.0)
netrc (0.11.0)
newrelic_rpm (9.18.0)
oj (3.16.10)
oj (3.16.11)
bigdecimal (>= 3.0)
ostruct (>= 0.2)
omni_logger (0.1.4)
logger
os (1.1.4)
ostruct (0.6.1)
ostruct (0.6.2)
parallel (1.27.0)
parseconfig (1.1.2)
parser (3.3.8.0)
Expand Down Expand Up @@ -315,7 +315,7 @@ GEM
redcarpet (3.6.1)
redis (5.4.0)
redis-client (>= 0.22.0)
redis-client (0.24.0)
redis-client (0.25.0)
connection_pool
redis-rack-cache (2.2.1)
rack-cache (>= 1.10, < 2)
Expand Down
8 changes: 4 additions & 4 deletions config/unicorn.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@
# Unicorn master loads the app then forks off workers - because of the way
# Unix forking works, we need to make sure we aren't using any of the parent's
# sockets, e.g. db connection
#
# the following is highly recomended for Rails + "preload_app true"
# as there's no need for the master process to hold a connection
defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect!

# Redis and Memcached would go here but their connections are established
# on demand, so the master never opens a socket
end

if settings.enable_unicorn_workerkiller && defined?(Unicorn)
require_relative './config/unicorn_workerkiller'
end
27 changes: 25 additions & 2 deletions controllers/submission_metadata_controller.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,37 @@
class SubmissionMetadataController < ApplicationController

##
# Display all metadata for submissions
get '/submission_metadata' do
reply klass_metadata(LinkedData::Models::OntologySubmission, 'submission_metadata')
end

##
# Display metadata for a specific submission attribute
get '/submission_metadata/:attribute' do
attribute = params[:attribute]
metadata = klass_metadata(LinkedData::Models::OntologySubmission, 'submission_metadata')
attribute_metadata = metadata.find { |attr| attr[:attribute] == attribute }

halt 404, "Metadata for attribute '#{attribute}' not found" unless attribute_metadata

reply attribute_metadata
end

##
# Display all metadata for ontologies
get '/ontology_metadata' do
reply klass_metadata(LinkedData::Models::Ontology, 'ontology_metadata')
end
end

##
# Display metadata for a specific ontology attribute
get '/ontology_metadata/:attribute' do
attribute = params[:attribute]
metadata = klass_metadata(LinkedData::Models::Ontology, 'ontology_metadata')
attribute_metadata = metadata.find { |attr| attr[:attribute] == attribute }

halt 404, "Metadata for attribute '#{attribute}' not found" unless attribute_metadata

reply attribute_metadata
end
end
8 changes: 4 additions & 4 deletions test/controllers/test_properties_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def test_properties
get "/ontologies/#{@@acronyms.first}/properties"
assert last_response.ok?
results = MultiJson.load(last_response.body)
assert_equal 84, results.length
assert_equal 85, results.length

get "/ontologies/#{@@acronyms.last}/properties"
assert last_response.ok?
Expand All @@ -59,7 +59,7 @@ def test_property_roots
get "/ontologies/#{@@acronyms.first}/properties/roots"
assert last_response.ok?
pr = MultiJson.load(last_response.body)
assert_equal 61, pr.length
assert_equal 62, pr.length

# count object properties
opr = pr.select { |p| p["@type"] == "http://www.w3.org/2002/07/owl#ObjectProperty" }
Expand All @@ -69,7 +69,7 @@ def test_property_roots
assert_equal 32, dpr.length
# count annotation properties
apr = pr.select { |p| p["@type"] == "http://www.w3.org/2002/07/owl#AnnotationProperty" }
assert_equal 11, apr.length
assert_equal 12, apr.length
# check for non-root properties
assert_empty pr.select { |p| ["http://www.w3.org/2004/02/skos/core#broaderTransitive",
"http://www.w3.org/2004/02/skos/core#topConceptOf",
Expand Down Expand Up @@ -103,7 +103,7 @@ def test_property_tree
get "/ontologies/#{@@acronyms.first}/properties/http%3A%2F%2Fwww.w3.org%2F2004%2F02%2Fskos%2Fcore%23topConceptOf/tree"
assert last_response.ok?
pr = MultiJson.load(last_response.body)
assert_equal 61, pr.length
assert_equal 62, pr.length
num_found = 0

pr.each do |p|
Expand Down
Loading