{"id":37,"date":"2013-09-01T22:49:39","date_gmt":"2013-09-01T22:49:39","guid":{"rendered":"http:\/\/garydubois.com\/2-4units\/?p=37"},"modified":"2013-09-01T22:49:39","modified_gmt":"2013-09-01T22:49:39","slug":"uploading-references-as-structured-data","status":"publish","type":"post","link":"https:\/\/garydubois.com\/2-4units\/section\/uploading-references-as-structured-data\/","title":{"rendered":"Uploading References as Structured Data"},"content":{"rendered":"<p>I&#8217;ve decided that I will turn much of my immediate attention to references first. This is in part because I hope to insert links to &#8220;Reference Pages&#8221; (similar to Attachment Pages in concept) in the place of citations and footnotes references.<\/p>\n<p>As mentioned in an earlier\u00a0post,\u00a0<a href=\"wanderingacademic.com\/how-to-write-a-paper-using-evernote\/\u200e\" target=\"_blank\">Wandering Academic<\/a>\u00a0that suggested creating a post for each reference. This great because it treats each reference as a discrete entity of the website&#8217;s organizational structure, allowing it to be\u00a0featured in several ways. A site user could sort through\u00a0all the references that talk about the history of Woodlawn.<\/p>\n<p>The puzzle I face, however, with this section is how to convert my references\u00a0in\u00a0Zotero into individual posts with as little effort as possible.<\/p>\n<p><strong>Structured Data to Evernote<\/strong><\/p>\n<p>Originally, I primarily explored the idea of standardizing bibliographic entries, in technical terms inserting &#8220;structured data&#8221; into Evernote. Looking for a solution, I uncovered KustomNote, which provides a add-on to Evernote that can data collected in forms. A promising approach, yet there were three drawbacks. First, because I could not seem to find a way of inputting spreadsheet data into this software, it would require\u00a0manual entry of\u00a0all of my bibliographic entries. Second, closely related, there seemed to be no database that maintained the data entered, which would allow<\/p>\n<div id=\"attachment_45\" style=\"width: 310px\" class=\"wp-caption alignleft\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-45\" data-attachment-id=\"45\" data-permalink=\"https:\/\/garydubois.com\/2-4units\/section\/uploading-references-as-structured-data\/kustomnote_example\/\" data-orig-file=\"https:\/\/garydubois.com\/2-4units\/files\/kustomnote_example.png\" data-orig-size=\"702,459\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}\" data-image-title=\"KustomNote Example\" data-image-description=\"\" data-image-caption=\"&lt;p&gt;Most minimal format for KustomNote&amp;#8217;s Entries&lt;\/p&gt;\n\" data-medium-file=\"https:\/\/garydubois.com\/2-4units\/files\/kustomnote_example-300x196.png\" data-large-file=\"https:\/\/garydubois.com\/2-4units\/files\/kustomnote_example.png\" class=\"size-medium wp-image-45\" alt=\"Most minimal format for KustomNote's Entries\" src=\"https:\/\/garydubois.com\/2-4units\/files\/kustomnote_example-300x196.png\" width=\"300\" height=\"196\" srcset=\"https:\/\/garydubois.com\/2-4units\/files\/kustomnote_example-300x196.png 300w, https:\/\/garydubois.com\/2-4units\/files\/kustomnote_example-458x300.png 458w, https:\/\/garydubois.com\/2-4units\/files\/kustomnote_example.png 702w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><p id=\"caption-attachment-45\" class=\"wp-caption-text\">Most minimalist format for KustomNote&#8217;s Entries<\/p><\/div>\n<p>changes and updates. Third, I also didn&#8217;t like that I could not change any of the formatting of the posts. The most minimalist form was still pretty space inefficient.<\/p>\n<p>As a result, I kept looking for a solution.<\/p>\n<p><strong>Excel Mail Merge Catalog and\u00a0Applescript Parsing<\/strong><\/p>\n<p>The next solution was much more technical. I realized that if I could create one document with all the content (something I knew I could do from mail merge and used in analyzing my interview data) I could try to find an Apple Automator approach to splitting up this text into additional documents. I&#8217;d started using Automator recently when I learned it could change file names for a lot of pictures.<\/p>\n<p>Turns out that AppleScript was the better tool for this, but fortunately, I was able to find a forum that <a href=\"https:\/\/discussions.apple.com\/thread\/3101256?start=0&amp;tstart=0\" target=\"_blank\">provided code to split text documents up\u00a0based on a user-specified delimiter<\/a>. By making a few\u00a0modifications to the code, it worked on the first try and split up a text document generated from a Mail Merge into 3 files. I won&#8217;t describe Mail Merge function in detail here, but basically it takes an Excel document (a database) and lets you put placeholders for a column in the manner as a form letter and then goes down each row, inputting the data for that row where you see placeholders and repeating the same text with customized data. By putting &#8220;End Source&#8221; at the bottom of each set of placeholders in Mail Merge and as my delimiter in the code below, I can run the code below in Automator and it splits a text document into multiple documents in a folder of choosing. It may be possible to have it pluck a title from the file (ideally would be &#8220;Author &#8211; Title&#8221;), but for the 5-10 minutes it took to find and modify this code&#8230;I figured I&#8217;d quit while I was ahead!<\/p>\n<p>The code (green underline indicates the marker for splitting documents up and the name of the resulting documents):<\/p>\n<pre>set f to choose file with prompt \"Choose the file to parse.\"\r\nset fold to (choose folder with prompt \"Choose a folder to store the files in.\") as text\r\n\r\ntell application \"Finder\"\r\n\tset fName to name of f\r\nend tell\r\n\r\nset fp to open for access f\r\nset bigText to read fp\r\nclose access fp\r\n\r\nset parsingText to \"<span style=\"text-decoration: underline;\"><span style=\"color: #00ff00; text-decoration: underline;\">End Source<\/span><\/span>\"\r\nset parsedList to tid(bigText, parsingText)\r\nrepeat with i from 1 to count of parsedList\r\n\tset newFName to \"<span style=\"text-decoration: underline;\"><span style=\"color: #00ff00; text-decoration: underline;\">Source_Summary_<\/span><\/span>\" &amp; i\r\n\tset fp to open for access (fold &amp; newFName) with write permission\r\n\t-- uncomment the following line if you need to overwrite old files, otherwise it will append\r\n\t-- set EOF of fp to 0\r\n\twrite ((item i of parsedList &amp; parsingText) as text) to fp\r\n\tclose access fp\r\nend repeat\r\n\r\non tid(input, delim)\r\n\t-- a subroutine to handle text item delimiters. Useful tool, but so danged wordy.--\r\n\tset {oldTID, my text item delimiters} to {my text item delimiters, delim}\r\n\tif class of input is list then\r\n\t\tset output to input as text\r\n\telse\r\n\t\tset output to text items of input\r\n\tend if\r\n\tset my text item delimiters to oldTID\r\n\treturn output\r\nend tid<span class=\"Apple-style-span\" style=\"font-weight: 300; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 15px; line-height: 24px; white-space: normal;\"><code>\u00a0<\/code><\/span><\/pre>\n<p><strong>Remaining Question: Conversion of Zotero to Excel or Comma Separated File<\/strong><\/p>\n<p>The remaining step is to figure out how to export my Zotero data to spreadsheet form. I figured this was the simplest step (in terms of accessibility of a work-around), and indeed the first link in a Google Search gives instruction for using Firefox&#8217;s SQLite Manager to run a SQL query on my Zotero database and return a CSV of the data. When I look at such a task and consider it straightforward, I can only be grateful for the role that data has in MIT&#8217;s planning program and, in particular, Joe Ferreira for schooling me on SQL and relational database management in <a href=\"http:\/\/web.mit.edu\/11.521\/\" target=\"_blank\">11.521<\/a>.<\/p>\n<p><strong>How it All Fits Together<\/strong><\/p>\n<p>This summarizes how this will work together:<\/p>\n<ul>\n<li>Export Zotero Database as CSV<\/li>\n<li>Save CSV in Excel<\/li>\n<li>Create a Mail Merge in Word that uses the Zotero database.<\/li>\n<li>Create Template approximating the following:\n<ul>\n<li><strong>Author<\/strong>: &lt;&lt;author-field&gt;&gt;<\/li>\n<li><strong>Title<\/strong>: &lt;&lt;title-field&gt;&gt;<\/li>\n<li><strong>Cited in Thesis<\/strong><\/li>\n<li><strong>Bibliography<\/strong><\/li>\n<li>End Source<\/li>\n<\/ul>\n<\/li>\n<li>Generate new document from Mail Merge Template and\u00a0save it as a .TXT or .RTF<\/li>\n<li>Run Applescript tool to split it up into one file per Bibliographic entry<\/li>\n<li>Import references into Evernote, specifically into References Notebook<\/li>\n<li>Appropriately tag each reference to reflect\u00a0the topics addressed (though will probably have to\u00a0be repeated in WordPress)<\/li>\n<li>Export Notes into HTML<\/li>\n<li>Import into WordPress<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve decided that I will turn much of my immediate attention to references first. This is in part because I hope to insert links to &#8220;Reference Pages&#8221; (similar to Attachment Pages in concept) in the place of citations and footnotes &hellip; <a href=\"https:\/\/garydubois.com\/2-4units\/section\/uploading-references-as-structured-data\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[10],"tags":[11,12],"class_list":["post-37","post","type-post","status-publish","format-standard","hentry","category-updates","tag-evernote","tag-execution"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/garydubois.com\/2-4units\/wp-json\/wp\/v2\/posts\/37","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/garydubois.com\/2-4units\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/garydubois.com\/2-4units\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/garydubois.com\/2-4units\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/garydubois.com\/2-4units\/wp-json\/wp\/v2\/comments?post=37"}],"version-history":[{"count":5,"href":"https:\/\/garydubois.com\/2-4units\/wp-json\/wp\/v2\/posts\/37\/revisions"}],"predecessor-version":[{"id":48,"href":"https:\/\/garydubois.com\/2-4units\/wp-json\/wp\/v2\/posts\/37\/revisions\/48"}],"wp:attachment":[{"href":"https:\/\/garydubois.com\/2-4units\/wp-json\/wp\/v2\/media?parent=37"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/garydubois.com\/2-4units\/wp-json\/wp\/v2\/categories?post=37"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/garydubois.com\/2-4units\/wp-json\/wp\/v2\/tags?post=37"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}