gomesh2014

package module
v0.0.0-...-07d2057 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2016 License: Apache-2.0 Imports: 7 Imported by: 0

README

gomesh

Go library to read MEDLINE/PubMed Medical Subject Headings (MeSH) XML (2014)

MeSH Record Types

Data

MeSH XML download is here. "Download of any of the full data files requires the completion of an online Memorandum of Understanding." A tiny sample of this data is available in https://github.com/gnewton/gomesh/tree/master/testData

Example

Example usage: see gomesh or a running example of gomesh running at Dumontier Lab

TODO

  • Document core methods in README.md
  • Allow for loading then writing to SQLite then using SQLite so full data is not in memory (once done allow using SQLite as data source)

Acknowledgement

This work is a by-product of my graduate work at Carleton Univerity at Dumontier Lab

Documentation

Index

Constants

View Source
const DESCRIPTOR_RECORD = "DescriptorRecord"
View Source
const PHARMACOLOGICAL_RECORD = "PharmacologicalAction"
View Source
const QUALIFIER_RECORD = "QualifierRecord"
View Source
const SUPPLEMENTAL_RECORD = "SupplementalRecord"
View Source
const TREE_SEPARATOR = "."

Variables

View Source
var TOP_LEVEL = map[string]string{
	"A": "Anatomy",
	"B": "Organisms",
	"C": "Diseases",
	"D": "Chemicals and Drugs",
	"E": "Analytical, Diagnostic and Therapeutic Techniques and Equipment",
	"F": "Psychiatry and Psychology",
	"G": "Phenomena and Processes",
	"H": "Disciplines and Occupations",
	"I": "Anthropology, Education, Sociology and Social Phenomena",
	"J": "Technology, Industry, Agriculture",
	"K": "Humanities",
	"L": "Information Science",
	"M": "Named Groups",
	"N": "Health Care",
	"V": "Publication Characteristics",
	"Z": "Geographicals",
}

Functions

func DescriptorChannelFromFile

func DescriptorChannelFromFile(filename string) (desChan chan *DescriptorRecord, file *os.File, err error)

func DescriptorChannelFromReader

func DescriptorChannelFromReader(reader io.Reader) (chan *DescriptorRecord, error)

func DescriptorMapFromFile

func DescriptorMapFromFile(filename string) (map[string]*DescriptorRecord, error)

func DescriptorMapFromReader

func DescriptorMapFromReader(reader io.Reader) (map[string]*DescriptorRecord, error)

func MeshDescriptorNameMap

func MeshDescriptorNameMap(uiMap map[string]*DescriptorRecord) map[string]*DescriptorRecord

func PharmacologicalChannelFromFile

func PharmacologicalChannelFromFile(filename string) (pharmChan chan *PharmacologicalAction, file *os.File, err error)

func PharmacologicalChannelFromReader

func PharmacologicalChannelFromReader(reader io.Reader) (chan *PharmacologicalAction, error)

func PharmacologicalMapFromFile

func PharmacologicalMapFromFile(filename string) (map[string]*PharmacologicalAction, error)

func PharmacologicalMapFromReader

func PharmacologicalMapFromReader(reader io.Reader) (map[string]*PharmacologicalAction, error)

func QualifierChannelFromFile

func QualifierChannelFromFile(filename string) (qualChan chan *QualifierRecord, file *os.File, err error)

func QualifierChannelFromReader

func QualifierChannelFromReader(reader io.Reader) (chan *QualifierRecord, error)

func QualifierMapFromFile

func QualifierMapFromFile(filename string) (map[string]*QualifierRecord, error)

func QualifierMapFromReader

func QualifierMapFromReader(reader io.Reader) (map[string]*QualifierRecord, error)

func SelfLinkDescriptor

func SelfLinkDescriptor(m map[string]*DescriptorRecord)

func SupplementalChannelFromFile

func SupplementalChannelFromFile(filename string) (suppChan chan *SupplementalRecord, file *os.File, err error)

func SupplementalChannelFromReader

func SupplementalChannelFromReader(reader io.Reader) (chan *SupplementalRecord, error)

func SupplementalMapFromFile

func SupplementalMapFromFile(filename string) (map[string]*SupplementalRecord, error)

func SupplementalMapFromReader

func SupplementalMapFromReader(reader io.Reader) (map[string]*SupplementalRecord, error)

Types

type Abbreviation

type Abbreviation struct {
	Abbreviation string `xml:",chardata"`
}

type AllowableQualifier

type AllowableQualifier struct {
	QualifierReferredTo *QualifierReferredTo
	Abbreviation        Abbreviation
}

type AllowableQualifiersList

type AllowableQualifiersList struct {
	AllowableQualifier []AllowableQualifier
}

type Concept

type Concept struct {
	CASN1Name                   string                    `json:",omitempty"`
	ConceptName                 string                    `xml:">String"`
	ConceptRelationList         ConceptRelationList       `json:",omitempty"`
	ConceptUI                   string                    `json:",omitempty"`
	PreferredConceptYN          string                    `xml:",attr" json:",omitempty"`
	RegistryNumber              string                    `json:",omitempty"`
	RelatedRegistryNumberList   RelatedRegistryNumberList `json:",omitempty"`
	ScopeNote                   string                    `json:",omitempty"`
	SemanticTypeList            SemanticTypeList          `json:",omitempty"`
	TermList                    TermList                  `json:",omitempty"`
	TranslatorsEnglishScopeNote string                    `json:",omitempty"`
	TranslatorsScopeNote        string                    `json:",omitempty"`
}

type ConceptList

type ConceptList struct {
	Concept []Concept `json:",omitempty"`
}

type ConceptRelation

type ConceptRelation struct {
	Concept1UI   string
	Concept2UI   string
	RelationName string `xml:",attr" json:",omitempty"`
}

type ConceptRelationList

type ConceptRelationList struct {
	ConceptRelation []ConceptRelation `json:",omitempty"`
}

type Date

type Date struct {
	Year  string `json:",omitempty"`
	Month string `json:",omitempty"`
	Day   string `json:",omitempty"`
}

type DescriptorRecord

type DescriptorRecord struct {
	ActiveMeSHYearList        []string `xml:">Year"`
	AllowableQualifiersList   AllowableQualifiersList
	Annotation                string                    `json:",omitempty"`
	ConceptList               ConceptList               `json:",omitempty"`
	ConsiderAlso              string                    `json:",omitempty"`
	DateCreated               Date                      `json:",omitempty"`
	DateEstablished           Date                      `json:",omitempty"`
	DateRevised               Date                      `json:",omitempty"`
	DescriptorName            string                    `xml:"DescriptorName>String"`
	DescriptorUI              string                    `json:",omitempty"`
	EntryCombinationList      EntryCombinationList      `json:",omitempty"`
	HistoryNote               string                    `json:",omitempty"`
	OnlineNote                string                    `json:",omitempty"`
	PharmacologicalActionList PharmacologicalActionList `json:",omitempty"`
	PreviousIndexingList      PreviousIndexingList      `json:",omitempty"`
	PublicMeSHNote            string                    `json:",omitempty"`
	RecordOriginatorsList     RecordOriginatorsList     `json:",omitempty"`
	RunningHead               string                    `json:",omitempty"`
	SeeRelatedList            SeeRelatedList            `json:",omitempty"`
	TreeNumberList            TreeNumberList            `json:",omitempty"`
}

type DescriptorRecordSet

type DescriptorRecordSet struct {
	DescriptorRecord []DescriptorRecord
	LanguageCode     string `xml:",attr"`
}

type DescriptorReferredTo

type DescriptorReferredTo struct {
	DescriptorUI     string            `json:",omitempty"`
	DescriptorName   string            `xml:"DescriptorName>String"`
	DescriptorRecord *DescriptorRecord `xml:"-" json:",omitempty"`
	Url              string            `json:",omitempty"`
}

type ECIN

type ECIN struct {
	DescriptorReferredTo *DescriptorReferredTo `json:",omitempty"`
}

type ECOUT

type ECOUT struct {
	DescriptorReferredTo *DescriptorReferredTo `json:",omitempty"`
}

type EntryCombination

type EntryCombination struct {
	ECIN  ECIN  `json:",omitempty"`
	ECOUT ECOUT `json:",omitempty"`
}

type EntryCombinationList

type EntryCombinationList struct {
	EntryCombination []EntryCombination `json:",omitempty"`
}

type HeadingMappedTo

type HeadingMappedTo struct {
	DescriptorReferredTo *DescriptorReferredTo `json:",omitempty"`
}

type HeadingMappedToList

type HeadingMappedToList struct {
	HeadingMappedTo []HeadingMappedTo `json:",omitempty"`
}

type IdEntry

type IdEntry struct {
	Id    string
	Url   string
	Label string `json:",omitempty"`
}

type IndexingInformation

type IndexingInformation struct {
	DescriptorReferredTo *DescriptorReferredTo `json:",omitempty"`
}

type IndexingInformationList

type IndexingInformationList struct {
	IndexingInformation []IndexingInformation `json:",omitempty"`
}

type Node

type Node struct {
	TreeNumber     string            `json:"treeNumber`
	NodeNumber     string            `json:"-"`
	Name           string            `json:",omitempty"`
	Children       []IdEntry         `json:",omitempty"`
	ChildrenMap    map[string]*Node  `json:"-"`
	AllDescriptors map[string]bool   `json:"-"`
	DescriptorUrl  string            `json:",omitempty"`
	Descriptor     *DescriptorRecord `json:"-"`
}

func MakeTree

func MakeTree(m map[string]*DescriptorRecord) (root *Node)

func (*Node) Init

func (node *Node) Init() *Node

func (*Node) Traverse

func (node *Node) Traverse(depth int, nodeUser useNode)

type PharmacologicalAction

type PharmacologicalAction struct {
	DescriptorReferredTo               *DescriptorReferredTo              `json:",omitempty"`
	PharmacologicalActionSubstanceList PharmacologicalActionSubstanceList `json:",omitempty"`
}

type PharmacologicalActionList

type PharmacologicalActionList struct {
	PharmacologicalAction []PharmacologicalAction `json:",omitempty"`
}

type PharmacologicalActionSet

type PharmacologicalActionSet struct {
	PharmacologicalAction []PharmacologicalAction
}

type PharmacologicalActionSubstanceList

type PharmacologicalActionSubstanceList struct {
	Substance []Substance `json:",omitempty"`
}

type PreviousIndexingList

type PreviousIndexingList struct {
	PreviousIndexing []string `json:",omitempty"`
}

type QualifierRecord

type QualifierRecord struct {
	QualifierUI           string                `json:",omitempty"`
	QualifierName         string                `xml:"QualifierName>String" json:",omitempty"`
	DateCreated           Date                  `json:",omitempty"`
	DateRevised           Date                  `json:",omitempty"`
	DateEstablished       Date                  `json:",omitempty"`
	ActiveMeSHYearList    []string              `xml:">Year" json:",omitempty"`
	Annotation            string                `json:",omitempty"`
	HistoryNote           string                `json:",omitempty"`
	OnlineNote            string                `json:",omitempty"`
	TreeNumberList        TreeNumberList        `json:",omitempty"`
	TreeNodeAllowedList   TreeNodeAllowedList   `json:",omitempty"`
	RecordOriginatorsList RecordOriginatorsList `json:",omitempty"`
	ConceptList           ConceptList           `json:",omitempty"`
}

type QualifierRecordSet

type QualifierRecordSet struct {
	QualifierRecord []*QualifierRecord
}

type QualifierReferredTo

type QualifierReferredTo struct {
	QualifierUI     string
	QualifierName   string           `xml:"QualifierName>String"`
	QualifierRecord *QualifierRecord `xml:"-" json:",omitempty"`
	Url             string           `json:",omitempty"`
}

type Record

type Record interface {
	// contains filtered or unexported methods
}

type RecordOriginator

type RecordOriginator struct {
	RecordOriginator string `json:",omitempty"`
	RecordMaintainer string `json:",omitempty"`
	RecordAuthorizer string `json:",omitempty"`
}

type RecordOriginatorsList

type RecordOriginatorsList struct {
	RecordOriginator []RecordOriginator `json:",omitempty"`
}

type RelatedRegistryNumber

type RelatedRegistryNumber struct {
	RelatedRegistryNumber string `xml:",chardata"`
}

type RelatedRegistryNumberList

type RelatedRegistryNumberList struct {
	RelatedRegistryNumber []RelatedRegistryNumber `json:",omitempty"`
}

type SeeRelatedDescriptor

type SeeRelatedDescriptor struct {
	DescriptorReferredTo *DescriptorReferredTo `json:",omitempty"`
}

type SeeRelatedList

type SeeRelatedList struct {
	SeeRelatedDescriptor []SeeRelatedDescriptor `json:",omitempty"`
}

type SemanticType

type SemanticType struct {
	SemanticTypeUI   string `json:",omitempty"`
	SemanticTypeName string `json:",omitempty"`
}

type SemanticTypeList

type SemanticTypeList struct {
	SemanticType []SemanticType `json:",omitempty"`
}

type Source

type Source struct {
	Source string `json:",omitempty"`
}

type SourceList

type SourceList struct {
	Source []Source `json:",omitempty"`
}

type Substance

type Substance struct {
	RecordUI        string
	DescriptorUrl   string `json:",omitempty"`
	SupplementalUrl string `json:",omitempty"`
	RecordName      string `xml:"RecordName>String" json:",omitempty"`
}

type SupplementalRecord

type SupplementalRecord struct {
	SupplementalRecordUI    string                  `json:",omitempty"`
	SupplementalRecordName  string                  `xml:"SupplementalRecordName>String" json:",omitempty"`
	DateCreated             Date                    `json:",omitempty"`
	DateEstablished         Date                    `json:",omitempty"`
	DateRevised             Date                    `json:",omitempty"`
	ActiveMeSHYearList      []string                `xml:">Year" json:",omitempty"`
	Note                    string                  `json:",omitempty"`
	Frequency               string                  `json:",omitempty"`
	HeadingMappedToList     HeadingMappedToList     `json:",omitempty"`
	IndexingInformationList IndexingInformationList `json:",omitempty"`
	SourceList              SourceList              `json:",omitempty"`
	RecordOriginatorsList   RecordOriginatorsList   `json:",omitempty"`
	ConceptList             ConceptList             `json:",omitempty"`
}

type SupplementalRecordSet

type SupplementalRecordSet struct {
	SupplementalRecord []SupplementalRecord
}

type Term

type Term struct {
	Abbreviation           string          `json:",omitempty"`
	ConceptPreferredTermYN string          `xml:",attr"`
	DateCreated            Date            `json:",omitempty"`
	EntryVersion           string          `json:",omitempty"`
	IsPermutedTermYN       string          `xml:",attr" json:",omitempty"`
	LexicalTag             string          `xml:",attr" json:",omitempty"`
	PrintFlagYN            string          `xml:",attr" json:",omitempty"`
	RecordPreferredTermYN  string          `xml:",attr" json:",omitempty"`
	SortVersion            string          `json:",omitempty"`
	String                 string          `json:",omitempty"`
	TermNote               string          `json:",omitempty"`
	TermUI                 string          `json:",omitempty"`
	ThesaurusIDlist        ThesaurusIDlist `json:",omitempty"`
}

type TermList

type TermList struct {
	Term []Term `json:",omitempty"`
}

type ThesaurusIDlist

type ThesaurusIDlist struct {
	ThesaurusID []string `json:",omitempty"`
}

type TreeNodeAllowed

type TreeNodeAllowed struct {
	TreeNodeAllowed string `xml:",chardata" json:",omitempty"`
}

type TreeNodeAllowedList

type TreeNodeAllowedList struct {
	TreeNodeAllowed []TreeNodeAllowed `json:",omitempty"`
}

type TreeNumber

type TreeNumber struct {
	TreeNumber string `xml:",chardata"`
	Url        string `json:",omitempty"`
}

type TreeNumberList

type TreeNumberList struct {
	TreeNumber []TreeNumber `json:",omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL