<commit_before>module BioTable
  module RDF

    # Write a table header as Turtle RDF. 
    #
    # If we have a column name 'AXB1' the following gets written:
    #
    # [:AXB1 rdf:label "AXB1"; a :colname; :index 3 ].
    #
    # This method returns a list of these.
    def RDF::header(row)
      list = []
      row.each_with_index do | field,i |
        s = "biotable:#{field} rdf:label \"#{field}\"; a biotable:colname; biotable:index #{i}."
        list << s
      end
      list
    end

    # Write a table row as Turtle RDF
    #
    # If we have a row, each row element gets written with the header colname as an id, e.g.
    #
    # [:rs13475701 rdf:label "rs13475701"; a :rowname; :Chromosome 1 ; :Pos 0 ; :AXB1 "AA"].
    #
    # The method returns a String.

    def RDF::row(row, header)
      list = []
      rowname = row[0]
      list << "biotable:#{rowname} rdf:label \"#{rowname}\"; a biotable:colname;"
      row.each_with_index do | field,i |
        list << ":#{header[i]} \"#{field}\";"
      end
      list.join(" ")
    end
  end
end<commit_msg>Using default namespace<commit_after>module BioTable
  module RDF

    # Write a table header as Turtle RDF. 
    #
    # If we have a column name 'AXB1' the following gets written:
    #
    # [:AXB1 rdf:label "AXB1"; a :colname; :index 3 ].
    #
    # This method returns a list of these.
    def RDF::header(row)
      list = []
      row.each_with_index do | field,i |
        s = ":#{field} rdf:label \"#{field}\" ; a :colname; :index #{i} ."
        list << s
      end
      list
    end

    # Write a table row as Turtle RDF
    #
    # If we have a row, each row element gets written with the header colname as an id, e.g.
    #
    # [:rs13475701 rdf:label "rs13475701"; a :rowname; :Chromosome 1 ; :Pos 0 ; :AXB1 "AA"].
    #
    # The method returns a String.

    def RDF::row(row, header)
      list = []
      rowname = row[0]
      list << ":#{rowname} rdf:label \"#{rowname}\" ; a :colname ;"
      row.each_with_index do | field,i |
        list << ":#{header[i]} \"#{field}\""
      end
      list.join(" ; ")+" ."
    end
  end
end
{'fraction_non_alphanumeric': 0.14111006585136407, 'fraction_numerical': 0.022577610536218252, 'mean_word_length': 2.174626865671642, 'pattern_counts': {'":': 4, '<': 15, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1507939', 'n_tokens_mistral': 794, 'n_tokens_neox': 763, 'n_words': 239}