ilios/mesh-parser
最新稳定版本:v4.0.0
Composer 安装命令:
composer require ilios/mesh-parser
包简介
PHP library for extracting MeSH descriptors from XML.
README 文档
README
This PHP code library provides tools for extracting Medical Subject Headings (MeSH) descriptors and associated data from a given XML file into an object representation.
It expects its input to be compliant with the 2024 or 2025 MeSH DTDs.
Installation
Use composer to add this library to your project.
composer require ilios/mesh-parser
Usage
Instantiate \Ilios\MeSH\Parser and invoke its parse() method with a URI that points at valid MeSH descriptors
XML file.
This method call will return an instance of \Ilios\MeSH\Model\DescriptorSet; this is the entry point into
the object representation of the descriptors data model.
Use getter methods on this object and its subcomponents to traverse and process this model.
Example
<?php require __DIR__ . '/vendor/autoload.php'; // provide a URL or a local file path. //$uri = 'https://nlmpubs.nlm.nih.gov/projects/mesh/MESH_FILES/xmlmesh/desc2024.xml'; $uri = __DIR__ . '/desc2024.xml'; // instantiate the parser and parse the input. $parser = new \Ilios\MeSH\Parser(); $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) { // ... } }
统计信息
- 总下载量: 199.25k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-03-14