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

Feature: Add an API endpoint to resolve an ontology URI in diffrent formats #69

Merged
merged 15 commits into from
Mar 15, 2024

Conversation

syphax-bouazzouni
Copy link

@syphax-bouazzouni syphax-bouazzouni commented Feb 8, 2024

Prerequisites

Description

This controller enhances the functionality of the ontologies_api project by providing a standardized interface for resolving resources within specific ontologies, supporting various output formats representation using the ontologies_linked_data.

See #66 for more details on the context

Endpoint

GET /ontologies/:acronym/resolve/:uri dereference resource with given format

Parameters

name type data type description
acronym required String Name of the ontology
uri required encoded uri URI of the resource

Body

name type data type description value
output_format optional String the format of the result ntriples (default), json, xml, turtle

Responses

http code content-type response description
200 <format_requested> The resource resolved with the format requested Success
500 plain/text Usage: ontologies/:acronym/resolve/:uri?output_format= OR POST: acronym, uri, output_format parameters if one of the parameters are empty
500 plain/text INVALID URI When the uri of the resource is not valid
500 plain/text Invalid output format When the requested format is different from the defined ones

bin/ontoportal Outdated Show resolved Hide resolved
controllers/dereference_resource_controller.rb Outdated Show resolved Hide resolved
controllers/dereference_resource_controller.rb Outdated Show resolved Hide resolved
controllers/dereference_resource_controller.rb Outdated Show resolved Hide resolved
test/controllers/test_dereference_resource_controller.rb Outdated Show resolved Hide resolved
Copy link
Author

@syphax-bouazzouni syphax-bouazzouni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@imadbourouche See comments for the requested changes

bin/ontoportal Outdated Show resolved Hide resolved
controllers/dereference_resource_controller.rb Outdated Show resolved Hide resolved
controllers/dereference_resource_controller.rb Outdated Show resolved Hide resolved
imadbourouche and others added 5 commits February 22, 2024 15:10
- change controller name and test controller name
- remove /parse endpoint
- rackup to shotgun in bin/ontoportal
- in json test, before we test the result we sort the hashes with the function (sort_nested_hash)
- in xml, ntriples and turtle, we split the result and the expected result, sort them and compare them
Copy link

codecov bot commented Mar 11, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 70.94%. Comparing base (cb9dfaf) to head (544cea6).

Files Patch % Lines
controllers/dereference_resource_controller.rb 85.29% 5 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           development      #69      +/-   ##
===============================================
+ Coverage        70.76%   70.94%   +0.17%     
===============================================
  Files               65       66       +1     
  Lines             3421     3455      +34     
===============================================
+ Hits              2421     2451      +30     
- Misses            1000     1004       +4     
Flag Coverage Δ
unittests 70.94% <85.71%> (+0.17%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@syphax-bouazzouni syphax-bouazzouni force-pushed the feature/uri-derefencing branch 4 times, most recently from 514ff28 to 8e82e88 Compare March 15, 2024 11:26
@syphax-bouazzouni syphax-bouazzouni force-pushed the feature/uri-derefencing branch from 8e82e88 to 544cea6 Compare March 15, 2024 12:13
@syphax-bouazzouni syphax-bouazzouni merged commit e4eef92 into development Mar 15, 2024
26 checks passed
@syphax-bouazzouni syphax-bouazzouni changed the title Feature: URI derenfencing Feature: Add an API endpoint to resolve an ontology URI in diffrent formats Mar 16, 2024
syphax-bouazzouni added a commit that referenced this pull request May 22, 2024
…RI content negotiation and Ontology metadata and data indexation (#73)

* Feature: Migrate to virtuoso (#67)

* set up multiple triple store test environment

* optimize api tests

* Fix: update ncbo_annotator gem version (#71)

* update ncbo_annotator gem version

* update alegrograph to version 8.1.0

* Feature: use the new  SOLR Schema API instead of SOLR config files  (#68)

* update docker compose to use standard SOLR not the ontoportal configured

* update term search to use the new Schema API and remove config files

* update properties search to use the new Schema API & remove config files

* update class and properties schema to use the existent dynamic names

* Feature: resolving resources within specific ontologies, supporting various output formats(#69)

* remove useless line preventing sending the reset password email (#65)

* [ontoportal-bot] Gemfile.lock update

* Feature: api endpoint returns json-ld  for the element with that URI

* implement GET, POST requests, and GET /parse to submit INRATHES ontology

* Enhance tests using real data submission

* Enhance bin/ontoportal to make it able to run localy with UI

* Small fixes

- change controller name and test controller name
- remove /parse endpoint
- rackup to shotgun in bin/ontoportal

* Fix test dereference resource controller

- in json test, before we test the result we sort the hashes with the function (sort_nested_hash)
- in xml, ntriples and turtle, we split the result and the expected result, sort them and compare them

* update gemfile: add json-ld (3.0.2)

* change derefrencement namespacing and clean code

* Fix dereference resource tests expected resultsto handle parse triples

* fix xml serialization test for AG and Gb by cleaning the xml string

---------

Co-authored-by: OntoPortal Bot <[email protected]>
Co-authored-by: imadbourouche <[email protected]>

* Feature: URI drerfrencement content negotiation (#72)

* remove useless line preventing sending the reset password email (#65)

* [ontoportal-bot] Gemfile.lock update

* Feature: api endpoint returns json-ld  for the element with that URI

* implement GET, POST requests, and GET /parse to submit INRATHES ontology

* Enhance tests using real data submission

* Enhance bin/ontoportal to make it able to run localy with UI

* Small fixes

- change controller name and test controller name
- remove /parse endpoint
- rackup to shotgun in bin/ontoportal

* Fix test dereference resource controller

- in json test, before we test the result we sort the hashes with the function (sort_nested_hash)
- in xml, ntriples and turtle, we split the result and the expected result, sort them and compare them

* update gemfile: add json-ld (3.0.2)

* change derefrencement namespacing and clean code

* Fix dereference resource tests expected resultsto handle parse triples

* Feature: add content negotiation middleware

* Add headers to tests instead of output_format

* Apply middleware to only /ontologies/:acronym/resolve/:uri

* Add test cases for AllegroGraph and fix xml test

* move the content_negotiation middleware into rack folder and  module

* re-implement again the usage of  the output_format param if no format is given in the request header

* clean the tests for no more necessary checks

* clean and simplify the content negotiation middleware

* add the accepted format in the error response of resolvability endpoint

* refactor the content negotiation middleware code to be more clear

---------

Co-authored-by: Syphax bouazzouni <[email protected]>
Co-authored-by: OntoPortal Bot <[email protected]>

* Fix: user creation security  (#60)

* extract slice tests helper to the parent class for reusability

* add a test for the creation of an admin user

* enforce the security of admin user creation

* update slices controller to enforce admin security

* Fix: the content negotiation by removing a no needed require

* Feature: Indexation administration & Ontologies and Agents search  (#70)

* index submission and agents metadata

* add search administration endpoints to init schema and index batch

* add ontology and agent search endpoints

* add agent and ontology search tests

* add admin search in collections

* make the search admin use directly the solr connector

* implement search ontologies content search endpoint

* enforce solr models indexing one by one to prevent batch fails

* add detType tov search ontologies  content search endpoint

* fix content ontology search pagination

* add ontology search content types filter

* Feature: Add accessibility security to ontology metadata & content search results  (#74)

* add ontology accessibility restriction  to ontology metadata search

* add ontology accessibility restriction  to ontology content search

* add search results accessibility security test

* fix: enable user creation notification (#76)

* Fix: Invalidating cache on insert & fix Redis warning (#77)

* Merge pull request https://github.com/ncbo/ontologies_api/pull/120from ncbo/remove_redis-activesupport

Remove redis activesupport

* use the branch development of sparql client

* Feature: mappings statistics slices support (#78)

* restrict mapping statistics ontologies to the ontologies of the current slice

* add a test for the mappings slices support

* add test for mappings statistics slices support

---------

Co-authored-by: OntoPortal Bot <[email protected]>
Co-authored-by: imadbourouche <[email protected]>
Co-authored-by: Bilel Kihal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants