2017 © Pedro Peláez
 

library mesh-parser

PHP library for extracting MeSH descriptors from XML.

image

ilios/mesh-parser

PHP library for extracting MeSH descriptors from XML.

  • Friday, December 22, 2017
  • by stopfstedt
  • Repository
  • 13 Watchers
  • 6 Stars
  • 7,616 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 2 Versions
  • 13 % Grown

The README.md

MeSH Parser

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., (*1)

It expects its input to be compliant with the 2024 or 2025 MeSH DTDs., (*2)

Installation

Use composer to add this library to your project., (*3)

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., (*4)

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) {
        // ...
    }
}

The Versions

22/12 2017

dev-master

9999999-dev http://iliosproject.org/

PHP library for extracting MeSH descriptors from XML.

  Sources   Download

MIT

The Requires

  • php ~7.1|~7.2

 

The Development Requires

by Stefan Topfstedt

mesh ilios

10/12 2016

v2.0.0

2.0.0.0 http://iliosproject.org/

PHP library for extracting MeSH descriptors from XML.

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

by Stefan Topfstedt

mesh ilios