ops.js
Javascript based API with methods used to access the Open PHACTS Discovery Platform and parse the responses
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
Keywords from Contributors
Repository
Javascript based API with methods used to access the Open PHACTS Discovery Platform and parse the responses
Basic Info
- Host: GitHub
- Owner: openphacts
- License: mit
- Language: JavaScript
- Default Branch: master
- Homepage: https://www.npmjs.com/package/ops.js
- Size: 1.95 MB
Statistics
- Stars: 2
- Watchers: 40
- Forks: 5
- Open Issues: 13
- Releases: 0
Topics
Metadata Files
README.md
OPS.js

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.
- Fork the project.
- Checkout develop branch.
- Create a new branch based on develop and change the code.
- Write some tests.
- 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
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
- Website: http://www.openphacts.org
- Repositories: 52
- Profile: https://github.com/openphacts
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
Top Committers
| Name | 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
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
- Homepage: https://github.com/openphacts/ops.js
- License: MIT
-
Latest release: 7.0.0
published over 9 years ago
Rankings
Maintainers (3)
Dependencies
- 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