-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bfa6fc3
commit d3ddad8
Showing
16 changed files
with
2,684 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*~ | ||
*.patch | ||
/vendor/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2016 The Regents of the University of California | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# MeSH Parser | ||
|
||
This PHP code library provides tools for extracting [Medical Subject Headings](https://www.nlm.nih.gov/mesh/) (MeSH) descriptors | ||
and associated data from a given XML file into an object representation. | ||
|
||
It expects its input to be provided in 2016 version of the MeSH Descriptors XML format. | ||
|
||
## Installation | ||
|
||
_TODO_ | ||
|
||
## Usage | ||
|
||
_TODO_ | ||
|
||
## Example | ||
|
||
```php | ||
<?php | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
// instantiate the parser | ||
$parser = new \Ilios\MeSH\Parser(); | ||
|
||
// provide an URL or a local file path. | ||
//$uri = 'ftp://nlmpubs.nlm.nih.gov/online/mesh/.xmlmesh/desc2016.xml'; | ||
$uri = __DIR__ . '/desc2016.xml'; | ||
|
||
$set = $parser->parse($uri); | ||
|
||
// process parsed data, e.g. | ||
$descriptor = $set->findDescriptorByUi('D000001'); | ||
echo "Descriptor ID (Name): {$descriptor->getUi()} ({$descriptor->getName()})\n"; | ||
$concepts = $descriptor->getConcepts(); | ||
foreach($concepts as $concept) { | ||
echo "- Concept ID (Name): {$concept->getUi()} ({$concept->getName()})\n"; | ||
$terms = $concept->getTerms(); | ||
foreach ($terms as $term) { | ||
// ... | ||
} | ||
} | ||
``` | ||
|
||
## Legacy parser | ||
|
||
_TODO_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "ilios/mesh-parser", | ||
"type": "library", | ||
"description": "PHP library for extracting MeSH descriptors from XML.", | ||
"keywords": [ | ||
"Ilios", | ||
"MeSH" | ||
], | ||
"homepage": "http://iliosproject.org/", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Stefan Topfstedt", | ||
"email": "[email protected]", | ||
"role": "developer" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.5.0" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "~4.7.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"": "src/" | ||
} | ||
} | ||
} |
Oops, something went wrong.