00001 import edu.tum.cs.srl.bayesnets.BLOGModel; 00002 00003 00004 public class BLOG2MLN { 00005 00009 public static void main(String[] args) { 00010 try { 00011 if(args.length < 2) { 00012 System.out.println("\n usage: BLOG2MLN <BLOG file(s)> <XML-BIF file> [options]\n\n" + 00013 " -g guess signatures from network structure rather than obtaining them from the BLOG file(s)\n" + 00014 " -cF write compact formulas\n" + 00015 " -nW numeric weights (rather than formulas such as log(x))\n"); 00016 return; 00017 } 00018 boolean guessSigs = false, compact = false, numericWeights = false; 00019 for(int i = 2; i < args.length; i++) { 00020 if(args[i].equals("-g")) 00021 guessSigs = true; 00022 else if(args[i].equals("-cF")) 00023 compact = true; 00024 else if(args[i].equals("-nW")) 00025 numericWeights = true; 00026 else { 00027 System.err.println("unknown option " + args[i]); 00028 return; 00029 } 00030 } 00031 BLOGModel b = new BLOGModel(args[0].split(","), args[1]); 00032 if(guessSigs) 00033 b.guessSignatures(); 00034 b.toMLN(System.out, false, compact, numericWeights); 00035 } 00036 catch(Exception e) { 00037 e.printStackTrace(); 00038 } 00039 } 00040 }