Skip to content

Commit

Permalink
Merge branch 'master' into pr/align-with-agroportal-12-24
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Dec 17, 2024
2 parents e26859c + 838c92c commit 97921b2
Show file tree
Hide file tree
Showing 121 changed files with 10,055 additions and 6,652 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ruby-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ jobs:
strategy:
fail-fast: false
matrix:
backend: ['ruby', 'ruby-agraph'] # ruby runs tests with 4store backend and ruby-agraph runs with AllegroGraph backend
goo-slice: [ '20', '100', '500' ]
ruby-version: [ '2.7' ]
triplestore: [ 'fs', 'ag', 'vo', 'gb' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ COPY Gemfile* /srv/ontoportal/ontologies_linked_data/

WORKDIR /srv/ontoportal/ontologies_linked_data

RUN gem update --system
RUN gem update --system 3.4.22 # the 3.4.22 can be removed if we support Ruby version > 3.0
RUN gem install bundler
ENV BUNDLE_PATH=/srv/ontoportal/bundle
RUN bundle install
Expand Down
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ 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: 'master'
gem 'sparql-client', github: 'ncbo/sparql-client', branch: 'master'
gem 'goo', github: 'ontoportal-lirmm/goo', branch: 'development'
gem 'sparql-client', github: 'ontoportal-lirmm/sparql-client', branch: 'development'
18 changes: 13 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ GIT
goo (0.0.2)
addressable (~> 2.8)
pry
rdf (= 1.0.8)
rdf (= 3.2.11)
rdf-raptor
rdf-rdfxml
rdf-vocab
redis
request_store
rest-client
Expand All @@ -19,10 +22,9 @@ GIT
revision: e89c26aa96f184dbe9b52d51e04fb3d9ba998dbc
branch: master
specs:
sparql-client (1.0.1)
json_pure (>= 1.4)
net-http-persistent (= 2.9.4)
rdf (>= 1.0)
sparql-client (3.2.2)
net-http-persistent (~> 4.0, >= 4.0.2)
rdf (~> 3.2, >= 3.2.11)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -190,6 +192,10 @@ GEM
uri (1.0.2)
uuid (2.3.9)
macaddr (~> 1.0)
webmock (3.24.0)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)

PLATFORMS
aarch64-linux
Expand All @@ -211,6 +217,7 @@ DEPENDENCIES
multi_json (~> 1.0)
oj (~> 3.0)
omni_logger
parallel (~> 1.24)
pony
pry
rack
Expand All @@ -225,6 +232,7 @@ DEPENDENCIES
simplecov-cobertura
sparql-client!
thin
webmock

BUNDLED WITH
2.5.11
61 changes: 61 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,69 @@
ontologies_linked_data
======================

## TODO

DONE: Quand ces champs ne sont pas remplis, faut mettre les valeurs par défaut (skos:prefLabel, skos:altLabel)
```ruby
"prefLabelProperty": null,
"definitionProperty": null,
"synonymProperty": null,
"authorProperty": null,
"hierarchyProperty": null,
"obsoleteProperty": null,
"obsoleteParent": null
```

On pourrait aussi peupler seul exampleIdentifier (on prend l'URI d'une classe au pif dans l'ontology)

On pourrait générer également useImports avec les URI des owl:imports

uriregexpattern: uri de l'ontology (où on vire la fin et on met sous forme de regex)

### Not valid property names

Property names with - in it are not valid.

Causing the following error:

```
NameError - `@bug-database' is not allowed as an instance variable name:
/usr/local/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/goo-7bbbb557d9f2/lib/goo/base/resource.rb:203:in `instance_variable_set'
/usr/local/rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/bundler/gems/goo-7bbbb557d9f2/lib/goo/base/resource.rb:203:in `block in bring'
```


## Unit test status

Unit test status:
- master branch: [![Build Status](https://bmir-jenkins.stanford.edu/buildStatus/icon?job=NCBO_OntLD_MasterTest)](https://bmir-jenkins.stanford.edu/job/NCBO_OntLD_MasterTest/)
- staging branch: [![Build Status](https://bmir-jenkins.stanford.edu/buildStatus/icon?job=NCBO_OntLD_StagingTest)](https://bmir-jenkins.stanford.edu/job/NCBO_OntLD_StagingTest/)

Models and serializers for ontologies and related artifacts backed by 4store

This is a component of the NCBO [ontologies_api](https://github.com/ncbo/ontologies_api).


## Add a new namespace in GOO for properties

To add new namespaces used in the `Goo.vocabulary` go to `lib/ontologies_linked_data/config/config.rb`

And use the GOO `add_namespace` method. For example:

```ruby
Goo.configure do |conf|
conf.add_namespace(:omv, RDF::Vocabulary.new("http://omv.ontoware.org/2005/05/ontology#"))
end
```

* To iterate other the namespaces
```ruby
Goo.namespaces.each do |prefix,uri|
puts "#{prefix}: #{uri}"
end
```

* To resolve a namespace
```ruby
Goo.vocabulary(:omv).to_s
```
Binary file added bin/bubastis-1.4.0.jar
Binary file not shown.
Binary file removed bin/bubastis.jar
Binary file not shown.
1 change: 1 addition & 0 deletions bin/bubastis.jar
Binary file added bin/bubastis_1_3.jar
Binary file not shown.
8 changes: 4 additions & 4 deletions bin/bubastis_readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Bubastis is an ontology change tool which is able to analyse two ontologies (typ


Usage:
java -jar bubastis_1_2.jar parameters:
java -jar bubastis.jar parameters:
(required) -ontology1 location of ontology 1 either a URL for an ontology on the web or a local file location in obo or owl format. Typically the older version of the ontologies being compared
(required) -ontology2 location of ontology 2 either a URL or local file location of an obo or owl format ontology. Typically the newer version of the ontologies being compared.
(optional) -output location of output file to send results, default is to console.
Expand All @@ -15,10 +15,10 @@ java -jar bubastis_1_2.jar parameters:

Examples:
Loading two files locally and outputting results to console:
java -jar bubastis_1_2.jar -ontology1 "H://obi_nov_08.owl" -ontology2 "H://obi_jan_09.owl"
java -jar bubastis.jar -ontology1 "H://obi_nov_08.owl" -ontology2 "H://obi_jan_09.owl"

Loading two files locally and output results to xml file with an xslt location inserted into header
java -jar bubastis_1_2.jar -1 "H://obi_nov_08.owl" -2 "H://obi_jan_09.owl" -output "H://OBIdiff.xml" -format xml -xslt "./stylesheets/bubastis.xslt"
java -jar bubastis.jar -1 "H://obi_nov_08.owl" -2 "H://obi_jan_09.owl" -output "H://OBIdiff.xml" -format xml -xslt "./stylesheets/bubastis.xslt"

Loading one file locally and one from the web and outputting results to plain text:
java -jar bubastis_1_2.jar -ontology1 "H://disease_ontology_version_1.owl" -ontology2 "http://www.disease.org/diseaseontology_latest.owl" -output "C://my_diff.txt"
java -jar bubastis.jar -ontology1 "H://disease_ontology_version_1.owl" -ontology2 "http://www.disease.org/diseaseontology_latest.owl" -output "C://my_diff.txt"
151 changes: 132 additions & 19 deletions config/config.rb.sample
Original file line number Diff line number Diff line change
@@ -1,21 +1,134 @@
LinkedData.config do |config|
config.goo_port = 9000
config.goo_host = "localhost"
config.search_server_url = "http://localhost:8983/solr/term_search_core1"
config.property_search_server_url = "http://localhost:8983/solr/prop_search_core1"
config.repository_folder = "./test/data/ontology_files/repo"
config.rest_url_prefix = "http://data.bioontology.org/"
config.enable_security = false
config.java_max_heap_size = '10240M'
#PURL server config parameters
config.enable_purl = false
config.purl_host = "purl.bioontology.org"
config.purl_port = 80
config.purl_username = ""
config.purl_password = ""
config.purl_maintainers = ""
config.purl_target_url_prefix = "http://bioportal.bioontology.org"
GOO_BACKEND_NAME = ENV.include?("GOO_BACKEND_NAME") ? ENV["GOO_BACKEND_NAME"] : "4store"
GOO_PATH_QUERY = ENV.include?("GOO_PATH_QUERY") ? ENV["GOO_PATH_QUERY"] : "/sparql/"
GOO_PATH_DATA = ENV.include?("GOO_PATH_DATA") ? ENV["GOO_PATH_DATA"] : "/data/"
GOO_PATH_UPDATE = ENV.include?("GOO_PATH_UPDATE") ? ENV["GOO_PATH_UPDATE"] : "/update/"
GOO_PORT = ENV.include?("GOO_PORT") ? ENV["GOO_PORT"] : 9000
GOO_HOST = ENV.include?("GOO_HOST") ? ENV["GOO_HOST"] : "localhost"
REDIS_HOST = ENV.include?("REDIS_HOST") ? ENV["REDIS_HOST"] : "localhost"
REDIS_PORT = ENV.include?("REDIS_PORT") ? ENV["REDIS_PORT"] : 6379
SOLR_TERM_SEARCH_URL = ENV.include?("SOLR_TERM_SEARCH_URL") ? ENV["SOLR_TERM_SEARCH_URL"] : "http://localhost:8983/solr"
SOLR_PROP_SEARCH_URL = ENV.include?("SOLR_PROP_SEARCH_URL") ? ENV["SOLR_PROP_SEARCH_URL"] : "http://localhost:8983/solr"
GOO_SLICES = ENV["GOO_SLICES"] || 500
begin
LinkedData.config do |config|
Goo.slice_loading_size = GOO_SLICES.to_i
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.sparql_endpoint_url = "http:://sparql_endpoint.com"
# config.enable_notifications = false
#
config.java_max_heap_size = '20480M'
config.main_languages = ['en']

# Caches
config.goo_redis_host = REDIS_HOST.to_s
config.goo_redis_port = REDIS_PORT.to_i
config.enable_http_cache = false

# Email notifications
config.enable_notifications = false
config.email_sender = '[email protected]' # Default sender for emails
config.email_override = '[email protected]' # all email gets sent here. Disable with email_override_disable.
config.email_disable_override = true
config.smtp_host = 'localhost'
config.smtp_port = 1025
config.smtp_auth_type = :plain # :none, :plain, :login, :cram_md5
config.smtp_domain = 'lirmm.fr'
config.smtp_user = 'test'
config.smtp_password = 'test'
# Emails of the instance administrators to get mail notifications when new user or new ontology
# config.admin_emails = ['[email protected]']

# Used to define other bioportal that can be mapped to
# Example to map to ncbo bioportal : {"ncbo" => {"api" => "http://data.bioontology.org", "ui" => "http://bioportal.bioontology.org", "apikey" => ""}
# Then create the mapping using the following class in JSON : "http://purl.bioontology.org/ontology/MESH/C585345": "ncbo:MESH"
# Where "ncbo" is the namespace used as key in the interportal_hash
config.interportal_hash = {
'agroportal' => {
'api' => 'http://data.agroportal.lirmm.fr',
'ui' => 'http://agroportal.lirmm.fr',
'apikey' => '1cfae05f-9e67-486f-820b-b393dec5764b'
},
'ncbo' => {
'api' => 'http://data.bioontology.org',
'ui' => 'http://bioportal.bioontology.org',
'apikey' => '4a5011ea-75fa-4be6-8e89-f45c8c84844e'
},
'sifr' => {
'api' => 'http://data.bioportal.lirmm.fr',
'ui' => 'http://bioportal.lirmm.fr',
'apikey' => '1cfae05f-9e67-486f-820b-b393dec5764b'
}
}

# oauth
config.oauth_providers = {
github: {
check: :access_token,
link: 'https://api.github.com/user'
},
keycloak: {
check: :jwt_token,
cert: 'KEYCLOAK_SECRET_KEY'
},
orcid: {
check: :access_token,
link: 'https://pub.orcid.org/v3.0/me'
},
google: {
check: :access_token,
link: 'https://www.googleapis.com/oauth2/v3/userinfo'
}
}

config.ui_name = 'Bioportal'
config.title = 'NCBO BioPortal'
config.description = "The world's most comprehensive repository of biomedical ontologies"
config.color = '#234979'
config.logo = ''
config.fundedBy = [
{
img_src: 'https://identity.stanford.edu/wp-content/uploads/sites/3/2020/07/block-s-right.png',
url: 'https://www.stanford.edu',

},
{
img_src: 'https://ontoportal.org/images/logo.png',
url: 'https://ontoportal.org/',
}
]
config.federated_portals = {
'agroportal' => {
api: 'http://data.agroportal.lirmm.fr',
ui: 'http://agroportal.lirmm.fr',
apikey: '1cfae05f-9e67-486f-820b-b393dec5764b',
color: '#1e2251'
},
'bioportal' => {
api: 'http://data.bioontology.org',
ui: 'http://bioportal.bioontology.org',
apikey: '4a5011ea-75fa-4be6-8e89-f45c8c84844e',
color: '#234979'
},

}
end
rescue NameError => e
binding.pry
# puts '(CNFG) >> LinkedData not available, cannot load config'
end

#sometimes tmp by default cannot allocate large files
$TMP_SORT_FOLDER = "SOME TMP FOLDER"
# sometimes tmp by default cannot allocate large files
$TMP_SORT_FOLDER = 'SOME TMP FOLDER'
35 changes: 0 additions & 35 deletions config/config.test.rb

This file was deleted.

Loading

0 comments on commit 97921b2

Please sign in to comment.