{"id":710,"date":"2023-09-25T17:00:33","date_gmt":"2023-09-25T16:00:33","guid":{"rendered":"http:\/\/blog.magnusmanske.de\/?p=710"},"modified":"2023-09-25T17:00:33","modified_gmt":"2023-09-25T16:00:33","slug":"get-into-the-flow","status":"publish","type":"post","link":"http:\/\/magnusmanske.de\/wordpress\/archives\/710","title":{"rendered":"Get into the Flow"},"content":{"rendered":"<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Unix_philosophy\">Unix philosophy<\/a> contains the notion that each program should perform an single function (and perform that function exceptionally well), and then be used together with other single-function programs to form a powerful &#8220;toolbox&#8221;, with tools connected via the geek-famous pipe (&#8220;|&#8221;).<\/p>\n<div id=\"attachment_711\" style=\"width: 310px\" class=\"wp-caption alignright\"><a href=\"http:\/\/magnusmanske.de\/wordpress\/wp-content\/uploads\/2023\/09\/ToolFlow-screenshot.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-711\" class=\"wp-image-711 size-medium\" src=\"http:\/\/magnusmanske.de\/wordpress\/wp-content\/uploads\/2023\/09\/ToolFlow-screenshot-300x276.png\" alt=\"\" width=\"300\" height=\"276\" srcset=\"http:\/\/magnusmanske.de\/wordpress\/wp-content\/uploads\/2023\/09\/ToolFlow-screenshot-300x276.png 300w, http:\/\/magnusmanske.de\/wordpress\/wp-content\/uploads\/2023\/09\/ToolFlow-screenshot-1024x942.png 1024w, http:\/\/magnusmanske.de\/wordpress\/wp-content\/uploads\/2023\/09\/ToolFlow-screenshot-768x707.png 768w, http:\/\/magnusmanske.de\/wordpress\/wp-content\/uploads\/2023\/09\/ToolFlow-screenshot.png 1214w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><p id=\"caption-attachment-711\" class=\"wp-caption-text\">A ToolFlow workflow, filtering and re-joining data rows<\/p><\/div>\n<p>The Wikimedia ecosystem has lots of tools that perform a specific function, but there is little in terms of interconnection between them. Some tool prorammers have added other tools as (optional) inputs (eg PetScan) or outputs (eg PagePile), but that is the extend of it. There is <a href=\"https:\/\/wikitech.wikimedia.org\/wiki\/PAWS\">PAWS<\/a>, a Wikimedia-centric Jupyter notebook, but it does require a certain amount of coding, which excludes many volunteers.<\/p>\n<p>So I finally got around to implementing the &#8220;missing pipe system&#8221; for Wikimedia tools, which I call <strong><a href=\"https:\/\/toolflow.toolforge.org\">ToolFlow<\/a><\/strong>. I also started a <a href=\"https:\/\/meta.wikimedia.org\/wiki\/ToolFlow\">help page<\/a> explaining some concepts. The basic idea is that a user can create a new workflow (or fork an existing one). A workflow would usually start with one or more <em>adapters<\/em> that represent the output of some tool (eg <a href=\"https:\/\/petscan.wmflabs.org\/\">PetScan<\/a>, <a href=\"https:\/\/query.wikidata.org\/\">SPARQL<\/a> query, <a href=\"https:\/\/quarry.wmcloud.org\/\">Quarry<\/a>) for a specific query. The adapter queries the tool, and represents the tool output in a standardized internal format (JSONL) that is written into a file on the server. These files can then be filtered and combined to form sub- and supersets. Intermediate files will be cleaned up automatically, but the output of steps (ie nodes) that have no further steps after them is kept, and can only be cleared by re-running the entire workflow run. Output can also be exported via a <em>generator<\/em>; at the moment, the only generator is a Wikipage editor, which will create a Wikitext table on a Wiki page of your choice from an output file.<\/p>\n<p>Only the owner (=creator) of a workflow can edit or run it, but the owner can also set a scheduler (think UNIX <em>cronjob<\/em>) for the workflow to be run regularly every day, week, or month. ToolFlow remembers your OAuth details, so it can edit wiki pages regularly, updating a wikitext table with the current results of your workflow.<\/p>\n<p>I have created some demo workflows:<\/p>\n<ul>\n<li><a class=\"\" href=\"https:\/\/toolflow.toolforge.org\/#\/workflow\/1\">Taxon categories without main image<\/a> combines Quarry and SPARQL results to suggest Commons image categories for Wikidata items without image.<\/li>\n<li><a class=\"\" href=\"https:\/\/toolflow.toolforge.org\/#\/workflow\/7\">Images of female scientists<\/a> runs WD-FIST to find images for Wikidata items of female scientists, and writes the result as a <a href=\"https:\/\/www.wikidata.org\/wiki\/User:Magnus_Manske\/ToolFlow_test\">Wikitext table<\/a> once a day.<\/li>\n<\/ul>\n<p>Now, this is a very complex software, spanning two code repoitories (<a href=\"https:\/\/github.com\/magnusmanske\/toolflow\">one<\/a> for the HTML\/JS\/PHP front-end, and <a href=\"https:\/\/github.com\/magnusmanske\/toolflow_rs\/\">one<\/a> for the Rust back-end). Many things can go wrong here, and many tools, filters etc can be added. Please use the issue trackers for problems and suggestions. I would especially like some more suggestions for tools to use as input. And despite my best efforts, the interface is still somewhat complicated to understand, so please feel free to improve the help page.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unix philosophy contains the notion that each program should perform an single function (and perform that function exceptionally well), and then be used together with other single-function programs to form a powerful &#8220;toolbox&#8221;, with tools connected via the geek-famous pipe (&#8220;|&#8221;). The Wikimedia ecosystem has lots of tools that perform a specific function, but there [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,7],"tags":[],"class_list":["post-710","post","type-post","status-publish","format-standard","hentry","category-rust","category-wikimedia-2"],"_links":{"self":[{"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/posts\/710","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/comments?post=710"}],"version-history":[{"count":2,"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/posts\/710\/revisions"}],"predecessor-version":[{"id":713,"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/posts\/710\/revisions\/713"}],"wp:attachment":[{"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/media?parent=710"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/categories?post=710"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/magnusmanske.de\/wordpress\/wp-json\/wp\/v2\/tags?post=710"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}