Set field types and serialize as koral:fields

Change-Id: I6f256fcbf3996e6ae45db60bc3aef98ff431b0b9
diff --git a/t/sgbr/meta_ids.t b/t/sgbr/meta_ids.t
index 8a4cc4e..c9a83c7 100644
--- a/t/sgbr/meta_ids.t
+++ b/t/sgbr/meta_ids.t
@@ -27,50 +27,50 @@
 
 my $meta = $doc->meta;
 
-is($meta->{title}, '@ Koelle_am_Rhing 10:18', 'title');
+is($meta->{T_title}, '@ Koelle_am_Rhing 10:18', 'title');
 
-ok(!$meta->{sub_title}, 'no subtitle');
+ok(!$meta->{T_sub_title}, 'no subtitle');
 
-is($meta->{publisher}, 'tagesschau.de', 'Publisher');
+is($meta->{A_publisher}, 'tagesschau.de', 'Publisher');
 
-is($meta->{pub_date}, '20140930');
+is($meta->{D_pub_date}, '20140930');
 
-ok(!$meta->{pub_place}, 'No pub place');
+ok(!$meta->{S_pub_place}, 'No pub place');
 
-is($meta->{doc_title}, 'Korpus zur Beobachtung des Schreibgebrauchs im Deutschen', 'Doc title');
-is($meta->{doc_sub_title}, 'Subkorpus Internettexte, Subkorpus Leserkommentare Tagesschau, Subkorpus September 2014, Subkorpus Beispielauszug', 'Doc Sub title');
+is($meta->{T_doc_title}, 'Korpus zur Beobachtung des Schreibgebrauchs im Deutschen', 'Doc title');
+is($meta->{T_doc_sub_title}, 'Subkorpus Internettexte, Subkorpus Leserkommentare Tagesschau, Subkorpus September 2014, Subkorpus Beispielauszug', 'Doc Sub title');
 
-is($meta->{'funder'}, 'Bundesministerium für Bildung und Forschung', 'Funder');
+is($meta->{'A_funder'}, 'Bundesministerium für Bildung und Forschung', 'Funder');
 
-is($meta->{author}, 'privat23', 'Author');
-ok(!$meta->{'sgbr_author_sex'}, 'No Sex');
-ok(!$meta->{'sgbr_kodex'}, 'No kodex');
-is($meta->{reference}, 'http://meta.tagesschau.de/node/090285#comment-1732187', 'Publace ref');
+is($meta->{T_author}, 'privat23', 'Author');
+ok(!$meta->{'S_sgbr_author_sex'}, 'No Sex');
+ok(!$meta->{'S_sgbr_kodex'}, 'No kodex');
+is($meta->{A_reference}, 'http://meta.tagesschau.de/node/090285#comment-1732187', 'Publace ref');
 
-is($meta->keywords('keywords'), '');
+is($meta->keywords('K_keywords'), '');
 
-is($meta->{language}, 'de', 'Language');
+is($meta->{S_language}, 'de', 'Language');
 
-ok(!$meta->{editor}, 'Editor');
+ok(!$meta->{A_editor}, 'Editor');
 
-ok(!$meta->{text_type}, 'Text Type');
-ok(!$meta->{text_type_art}, 'Text Type Art');
-ok(!$meta->{text_type_ref}, 'Text Type Ref');
-ok(!$meta->{text_column}, 'Text Column');
-ok(!$meta->{text_domain}, 'Text Domain');
-ok(!$meta->{creation_date}, 'Creation Date');
-ok(!$meta->{license}, 'License');
-ok(!$meta->{pages}, 'Pages');
-ok(!$meta->{file_edition_statement}, 'File Edition Statement');
-ok(!$meta->{bibl_edition_statement}, 'Bibl Edition Statement');
+ok(!$meta->{S_text_type}, 'Text Type');
+ok(!$meta->{S_text_type_art}, 'Text Type Art');
+ok(!$meta->{S_text_type_ref}, 'Text Type Ref');
+ok(!$meta->{S_text_column}, 'Text Column');
+ok(!$meta->{S_text_domain}, 'Text Domain');
+ok(!$meta->{D_creation_date}, 'Creation Date');
+ok(!$meta->{S_license}, 'License');
+ok(!$meta->{A_pages}, 'Pages');
+ok(!$meta->{A_file_edition_statement}, 'File Edition Statement');
+ok(!$meta->{A_bibl_edition_statement}, 'Bibl Edition Statement');
 
-ok(!$meta->{doc_editor}, 'Doc: editor');
-ok(!$meta->{doc_author}, 'Doc: author');
+ok(!$meta->{A_doc_editor}, 'Doc: editor');
+ok(!$meta->{T_doc_author}, 'Doc: author');
 
-ok(!$meta->{corpus_title}, 'Corpus: title');
-ok(!$meta->{corpus_sub_title}, 'Corpus: subtitle');
-ok(!$meta->{corpus_editor}, 'Corpus: editor');
-ok(!$meta->{corpus_author}, 'Corpus: author');
+ok(!$meta->{T_corpus_title}, 'Corpus: title');
+ok(!$meta->{T_corpus_sub_title}, 'Corpus: subtitle');
+ok(!$meta->{A_corpus_editor}, 'Corpus: editor');
+ok(!$meta->{T_corpus_author}, 'Corpus: author');
 
 my $hash = $doc->to_hash;
 is($hash->{title}, '@ Koelle_am_Rhing 10:18', 'Corpus title');
@@ -95,51 +95,51 @@
 
 
 $meta = $doc->meta;
-is($meta->{title}, '@fitnessfrosch', 'title');
+is($meta->{T_title}, '@fitnessfrosch', 'title');
 
-ok(!$meta->{sub_title}, 'no subtitle');
+ok(!$meta->{T_sub_title}, 'no subtitle');
 
-is($meta->{publisher}, 'tagesschau.de', 'Publisher');
+is($meta->{A_publisher}, 'tagesschau.de', 'Publisher');
 
-is($meta->{pub_date}, '20141001');
-is($meta->{'sgbr_date'}, '2014-10-01 00:50:00');
+is($meta->{D_pub_date}, '20141001');
+is($meta->{'D_sgbr_date'}, '2014-10-01 00:50:00');
 
-ok(!$meta->{pub_place}, 'No pub place');
+ok(!$meta->{S_pub_place}, 'No pub place');
 
-is($meta->{doc_title}, 'Korpus zur Beobachtung des Schreibgebrauchs im Deutschen', 'Doc title');
-is($meta->{doc_sub_title}, 'Subkorpus Internettexte, Subkorpus Leserkommentare Tagesschau, Subkorpus September 2014, Subkorpus Beispielauszug', 'Doc Sub title');
+is($meta->{T_doc_title}, 'Korpus zur Beobachtung des Schreibgebrauchs im Deutschen', 'Doc title');
+is($meta->{T_doc_sub_title}, 'Subkorpus Internettexte, Subkorpus Leserkommentare Tagesschau, Subkorpus September 2014, Subkorpus Beispielauszug', 'Doc Sub title');
 
-is($meta->{'funder'}, 'Bundesministerium für Bildung und Forschung', 'Funder');
+is($meta->{'A_funder'}, 'Bundesministerium für Bildung und Forschung', 'Funder');
 
-is($meta->{author}, 'weltoffen', 'Author');
-ok(!$meta->{'sgbr_author_sex'}, 'No Sex');
-ok(!$meta->{'sgbr_kodex'}, 'No kodex');
-is($meta->{reference}, 'http://meta.tagesschau.de/node/090308#comment-1732754', 'Publace ref');
+is($meta->{T_author}, 'weltoffen', 'Author');
+ok(!$meta->{'S_sgbr_author_sex'}, 'No Sex');
+ok(!$meta->{'S_sgbr_kodex'}, 'No kodex');
+is($meta->{A_reference}, 'http://meta.tagesschau.de/node/090308#comment-1732754', 'Publace ref');
 
-is($meta->keywords('keywords'), '');
+is($meta->keywords('K_keywords'), '');
 
-is($meta->{language}, 'de', 'Language');
+is($meta->{S_language}, 'de', 'Language');
 
-ok(!$meta->{editor}, 'Editor');
+ok(!$meta->{A_editor}, 'Editor');
 
-ok(!$meta->{text_type}, 'Text Type');
-ok(!$meta->{text_type_art}, 'Text Type Art');
-ok(!$meta->{text_type_ref}, 'Text Type Ref');
-ok(!$meta->{text_column}, 'Text Column');
-ok(!$meta->{text_domain}, 'Text Domain');
-ok(!$meta->{creation_date}, 'Creation Date');
-ok(!$meta->{license}, 'License');
-ok(!$meta->{pages}, 'Pages');
-ok(!$meta->{file_edition_statement}, 'File Edition Statement');
-ok(!$meta->{bibl_edition_statement}, 'Bibl Edition Statement');
+ok(!$meta->{S_text_type}, 'Text Type');
+ok(!$meta->{S_text_type_art}, 'Text Type Art');
+ok(!$meta->{S_text_type_ref}, 'Text Type Ref');
+ok(!$meta->{S_text_column}, 'Text Column');
+ok(!$meta->{S_text_domain}, 'Text Domain');
+ok(!$meta->{D_creation_date}, 'Creation Date');
+ok(!$meta->{S_license}, 'License');
+ok(!$meta->{A_pages}, 'Pages');
+ok(!$meta->{A_file_edition_statement}, 'File Edition Statement');
+ok(!$meta->{A_bibl_edition_statement}, 'Bibl Edition Statement');
 
-ok(!$meta->{doc_editor}, 'Doc: editor');
-ok(!$meta->{doc_author}, 'Doc: author');
+ok(!$meta->{A_doc_editor}, 'Doc: editor');
+ok(!$meta->{T_doc_author}, 'Doc: author');
 
-ok(!$meta->{corpus_title}, 'Corpus: title');
-ok(!$meta->{corpus_sub_title}, 'Corpus: subtitle');
-ok(!$meta->{corpus_editor}, 'Corpus: editor');
-ok(!$meta->{corpus_author}, 'Corpus: author');
+ok(!$meta->{T_corpus_title}, 'Corpus: title');
+ok(!$meta->{T_corpus_sub_title}, 'Corpus: subtitle');
+ok(!$meta->{A_corpus_editor}, 'Corpus: editor');
+ok(!$meta->{T_corpus_author}, 'Corpus: author');
 
 $hash = $doc->to_hash;
 is($hash->{title}, '@fitnessfrosch', 'Corpus title');