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 mapping bulk load endpoint "/mappings/load" #101

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

syphax-bouazzouni
Copy link

Prerequisite

What

This PR adds an endpoint for uploading a file containing a set of mappings, bellow is an example of the structure of the file

[ 
{
      "classes": ["http://bioontology.org/ontologies/BiomedicalResourceOntology.owl#Image_Algorithm"
                    ,"http://purl.org/incf/ontology/Computational_Neurosciences/cno_alpha.owl#cno_0000202"],
     
      "name": 'This is the mappings produced to test the bulk load',
      "source": 'https://w3id.org/semapv/LexicalMatching',
      "comment": 'mock data',
      "relation": [
          'http://www.w3.org/2002/07/owl#subClassOf'
       ],
      "subject_source_id": 'http://bioontology.org/ontologies/BiomedicalResources.owl',
      "object_source_id": 'http://purl.org/incf/ontology/Computational_Neurosciences/cno_alpha.owl',
      "source_name": 'https://w3id.org/sssom/mapping/tests/data/basic.tsv',
      "source_contact_info": 'orcid:1234,orcid:5678',
       "date": '2020-05-30' 
    }
]

Why

Changes

  • add post '/load' to the mappings_controller.rb
  • move request_has_file? and file_from_request from ontology_helpers.rb to application_helpers.rb
  • add test_mappings_file_loadto the test_mappings_controller.rb
  • refactor the test_mappings_controller.rb to extract some repeated tests/code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant