+;;
+
+let dc_metadata db obj =
+ let tables =
+ [ "dc:creator","dccreator" ;
+ "dc:date","dcdate" ;
+ "dc:description","dcdescription" ;
+ "dc:format","dcformat" ;
+ "dc:identifier","dcidentifier" ;
+ "dc:language","dclanguage" ;
+ "dc:publisher","dcpublisher" ;
+ "dcq:RelationType","dcqRelationType" ;
+ "dc:relation","dcrelation" ;
+ "dc:rights","dcrights" ;
+ "dc:source","dcsource" ;
+ "dc:subject","dcsubject" ;
+ "dc:title","dctitle" ;
+ "hth:ResourceFormat","hthResourceFormat" ;
+ "hth:contact","hthcontact" ;
+ "hth:firstVersion","hthfirstVersion" ;
+ "hth:institution","hthinstitution" ;
+ "hth:modified","hthmodified"
+ ]
+ in
+ let msg = mk_new_msg () in
+ msg_output_dc_header msg obj ;
+ List.iter
+ (fun (propertyname,tablename) ->
+ let res =
+ M.exec db
+ ("SELECT * FROM " ^ tablename ^ " WHERE uri = '" ^ obj ^ "';") in
+ M.iter res
+ ~f:(function cols ->
+ let value = value_of_optional_value (cols.(0)) in
+ msg_output_string msg
+ (" <" ^ propertyname ^ ">" ^ value ^ "</" ^ propertyname ^ ">\n") ;
+ ) ;
+ ) tables ;
+ msg_output_dc_trailer msg ;
+ msg_serialize msg
+;;