ops.js

Javascript based API with methods used to access the Open PHACTS Discovery Platform and parse the responses

https://github.com/openphacts/ops.js

Science Score: 51.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 9 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
    2 of 9 committers (22.2%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.5%) to scientific vocabulary

Keywords

javascript nodejs openphacts

Keywords from Contributors

bioinformatics bridgedb identifier-mapping mysql-backend uri
Last synced: 6 months ago · JSON representation ·

Repository

Javascript based API with methods used to access the Open PHACTS Discovery Platform and parse the responses

Basic Info
Statistics
  • Stars: 2
  • Watchers: 40
  • Forks: 5
  • Open Issues: 13
  • Releases: 0
Topics
javascript nodejs openphacts
Created almost 13 years ago · Last pushed about 8 years ago
Metadata Files
Readme Citation

README.md

OPS.js Build Status DOI

Open PHACTS API Version

2.2

About

OPS.js is a javascript NodeJS based library, available via NPM, for accessing the Open PHACTS Linked Data API (LDA). It uses nets to handle the asynchronous network calls. OPS.js can also be used to parse responses from the LDA. Please read the API documentation. The API documentation is also available locally within the docs folder. To view them open the docs/index.html file in a browser.

Dependencies & requirements

NodeJS, NPM, nets, JSDoc & browserify Get your Open PHACTS API application ID and key by registering at https://dev.openphacts.org

Licence

The OPS.js source code is released under the MIT License, http://opensource.org/licenses/MIT. See licence.txt for more details.

Contributing

We love receiving patches for bug fixes and new features. Please follow these simple steps to make our lives easier.

  1. Fork the project.
  2. Checkout develop branch.
  3. Create a new branch based on develop and change the code.
  4. Write some tests.
  5. Submit patch.

Citations

To cite OPS.js in publications please see the zenodo record.

Ian Dunlop et al. (2018). ops.js: OPS.js 7.1.0 for Open PHACTS 2.2 API. Zenodo. 10.5281/zenodo.167595

For Bibtex use:

latex @misc{ian_dunlop_2016_167595, author = {Ian Dunlop and Egon Willighagen and Elblood and Andra Waagmeester and Stian Soiland-Reyes and PANDORINO and Morton Fox}, title = {ops.js: OPS.js 7.1.0 for Open PHACTS 2.2 API}, month = jan, year = 2018, doi = {10.5281/zenodo.167595}, url = {http://dx.doi.org/10.5281/zenodo.167595} }

You can get version information by using an OPS.js method in a browser or Node:

javascript new Version().information()

Using the library

If running in a browser based application use src/combined.js. With NodeJS use npm install ops.js.
See the API documentation

Each API call generally has 1 method to fetch the results using an asynchronous call with a callback and then another method to parse these results. Look at https://dev.openphacts.org for more information about the source methods that the API calls use.

Testing the library

Jasmine is used to test the ops.js api. The specs for the tests are in the 'test/spec' directory. To run them use jasmine-node like this:

bash jasmine-node --config app_id your_app_id --config app_key your_app_key --config app_url https://beta.openphacts.org/2.1 test/spec/integration/

In case the test run does not finish with some statistics on the number of tests run, assertions made, and skipped and failed tests, then it like failed on one of the tests. To see the exception that was thrown, run Jasmine with the --captureExceptions option:

bash jasmine-node --captureExceptions --config app_id your_app_id --config app_key your_app_key --config app_url https://beta.openphacts.org/1.5 test/spec/integration/

To enable console logging of URIs tested, add the parameter --config debug true

Testing with Docker

If you use Docker, you can run the openphacts/ops-api-test image to run the tests, without needing to install NodeJS.

Run with the -it parameter to get colour output. You might want to override environment variables like app_url, app_id and app_key. Example:

bash docker run -it -e app_url=http://heater.cs.man.ac.uk:3002 openphacts/ops-api-test

API call examples:

More examples can be found in the integration tests and in the API docs.

Concept Wiki free text search

javascript var searcher = new ConceptWikiSearch("https://beta.openphacts.org/2.1", appID, appKey); var callback=function(success, status, response){ searcher.parseResponse(response); }; // success is 'true' or 'false', status is the http status code, response is the raw result which the parser function accepts // response will be null in the case of errors // limit to 20 results, species human (branch 4), with type set to compounds (uuid 07a800....) searcher.byTag('Aspirin', '20', '4', '07a84994-e464-4bbf-812a-a4b96fa3d197', callback);

Compound information

javascript var searcher = new CompoundSearch("https://beta.openphacts.org/2.1", appID, appKey); var callback=function(success, status, response){ var compoundResult = searcher.parseCompoundResponse(response); }; // success is 'true' or 'false', status is the http status code, response is the raw result which the parser function accepts // response will be null in the case of errors // compound uri is for Aspirin searcher.fetchCompound('http://www.conceptwiki.org/concept/38932552-111f-4a4e-a46a-4ed1d7bdf9d5', null, callback);

Core Developers

Ian Dunlop

Contributors

Rishi Ramgolam
Elblood
Andra Waagmeester
Egon Willighagen
PANDORINO
Stian Soiland-Reyes Morton Fox

Owner

  • Name: Open PHACTS
  • Login: openphacts
  • Kind: organization
  • Email: info@openphactsfoundation.org
  • Location: GB

Citation (citation.txt)

@misc{ian_dunlop_2016_167595,  
author       = {Ian Dunlop and  
                Egon Willighagen and  
                Elblood and  
                andrawaag and  
                Stian Soiland-Reyes and  
                PANDORINO and
                Morton Fox},  
title        = {ops.js: OPS.js 7.1.0 for Open PHACTS 2.2 API},
month        = jan,
year         = 2018,
doi          = {10.5281/zenodo.167595},  
url          = {http://dx.doi.org/10.5281/zenodo.167595}  
} 

GitHub Events

Total
Last Year

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 516
  • Total Committers: 9
  • Avg Commits per committer: 57.333
  • Development Distribution Score (DDS): 0.467
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Ian Dunlop i****p@m****k 275
Ian Dunlop i****p@g****m 179
Egon Willighagen e****n@g****m 41
Stian Soiland-Reyes s****s@c****k 13
Elblood b****z@g****m 3
andrawaag a****r@g****m 2
Morton Fox g****b@q****m 1
PANDORINO d****5@h****t 1
Stian Soiland-Reyes s****n@a****g 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 31
  • Total pull requests: 12
  • Average time to close issues: 3 months
  • Average time to close pull requests: 6 days
  • Total issue authors: 5
  • Total pull request authors: 5
  • Average comments per issue: 1.23
  • Average comments per pull request: 0.75
  • Merged pull requests: 7
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • egonw (17)
  • ianwdunlop (11)
  • jmartasek (1)
  • DeniseSl22 (1)
  • aessig (1)
Pull Request Authors
  • egonw (6)
  • Elblood (3)
  • PANDORINO (1)
  • mortonfox (1)
  • andrawaag (1)
Top Labels
Issue Labels
bug (10) enhancement (5) question (4)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • npm 15 last-month
  • Total dependent packages: 2
  • Total dependent repositories: 1
  • Total versions: 6
  • Total maintainers: 3
npmjs.org: ops.js

Javascript based library to access the Open PHACTS API and discover bio-chemical and life sciences data

  • Versions: 6
  • Dependent Packages: 2
  • Dependent Repositories: 1
  • Downloads: 15 Last month
Rankings
Forks count: 7.7%
Dependent packages count: 8.8%
Dependent repos count: 10.3%
Average: 11.7%
Stargazers count: 14.5%
Downloads: 17.3%
Maintainers (3)
Last synced: 6 months ago

Dependencies

package.json npm
  • browserify >=10.2.6 development
  • jasmine-node ~1.14.5 development
  • jsdoc >=3.3.2 development
  • nock >=2.9.1 development
  • nets >=3.1.0