XML Parsers

XML parsers take the response from the EUtils resources and extract information from the returned XML.

EUtilsXMLParserFactory

class EUtilsXMLParserFactory : public EUtilsFactoryInterface

Class EUtilsXMLParserFactory.

This is the base EUTILS XML parser class. The plan is to extend this base class to be specific for each DB type.

Public Functions

get (string $db)

Get the appropriate XML parser.

Parameters

$db – The name of the DB.

Throws

Returns

EUtilsAssemblyParser

class EUtilsAssemblyParser : public EUtilsParserInterface

Parser for NCBI Assembly https://www.ncbi.nlm.nih.gov/assembly/ XML.

Public Functions

getFTPData ($url)

Get the fields the assembly object will need from the FTP.

Parameters

$url

  • the ftp site url extracted form the metadata

Returns

array

parse (SimpleXMLElement $xml)
Parameters

$xml

Returns

array

parseMeta ($x)

Parse the <Meta> tag, which containts CDATA but all of the Assembly props.

Parameters

$x

Returns

array

EUtilsBioProjectParser

class EUtilsBioProjectParser : public EUtilsParserInterface

Class EUtilsBioProjectParser.

Note that projects don’t have reliable attribute listings.

Public Functions

bioProjectSubmission (SimpleXMLElement $xml)
Parameters

$xml

Returns

array

parse (SimpleXMLElement $xml)

Parse an NCBI BioProject XML.

Parameters

$xml – Simple XML Element.

Throws

Returns

array|mixed Array.

EUtilsBioSampleParser

class EUtilsBioSampleParser : public EUtilsParserInterface

Parses BioSample XML.

Public Functions

parse (SimpleXMLElement $xml)

Parse the XML into an array.

Parameters

$xml

Throws

Returns

array An array of parsed data

EUtilsPubmedParser

Pubmed records are parsed via the Tripal Core API.

class EUtilsPubmedParser : public EUtilsParserInterface

Class EUtilsPubmedParser.

Public Functions

parse (SimpleXMLElement $xml)

Parse an NCBI Pubmed XML. Uses the core parser code.

Parameters

$xml – Simple XML Element.

Throws

Returns

array|mixed Array.