{"id":18723778,"url":"https://github.com/hscells/transmute","last_synced_at":"2025-04-12T15:20:25.675Z","repository":{"id":90190275,"uuid":"93369269","full_name":"hscells/transmute","owner":"hscells","description":"PubMed/Medline query transpiler","archived":false,"fork":false,"pushed_at":"2019-12-26T01:16:56.000Z","size":836,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-26T09:51:12.307Z","etag":null,"topics":["medline","medline-parser","pubmed","pubmed-parser","systematic-reviews"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/hscells/transmute","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hscells.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-05T05:46:12.000Z","updated_at":"2023-09-20T20:43:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"dfb14412-4a69-4bbb-b2d0-c193148248ce","html_url":"https://github.com/hscells/transmute","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hscells%2Ftransmute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hscells%2Ftransmute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hscells%2Ftransmute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hscells%2Ftransmute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hscells","download_url":"https://codeload.github.com/hscells/transmute/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248586218,"owners_count":21128998,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["medline","medline-parser","pubmed","pubmed-parser","systematic-reviews"],"created_at":"2024-11-07T13:51:35.397Z","updated_at":"2025-04-12T15:20:25.653Z","avatar_url":"https://github.com/hscells.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg height=\"200px\" src=\"gopher.png\" alt=\"gopher\" align=\"right\"/\u003e\n\n# transmute\n\n[![GoDoc](https://godoc.org/github.com/hscells/transmute?status.svg)](https://godoc.org/github.com/hscells/transmute)\n[![Go Report Card](https://goreportcard.com/badge/github.com/hscells/transmute)](https://goreportcard.com/report/github.com/hscells/transmute)\n[![gocover](http://gocover.io/_badge/github.com/hscells/transmute)](https://gocover.io/github.com/hscells/transmute)\n\n_PubMed/Medline Query Transpiler_\n\nThe goal of transmute is to provide a way of transforming PubMed/Medline search strategies from systematic reviews into\nother queries suitable for other search engines. The result of the transformation is an _immediate representation_ which\ncan be analysed with greater ease or transformed again run on other search engines. This is why transmute is described\nas a _transpiler_. An immediate representation allows trivial transformation to boolean queries acceptable by search\nengines, such as Elasticsearch.\n\nAn example of a Medline and Pubmed query are:\n \n```\n1. MMSE*.ti,ab.\n2. sMMSE.ti,ab.\n3. Folstein*.ti,ab.\n4. MiniMental.ti,ab.\n5. \\\"mini mental stat*\\\".ti,ab.\n6. or/1-5\n```\n\n```\n(\\\"Contraceptive Agents, Female\\\"[Mesh] OR \\\"Contraceptive Devices, Female\\\"[Mesh] OR contracept*[tiab]) AND (\\\"Body Weight\\\"[Mesh] OR weight[tiab] OR \\\"Body Mass Index\\\"[Mesh]) NOT (cancer*[ti] OR polycystic [ti] OR exercise [ti] OR physical activity[ti] OR postmenopaus*[ti])\n```\n\nBoth are valid Pubmed and Medline search strategies reported in real systematic reviews; transmute can currently\ntransform both Medline and PubMed queries. An example API usage by constructing a pipeline and executing it is shown in\nthe next section.\n\n## API Usage\n\nHere we construct a pipeline in Go:\n\n```go\nquery := `1. MMSE*.ti,ab.\n2. sMMSE.ti,ab.\n3. Folstein*.ti,ab.\n4. MiniMental.ti,ab.\n5. \\\"mini mental stat*\\\".ti,ab.\n6. or/1-5`\n\np := transmute.pipeline.NewPipeline(transmute.parser.NewMedlineParser(),\n                                    transmute.backend.NewElasticsearchCompiler(),\n                                    transmute.pipeline.TransmutePipelineOptions{RequiresLexing: true})\ndsl, err := p.Execute(query)\nif err != nil {\n    panic(err)\n}\n\nprintln(dsl.StringPretty())\n```\n\nWhich results in:\n\n```json\n{\n    \"query\": {\n        \"bool\": {\n            \"disable_coord\": true,\n            \"should\": [\n                {\n                    \"bool\": {\n                        \"should\": [\n                            {\n                                \"wildcard\": {\n                                    \"title\": \"MMSE*\"\n                                }\n                            },\n                            {\n                                \"wildcard\": {\n                                    \"abstract\": \"MMSE*\"\n                                }\n                            }\n                        ]\n                    }\n                },\n                {\n                    \"multi_match\": {\n                        \"fields\": [\n                            \"title\",\n                            \"abstract\"\n                        ],\n                        \"query\": \"sMMSE\"\n                    }\n                },\n                {\n                    \"bool\": {\n                        \"should\": [\n                            {\n                                \"wildcard\": {\n                                    \"title\": \"Folstein*\"\n                                }\n                            },\n                            {\n                                \"wildcard\": {\n                                    \"abstract\": \"Folstein*\"\n                                }\n                            }\n                        ]\n                    }\n                },\n                {\n                    \"multi_match\": {\n                        \"fields\": [\n                            \"title\",\n                            \"abstract\"\n                        ],\n                        \"query\": \"MiniMental\"\n                    }\n                },\n                {\n                    \"bool\": {\n                        \"should\": [\n                            {\n                                \"wildcard\": {\n                                    \"title\": \"\\\"mini mental stat*\\\"\"\n                                }\n                            },\n                            {\n                                \"wildcard\": {\n                                    \"abstract\": \"\\\"mini mental stat*\\\"\"\n                                }\n                            }\n                        ]\n                    }\n                }\n            ]\n        }\n    }\n}\n```\n\n## Command Line Usage\n\nAs well as being a well-documented library, transmute can also be used on the command line. Since it is still in\ndevelopment, it can be built from source with go tools:\n\n```bash\ngo get -u github.com/hscells/transmute/cmd/transmute\ntransmute --help\ntransmute --input mmse.query --parser medline --backend elasticsearch\n```\n\nThe output of the command line pretty-prints the same output from above.\n\n## Assumptions\n\nThe goal of transmute is to parse and transform PubMed/Medline queries into queries suitable for other search engines.\nHowever, the project makes some assumptions about the query:\n\n  - The parser does not attempt to simplify boolean expressions, so badly written queries will remain inefficient.\n  - A query cannot compile to Elasticsearch when it contains an adjacency operator with more than one field. This is\n  due to a limitation with Elasticsearch.\n  \n## Extending\n\nIf you would like to extend transmute and create a new backend for it, have a read of the \n[documentation](https://godoc.org/github.com/hscells/transmute/backend#Backend). As this should lead you in the right\ndirection. Writing a new backend requires the transformation of the immediate representation into the target query\nlanguage.\n\n## Citing\n\nIf you use this work for scientific publication, please reference\n\n```\n@inproceedings{scells2018framework,\n author = {Scells, Harrisen and Locke, Daniel and Zuccon, Guido},\n title = {An Information Retrieval Experiment Framework for Domain Specific Applications},\n booktitle = {The 41st International ACM SIGIR Conference on Research \\\u0026 Development in Information Retrieval},\n series = {SIGIR '18},\n year = {2018},\n} \n```\n\n## Logo\n\nThe Go gopher was created by [Renee French](https://reneefrench.blogspot.com/), licensed under\n[Creative Commons 3.0 Attributions license](https://creativecommons.org/licenses/by/3.0/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhscells%2Ftransmute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhscells%2Ftransmute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhscells%2Ftransmute/lists"}