parameters: (
          baseuri="http://lov.okfn.org/dataset/lov/api/v2/vocabulary/list",
          keyword="")
docstring: 2016-03-02: import from json list
docstring_summary: 2016-03-02: import from json list
docstring_tokens: 2016 - 03 - 02 : import from json list
function: def _import_LOV(
          baseuri="http://lov.okfn.org/dataset/lov/api/v2/vocabulary/list",
          keyword=""):
      """
      2016-03-02: import from json list
      """
  
      printDebug("----------\nReading source... <%s>" % baseuri)
      query = requests.get(baseuri, params={})
      all_options = query.json()
      options = []
  
      # pre-filter if necessary
      if keyword:
          for x in all_options:
              if keyword in x['uri'].lower() or keyword in x['titles'][0][
                      'value'].lower() or keyword in x['nsp'].lower():
                  options.append(x)
      else:
          options = all_options
  
      printDebug("----------\n%d results found.\n----------" % len(options))
  
      if options:
          # display:
          counter = 1
          for x in options:
              uri, title, ns = x['uri'], x['titles'][0]['value'], x['nsp']
              # print("%s ==> %s" % (d['titles'][0]['value'], d['uri']))
              printDebug(
                  click.style("[%d]" % counter, fg='blue') +
                  click.style(uri + " ==> ", fg='black') +
                  click.style(title, fg='red'), 
                  err=True)
  
              counter += 1
  
          while True:
              var = input(Style.BRIGHT +
                          "=====\nSelect ID to import: (q=quit)\n" +
                          Style.RESET_ALL)
              if var == "q":
                  break
              else:
                  try:
                      _id = int(var)
                      ontouri = options[_id - 1]['uri']
                      printDebug(Fore.RED + "\n---------\n" + ontouri +
                            "\n---------" + Style.RESET_ALL)
                      action_analyze([ontouri])
                      if click.confirm(
                              '=====\nDo you want to save to your local library?'
                      ):
                          action_import(ontouri)
                      return
                  except:
                      printDebug("Error retrieving file. Import failed.")
                      continue
function_tokens: def _import_LOV ( baseuri = "http://lov.okfn.org/dataset/lov/api/v2/vocabulary/list" , keyword = "" ) : printDebug ( "----------\nReading source... <%s>" % baseuri ) query = requests . get ( baseuri , params = { } ) all_options = query . json ( ) options = [ ] # pre-filter if necessary if keyword : for x in all_options : if keyword in x [ 'uri' ] . lower ( ) or keyword in x [ 'titles' ] [ 0 ] [ 'value' ] . lower ( ) or keyword in x [ 'nsp' ] . lower ( ) : options . append ( x ) else : options = all_options printDebug ( "----------\n%d results found.\n----------" % len ( options ) ) if options : # display: counter = 1 for x in options : uri , title , ns = x [ 'uri' ] , x [ 'titles' ] [ 0 ] [ 'value' ] , x [ 'nsp' ] # print("%s ==> %s" % (d['titles'][0]['value'], d['uri'])) printDebug ( click . style ( "[%d]" % counter , fg = 'blue' ) + click . style ( uri + " ==> " , fg = 'black' ) + click . style ( title , fg = 'red' ) , err = True ) counter += 1 while True : var = input ( Style . BRIGHT + "=====\nSelect ID to import: (q=quit)\n" + Style . RESET_ALL ) if var == "q" : break else : try : _id = int ( var ) ontouri = options [ _id - 1 ] [ 'uri' ] printDebug ( Fore . RED + "\n---------\n" + ontouri + "\n---------" + Style . RESET_ALL ) action_analyze ( [ ontouri ] ) if click . confirm ( '=====\nDo you want to save to your local library?' ) : action_import ( ontouri ) return except : printDebug ( "Error retrieving file. Import failed." ) continue