Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • JSON transformation - difficulty to create regular expression

    I do have a lots of bibliographic information from Crossref that I would like to transform into Stata. I am struggling at a lot of corners - and hope that someone has a good trick to go ahead.
    In the following code line I place an example of the data I am dealing with:

    Code:
    {"subtitle":[],"subject":["Histology"],"issued":{"date-parts":[[2006]]},"score":1,"prefix":"http://id.crossref.org/prefix/10.1679","author":[{"family":"Katoh","given":"Yoshimitsu Y"},{"family":"Yamazaki","given":"Eriko"},{"family":"Taniguti","given":"Kanako"},{"family":"Yamada","given":"Keiki"},{"family":"Isomura","given":"Genzoh"}],"container-title":["Archives of Histology and Cytology","Arch. Histol. Cytol."],"reference-count":20,"page":"129-134","deposited":{"date-parts":[[2007,2,13]],"timestamp":1171324800000},"issue":"2","title":["Light and electron microscopic observation of intracytoplasmic inclusion bodies in the locus coeruleus of the hamster"],"type":"journal-article","DOI":"10.1679/aohc.69.129","ISSN":["0914-9465","1349-1717"],"URL":"http://dx.doi.org/10.1679/aohc.69.129","source":"CrossRef","publisher":"International Society of Histology & Cytology","indexed":{"date-parts":[[2014,5,12]],"timestamp":1399876237366},"volume":"69","member":"http://id.crossref.org/member/683"}
    If I inspect the data with -insheetjson- (from ssc) showresponse, there is no problem with the data - but I struggle to get insheetjson to write the data into Stata. I created a workaround with the log file:

    Code:
    set linesize 255
    qui log using data\jsonlog.txt, t name(json_parsed) replace
    insheetjson using "data\json-parsed.txt", flatten showresponse
    qui log close kmw_parsed
    infix str line 1-255 using "data\jsonlog.txt", clear
    drop if _n==_N
    drop in 1/3
    But it restricts the field size to 255 which is leading to quite few errors.

    I tried -jsonio- (from ssc) but I get strange java errors I cannot deal with.

    So my next try is to use - moss- (from ssc). It works like a charm. see

    Code:
    moss line, match(`"source":"([A-Za-z]+)""') regex unicode prefix(source)
    moss line, match(`"issued":\{"date-parts":\[\[([0-9]+)\]\]\}"') regex unicode prefix(year)
    moss line, match(`"subject":\["([a-zA-Z,()"]+)"\]"') regex unicode prefix(subject)
    But I do struggle with the -author- field which is this part:
    Code:
    "author":[{"family":"Katoh","given":"Yoshimitsu Y"},{"family":"Yamazaki","given":"Eriko"},{"family":"Taniguti","given":"Kanako"},{"family":"Yamada","given":"Keiki"},{"family":"Isomura","given":"Genzoh"}]
    My try to solve it is this:
    Code:
    moss line, match(`"author":\[\{"([a-zA-Z",:\}]+)\]\}"') regex unicode prefix(author)
    But I do not get any result extracted. Has anyone an idea how to create a regular expression to solve this?
    I read the FAQ https://www.stata.com/support/faqs/d...ons/index.html but struggle to apply it to the given string...

  • #2
    Issue is partly resolved as I got around the 255 linesize boundary: I logged -insheetjson- with smcl and read the log into Stata. This works well.
    Nonetheless, I still wonder how to construct the regular expression correctly...

    Comment


    • #3
      Today there was a link to this topic posted on another topic. This seems to be my week of thinking about JSON, about which I know very little, so I with the excellent example data provided by Marc Kaulisch I've taught myself how to use insheetjson to read this one observation of a relatively complicated data structure. There's much more to be done, but this demonstrates how to identify the possible "flattened selectors" associated with a single line of JSON, and then use them to read that line in. It's a start.

      First steps.
      Code:
      type "another.json"
      insheetjson using "another.json", showresponse
      insheetjson using "another.json", showresponse flatten
      which yield the following output.
      Code:
      . type "another.json"
      {"subtitle":[],"subject":["Histology"],"issued":{"date-parts":[[2006]]},"score":1,"prefix":"htt
      > p://id.crossref.org/prefix/10.1679","author":[{"family":"Katoh","given":"Yoshimitsu Y"},{"fam
      > ily":"Yamazaki","given":"Eriko"},{"family":"Taniguti","given":"Kanako"},{"family":"Yamada","g
      > iven":"Keiki"},{"family":"Isomura","given":"Genzoh"}],"container-title":["Archives of Histolo
      > gy and Cytology","Arch. Histol. Cytol."],"reference-count":20,"page":"129-134","deposited":{"
      > date-parts":[[2007,2,13]],"timestamp":1171324800000},"issue":"2","title":["Light and electron
      >  microscopic observation of intracytoplasmic inclusion bodies in the locus coeruleus of the h
      > amster"],"type":"journal-article","DOI":"10.1679/aohc.69.129","ISSN":["0914-9465","1349-1717"
      > ],"URL":"http://dx.doi.org/10.1679/aohc.69.129","source":"CrossRef","publisher":"Internationa
      > l Society of Histology & Cytology","indexed":{"date-parts":[[2014,5,12]],"timestamp":13998762
      > 37366},"volume":"69","member":"http://id.crossref.org/member/683"}
      
      . insheetjson using "another.json", showresponse
      Response from server:
      {
       "subtitle" :,
       "subject" :
        [
         "Histology"
        ],
       "issued" :
        {
         "date-parts" :
          [
           [
            "2006"
           ]
          ]
        },
       "score" : "1",
       "prefix" : "http://id.crossref.org/prefix/10.1679",
       "author" :
        [
         {
          "family" : "Katoh",
          "given" : "Yoshimitsu Y"
         },
         {
          "family" : "Yamazaki",
          "given" : "Eriko"
         },
         {
          "family" : "Taniguti",
          "given" : "Kanako"
         },
         {
          "family" : "Yamada",
          "given" : "Keiki"
         },
         {
          "family" : "Isomura",
          "given" : "Genzoh"
         }
        ],
       "container-title" :
        [
         "Archives of Histology and Cytology",
         "Arch. Histol. Cytol."
        ],
       "reference-count" : "20",
       "page" : "129-134",
       "deposited" :
        {
         "date-parts" :
          [
           [
            "2007",
            "2",
            "13"
           ]
          ],
         "timestamp" : "1171324800000"
        },
       "issue" : "2",
       "title" :
        [
         "Light and electron microscopic observation of intracytoplasmic inclusion bodies in the locu
      > s coeruleus of the hamster"
        ],
       "type" : "journal-article",
       "DOI" : "10.1679/aohc.69.129",
       "ISSN" :
        [
         "0914-9465",
         "1349-1717"
        ],
       "URL" : "http://dx.doi.org/10.1679/aohc.69.129",
       "source" : "CrossRef",
       "publisher" : "International Society of Histology & Cytology",
       "indexed" :
        {
         "date-parts" :
          [
           [
            "2014",
            "5",
            "12"
           ]
          ],
         "timestamp" : "1399876237366"
        },
       "volume" : "69",
       "member" : "http://id.crossref.org/member/683"
      
      . insheetjson using "another.json", showresponse flatten
      Response from server:
              subject:1 = Histology
              issued:date-parts:1:1 = 2006
              score = 1
              prefix = http://id.crossref.org/prefix/10.1679
              author:1:family = Katoh
              author:1:given = Yoshimitsu Y
              author:2:family = Yamazaki
              author:2:given = Eriko
              author:3:family = Taniguti
              author:3:given = Kanako
              author:4:family = Yamada
              author:4:given = Keiki
              author:5:family = Isomura
              author:5:given = Genzoh
              container-title:1 = Archives of Histology and Cytology
              container-title:2 = Arch. Histol. Cytol.
              reference-count = 20
              page = 129-134
              deposited:date-parts:1:1 = 2007
              deposited:date-parts:1:2 = 2
              deposited:date-parts:1:3 = 13
              deposited:timestamp = 1171324800000
              issue = 2
              title:1 = Light and electron microscopic observation of intracytoplasmic inclusion bodi
      > es in the locus coeruleus of the hamster
              type = journal-article
              DOI = 10.1679/aohc.69.129
              ISSN:1 = 0914-9465
              ISSN:2 = 1349-1717
              URL = http://dx.doi.org/10.1679/aohc.69.129
              source = CrossRef
              publisher = International Society of Histology & Cytology
              indexed:date-parts:1:1 = 2014
              indexed:date-parts:1:2 = 5
              indexed:date-parts:1:3 = 12
              indexed:timestamp = 1399876237366
              volume = 69
              member = http://id.crossref.org/member/683
      This taught me how to identify the various data elements, and more to the point, gave me 37 examples to use to educate myself on the general principles.

      I copied and edited the output of the third command to create the local macro selectors in the code below. For the purposes of this exercise I chose very simple variable names to store the JSON data elements in.
      Code:
      #delimit ;
      local selectors 
          `"
          "subject:1"                
          "issued:date-parts:1:1"    
          "score"                    
          "prefix"                   
          "author:1:family"          
          "author:1:given"           
          "author:2:family"          
          "author:2:given"           
          "author:3:family"          
          "author:3:given"           
          "author:4:family"          
          "author:4:given"           
          "author:5:family"          
          "author:5:given"           
          "container-title:1"        
          "container-title:2"        
          "reference-count"          
          "page"                     
          "deposited:date-parts:1:1" 
          "deposited:date-parts:1:2" 
          "deposited:date-parts:1:3" 
          "deposited:timestamp"      
          "issue"                    
          "title:1"                  
          "type"                     
          "DOI"                      
          "ISSN:1"                   
          "ISSN:2"                   
          "URL"                      
          "source"                   
          "publisher"                
          "indexed:date-parts:1:1"   
          "indexed:date-parts:1:2"   
          "indexed:date-parts:1:3"   
          "indexed:timestamp"        
          "volume"                   
          "member"
          "'
      ;
      #delimit cr
      
      macro list _selectors
      
      local n 0
      foreach s of local selectors {
          generate str200 sel_`++n' = ""
          }
      
      insheetjson sel_* using another.json, columns(`selectors')
      list, noobs
      Code:
      . list, noobs
      
        +-------------------------------------------------------------------------------------------+
        |     sel_1 | sel_2 | sel_3 |                                 sel_4 | sel_5 |        sel_6  |
        | Histology |  2006 |     1 | http://id.crossref.org/prefix/10.1679 | Katoh | Yoshimitsu Y  |
        |-------------------------------------------------------------------------------------------|
        |     sel_7  |  sel_8  |     sel_9  |  sel_10  |  sel_11  |  sel_12  |   sel_13  |  sel_14  |
        |  Yamazaki  |  Eriko  |  Taniguti  |  Kanako  |  Yamada  |   Keiki  |  Isomura  |  Genzoh  |
        |-------------------------------------------------------------------------------------------|
        |                             sel_15 |               sel_16  | sel_17  |  sel_18  | sel_19  |
        | Archives of Histology and Cytology | Arch. Histol. Cytol.  |     20  | 129-134  |   2007  |
        |-------------------------------------------------------------------------------------------|
        |       sel_20       |       sel_21       |              sel_22       |       sel_23        |
        |            2       |           13       |       1171324800000       |            2        |
        |-------------------------------------------------------------------------------------------|
        | sel_24                                                                                    |
        | Light and electron microscopic observation of intracytoplasmic inclusion bodies in the .. |
        |-------------------------------------------------------------------------------------------|
        |             sel_25     |                 sel_26     |       sel_27     |       sel_28     |
        |    journal-article     |    10.1679/aohc.69.129     |    0914-9465     |    1349-1717     |
        |-------------------------------------------------------------------------------------------|
        |                                          sel_29           |             sel_30            |
        |           http://dx.doi.org/10.1679/aohc.69.129           |           CrossRef            |
        |-------------------------------------------------------------------------------------------|
        |                                        sel_31 | sel_32 | sel_33 | sel_34 |        sel_35  |
        | International Society of Histology & Cytology |   2014 |      5 |     12 | 1399876237366  |
        |-------------------------------------------------------------------------------------------|
        |            sel_36             |                                        sel_37             |
        |                69             |             http://id.crossref.org/member/683             |
        +-------------------------------------------------------------------------------------------+

      Comment


      • #4
        Assuming you have one record per "title", you may avoid using regex for parsing "author":
        Code:
        version 15
        clear
        
        input str1000 JSON
        `" {"subtitle":[],"subject":["Histology"],"issued":{"date-parts":[[2006]]},"score":1,"prefix":"http://id.crossref.org/prefix/10.1679","author":[{"family":"Katoh","given":"Yoshimitsu Y"},{"family":"Yamazaki","given":"Eriko"},{"family":"Taniguti","given":"Kanako"},{"family":"Yamada","given":"Keiki"},{"family":"Isomura","given":"Genzoh"}],"container-title":["Archives of Histology and Cytology","Arch. Histol. Cytol."],"reference-count":20,"page":"129-134","deposited":{"date-parts":[[2007,2,13]],"timestamp":1171324800000},"issue":"2","title":["Light and electron microscopic observation of intracytoplasmic inclusion bodies in the locus coeruleus of the hamster"],"type":"journal-article","DOI":"10.1679/aohc.69.129","ISSN":["0914-9465","1349-1717"],"URL":"http://dx.doi.org/10.1679/aohc.69.129","source":"CrossRef","publisher":"International Society of Histology & Cytology","indexed":{"date-parts":[[2014,5,12]],"timestamp":1399876237366},"volume":"69","member":"http://id.crossref.org/member/683"} "'
        end
        
        gen auth =  ustrregexs(1) if ustrregexm(JSON,`".\"author\":\[\{(.+?)\}\]."')
        
        replace auth  = subinstr(auth, `""family":"', "", .)            /* delete JSON key */
        replace auth  = subinstr(auth, `""given":"', "", .)             /* delete JSON key */
        replace auth  = subinstr(auth, `"""',"", .)                     /* delete double quotes */
        replace auth  = subinstr(auth, "},{"," ; ",.)                   /* redefine separator */
        replace auth  = subinstr(auth, `","',", ", .)                   /* add space after comma */ 
        replace auth  = trim(itrim(auth))     
        
        split auth  , gen(auth) parse(";")
        Code:
        . list auth  , noobs compress
        
          +--------------------------------------------------------------------------------------------+
          |                                                                                       auth |
          |--------------------------------------------------------------------------------------------|
          | Katoh, Yoshimitsu Y ; Yamazaki, Eriko ; Taniguti, Kanako ; Yamada, Keiki ; Isomura, Genzoh |
          +--------------------------------------------------------------------------------------------+
        
        . list auth? , noobs compress
        
          +----------------------------------------------------------------------------------------------------+
          |                auth1               auth2                auth3             auth4              auth5 |
          |----------------------------------------------------------------------------------------------------|
          | Katoh, Yoshimitsu Y     Yamazaki, Eriko     Taniguti, Kanako     Yamada, Keiki     Isomura, Genzoh |
          +----------------------------------------------------------------------------------------------------+

        Comment


        • #5
          At the moment my ugly workaround looks like:
          Code:
          set linesize 255
          qui log using data\cr_log_${shortid}.smcl, s name(cr_log_${shortid}) replace
          insheetjson using data\json_out2/${shortid}.json, flatten showresponse
          qui log close cr_log_${shortid}
          
          infix str line 1-2000 using data\cr_log_${shortid}.smcl, clear
          compress
          drop if substr(line,1,1) == "{"
          
          replace line = ustrtrim(line)
          
          clonevar line_r = line
          
          replace line_r = subinstr(line_r,":1","",1)
          replace line_r = subinstr(line_r,"http://","http_//",1)
          
          
          drop if regexm(line_r,":reference:") == 1
          drop if regexm(line_r,":license:") == 1
          drop if regexm(line_r,":reference:") == 1
          drop if regexm(line_r,":is-referenced-by-count") == 1
          drop if regexm(line_r,":link:") == 1
          drop if regexm(line_r,":abstract = <") == 1
          drop if regexm(line_r,":translator:") == 1
          drop if regexm(line_r,":journal-issue:published-online:") == 1
          drop if regexm(line_r,":assertion:") == 1
          drop if regexm(line_r,"update-policy") == 1
          drop if regexm(line_r,"content-domain:crossmark-restriction") == 1
          drop if regexm(line_r,":content-domain:domain:") == 1
          drop if regexm(line_r,":authenticated-orcid ") == 1
          drop if regexm(line_r,"doi-asserted-by") == 1
          drop if regexm(line_r,"relation:is-supplemented-by") == 1
          
          
          
          replace line_r = subinstr(line_r,":1 =",":1:1 =",1)
          replace line_r = subinstr(line_r,":2 =",":1:2 =",1)
          replace line_r = subinstr(line_r,":3 =",":1:3 =",1)
          replace line_r = subinstr(line_r,":4 =",":1:4 =",1)
          replace line_r = subinstr(line_r,":5 =",":1:5 =",1)
          replace line_r = subinstr(line_r,":6 =",":1:6 =",1)
          replace line_r = subinstr(line_r,":7 =",":1:7 =",1)
          replace line_r = subinstr(line_r,":8 =",":1:8 =",1)
          
          foreach i in issued deposited indexed created published-print published-online  {
          replace line_r = subinstr(line_r,`"`i':date-parts:1:1:1 ="',`"`i'_date_parts:1:1 ="',1)
          replace line_r = subinstr(line_r,`"`i':date-parts:1:1:2 ="',`"`i'_date_parts:1:2 ="',1)
          replace line_r = subinstr(line_r,`"`i':date-parts:1:1:3 ="',`"`i'_date_parts:1:3 ="',1)
          }
          replace line_r = subinstr(line_r,"deposited:date-parts","deposited_date_parts",1)
          replace line_r = subinstr(line_r,"journal-issue:published-print","journal_issue_published_print",1)
          
          replace line_r = subinstr(line_r,"indexed:date-parts","indexed_date_parts",1)
          replace line_r = subinstr(line_r,"indexed:date-time","indexed_date_time",1)
          replace line_r = subinstr(line_r,"container-title","container_title",1)
          
          replace line_r = subinstr(line_r,"event:name","event-name",1)
          replace line_r = subinstr(line_r,"event:acronym","event-acronym",1)
          replace line_r = subinstr(line_r,"institution:name","institution-name",1)
          
          
          foreach var in score issue reference-count references-count publisher type URL DOI volume member page prefix source subject language indexed_date_time {
          replace line_r = subinstr(line_r,`"`var' = "',`"`var':1:1 = "',.)
          }
          
          foreach var in deposited:date-time created:date-time content-domain:crossmark-restriction abstract publisher-location edition-number event-name event-acronym institution-name article-number {
          replace line_r = subinstr(line_r,`"`var' = "',`"`var':1:1 = "',1)
          }
          
          replace line_r = subinstr(line_r,"deposited:date-time","deposited_date-time",1)
          replace line_r = subinstr(line_r,"created:date-time","created_date-time",1)
          replace line_r = subinstr(line_r,"article-number","article_number",1)
          
          
          drop if regexm(line_r,"indexed:timestamp")==1
          drop if regexm(line_r,"deposited:timestamp")==1
          drop if regexm(line_r,"created:timestamp")==1
          drop if regexm(line_r,"indexed:timestamp")==1
          drop if regexm(line_r,"relation:has-review")==1
          
          
          foreach isbn in isbn issn {
          drop if regexm(line_r,`"`isbn'-type:1:value"') == 1
          drop if regexm(line_r,`"`isbn'-type:2:value"') == 1
          replace line_r = subinstr(line_r,`"`isbn'-type:1:type:1:1"',`"`isbn'-type:1:1"',1)
          replace line_r = subinstr(line_r,`"`isbn'-type:2:type:1:1"',`"`isbn'-type:1:2"',1)
          }
          
          foreach aff in affiliation {
          replace line_r = subinstr(line_r,`"`aff':1:name"',`"`aff'_1"',1)
          replace line_r = subinstr(line_r,`"`aff':2:name"',`"`aff'_2"',1)
          replace line_r = subinstr(line_r,`"`aff':3:name"',`"`aff'_3"',1)
          replace line_r = subinstr(line_r,`"`aff':4:name"',`"`aff'_4"',1)
          }
          
          
          compress
          
          ***** Preparation to split
          
          *in order to prevent information loss
          replace line_r = subinstr(line_r,"): ",") -_- ",1)
          
          
          *Split
          split line_r, gen(elem) parse(":") limit(4)
          
          *regain information
          replace elem4 = subinstr(elem4,") -_- ", "): ",1)
          
          
          ren elem1 item_id
          ren elem2 var
          ren elem3 elem_nr
          
          split elem4, gen(text) parse(" = ") limit(2)
          
          ren text1 var2
          ren text2 text
          
          replace elem_nr = var2 if elem_nr=="1" & inlist(var2,"2","3","4","5","6","7","8")
          
          order item_id var var2 elem_nr text
          
          clonevar var_r = var
          
          foreach n in family given sequence affiliation ORCID affiliation_1 affiliation_2 affiliation_3 affiliation_4  {
          foreach a in author editor {
          if `"`a'"' == "author" {
          replace var_r = `"aut_person_`n'"' if var == `"`a'"' & var2 == `"`n'"'
          }
          if `"`a'"' == "editor" {
          replace var_r = `"heraus_person_`n'"' if var == `"`a'"' & var2 == `"`n'"'
          }
          }
          }
          
          foreach n in DOI name award {
          replace var_r = `"funder_`n'"' if var == `"funder"' & var2 == `"`n'"'
          }
          
          replace var_r = subinstr(var_r,"-","_",1)
          
          * Shorten lang var names
          replace var_r = subinstr(var_r,"published_print_date_parts","pub_print_dp",1)
          replace var_r = subinstr(var_r,"journal_issue_published_print_date_parts","j_issue_pub_print_dp",1)
          replace var_r = subinstr(var_r,"_date_parts","_dp",1)
          
          destring item_id elem_nr, replace
          egen varname = concat(var_r elem_nr), punct("_")
          order item_id varname text
          keep item_id varname text
          reshape wide text, i(item_id) j(varname) string
          
          ren item_id textitem_id
          
          foreach var of var _all {
          local text = ustrregexrf(`"`var'"',"text","")
          ren `var' `text'
          }
          
          
          compress
          leftalign
          datasignature set, reset
          save data\cr_import_01_${shortid}.dta, replace

          Comment


          • #6
            William Lisowski : I tried your code but failed when I use a 30 item example. For me it looks like -insheetjson- is not able to handle JSON files where the selectors are different item by item. I attach my example file.
            Attached Files

            Comment


            • #7
              Bjarte Aagnes Thanks for your code. This looks promising as an alternative way. I let get deeper into this when I have to handle larger json-files again later this year.

              Comment


              • #8
                Marc Kaulisch : Thank you for the more extensive example data. I agree with you that insheetson has problems handling JSON containing different selectors on different items. Below are my results with your test_30 dataset. We see that the selectors DOI and ISSN appear in both the first and second items, and the selector page appears only in the second item. The end result suggests that insheetjson quietly stops when it encounters an item containing a selector it is not expecting, even if the unexpected selectort is not included in the columns() option, and it fails completely if the columns() option contains a selector not present in the first item.
                Code:
                . type test_30.txt, lines(2)
                {"subtitle":[],"subject":["Complementary and alternative medicine"],"issued":{"date-parts":[[20
                > 06,6]]},"score":1,"prefix":"http://id.crossref.org/prefix/10.1089","container-title":["Journa
                > l of Alternative and Complementary Medicine"],"reference-count":0,"deposited":{"date-parts":[
                > [2007,2,13]],"timestamp":1171324800000},"issue":"5","title":[],"type":"journal-issue","DOI":"
                > 10.1089/acm.2006.12.issue-5","ISSN":["1075-5535"],"URL":"http://dx.doi.org/10.1089/acm.2006.1
                > 2.issue-5","source":"CrossRef","publisher":"Mary Ann Liebert Inc","indexed":{"date-parts":[[2
                > 014,5,12]],"timestamp":1399876169054},"volume":"12","member":"http://id.crossref.org/member/2
                > 78"}
                {"subtitle":[],"issued":{"date-parts":[[2006]]},"score":1,"prefix":"http://id.crossref.org/pref
                > ix/10.1241","author":[{"family":"YAMAZAKI","given":"Keiki"}],"container-title":["Journal of I
                > nformation Processing and Management","Joho Kanri /J Inf Proc Manage"],"reference-count":0,"p
                > age":"165-173","deposited":{"date-parts":[[2007,2,13]],"timestamp":1171324800000},"issue":"4"
                > ,"title":["音声認識システムを活用した会議録作成","Use of speech recognition system for minute
                > -taking process:"],"type":"journal-article","DOI":"10.1241/johokanri.49.165","ISSN":["0021-72
                > 98","1347-1597"],"URL":"http://dx.doi.org/10.1241/johokanri.49.165","source":"CrossRef","publ
                > isher":"Japan Science and Technology Agency (JST)","indexed":{"date-parts":[[2014,5,12]],"tim
                > estamp":1399876228973},"volume":"49","member":"http://id.crossref.org/member/272"}
                . 
                . insheetjson using test_30.txt, showresponse flatten
                Response from server:
                        subject:1 = Complementary and alternative medicine
                        issued:date-parts:1:1 = 2006
                        issued:date-parts:1:2 = 6
                        score = 1
                        prefix = http://id.crossref.org/prefix/10.1089
                        container-title:1 = Journal of Alternative and Complementary Medicine
                        reference-count = 0
                        deposited:date-parts:1:1 = 2007
                        deposited:date-parts:1:2 = 2
                        deposited:date-parts:1:3 = 13
                        deposited:timestamp = 1171324800000
                        issue = 5
                        type = journal-issue
                        DOI = 10.1089/acm.2006.12.issue-5
                        ISSN:1 = 1075-5535
                        URL = http://dx.doi.org/10.1089/acm.2006.12.issue-5
                        source = CrossRef
                        publisher = Mary Ann Liebert Inc
                        indexed:date-parts:1:1 = 2014
                        indexed:date-parts:1:2 = 5
                        indexed:date-parts:1:3 = 12
                        indexed:timestamp = 1399876169054
                        volume = 12
                        member = http://id.crossref.org/member/278
                
                . 
                . clear
                
                . set obs 30
                number of observations (_N) was 0, now 30
                
                . generate str240 doi = ""
                (30 missing values generated)
                
                . insheetjson doi using test_30.txt, columns(DOI)
                 1 observations updated/written.
                
                . list in 1/2, noobs 
                
                  +-----------------------------+
                  |                         doi |
                  |-----------------------------|
                  | 10.1089/acm.2006.12.issue-5 |
                  |                             |
                  +-----------------------------+
                
                . 
                . clear
                
                . set obs 30
                number of observations (_N) was 0, now 30
                
                . generate str240 doi = ""
                (30 missing values generated)
                
                . generate str240 issn = ""
                (30 missing values generated)
                
                . insheetjson doi issn using test_30.txt, columns(DOI ISSN:1)
                 1 observations updated/written.
                
                . list in 1/2, noobs 
                
                  +-----------------------------------------+
                  |                         doi        issn |
                  |-----------------------------------------|
                  | 10.1089/acm.2006.12.issue-5   1075-5535 |
                  |                                         |
                  +-----------------------------------------+
                
                . 
                . clear
                
                . set obs 30
                number of observations (_N) was 0, now 30
                
                . generate str240 doi = ""
                (30 missing values generated)
                
                . generate str240 issn = ""
                (30 missing values generated)
                
                . generate str240 page = ""
                (30 missing values generated)
                
                . insheetjson doi issn page using test_30.txt, columns(DOI ISSN:1 page)
                 Invalid column name/selector 'page'. (Possible name candidates are: "subtitle" "subject" "issu
                > ed" "score" "prefix" "container-title" "reference-count" "deposited" "issue" "title" "type" "
                > DOI" "ISSN" "URL" "source" "publisher" "indexed" "volume" "member" )
                 Empty result returned; Nothing to do.
                
                . list in 1/2, noobs 
                
                  +-------------------+
                  | doi   issn   page |
                  |-------------------|
                  |                   |
                  |                   |
                  +-------------------+
                
                .

                Comment

                Working...
                X