@@ -0,0 +1,3099 @@
+/*%0A * To change this template, choose Tools %7C Templates%0A * and open the template in the editor.%0A */%0Apackage nl.wur.plantbreeding.gff2rdf2.Potato;%0A%0Aimport com.hp.hpl.jena.rdf.model.Model;%0Aimport java.io.BufferedReader;%0Aimport java.io.DataInputStream;%0Aimport java.io.FileInputStream;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0Aimport java.util.ArrayList;%0Aimport java.util.logging.Level;%0Aimport java.util.logging.Logger;%0Aimport nl.wur.plantbreeding.gff2rdf2.ObjectToModel;%0A%0A/**%0A * This class parses the functional description file and%0A *%0A * As format may change, the parser may need changes for futur release.%0A * @author Pierre-Yves Chibon -- py@chibon.fr%0A */%0Apublic class Po_ParseGeneDescription %7B%0A%0A    /** Logger used for outputing log information. */%0A    private static final Logger LOG = Logger.getLogger(%0A            Po_ParseGeneDescription.class.getName());%0A%0A    /**%0A     * This method parse the file PGSC_DM_v*_gene_func.txt from PGSC%0A     * and extrac the gene description which is then added to the Jena Model.%0A     *%0A     * @param inputfilename the path to the input file containing the gene%0A     * functional description%0A     * @param model a Jena model in which the gene description will be stored%0A     * @return a Jena model containing with its previous information the gene%0A     * description retrieved by this method.%0A     * @throws IOException When something goes wrong with a file.%0A     */%0A    public final Model addGeneDescriptionToModel(final String inputfilename,%0A            Model model) throws IOException %7B%0A%0A        System.out.println(%22Parsing: %22 + inputfilename%0A                + %22 and adding information to a model of size %22 + model.size());%0A%0A        ObjectToModel obj2m = new ObjectToModel();%0A%0A        int cnt = 0;%0A        int genecnt = 0;%0A        String strline = %22%22;%0A        final FileInputStream fstream = new FileInputStream(inputfilename);%0A        // Get the object of DataInputStream%0A        final DataInputStream in = new DataInputStream(fstream);%0A        final BufferedReader br =%0A                new BufferedReader(new InputStreamReader(in));%0A        String geneid = null;%0A        String description = null;%0A        //Read File Line By Line%0A        while ((strline = br.readLine()) != null) %7B%0A            strline = strline.trim();%0A            String%5B%5D content = strline.split(%22%5Ct%22);%0A            if (content.length %3E 1 && cnt %3E 1) %7B%0A                geneid = content%5B0%5D;%0A                description = content%5B1%5D;%0A                // Add gene to model%0A                model = obj2m.addGeneDescriptionToModel(geneid, description,%0A                        model);%0A                genecnt = genecnt + 1;%0A            %7D%0A            cnt = cnt + 1;%0A        %7D%0A        in.close();%0A%0A        if (geneid != null) %7B%0A            // add gene to model here%0A            model = obj2m.addGeneDescriptionToModel(geneid, description,%0A                    model);%0A        %7D%0A%0A        LOG.log(Level.FINE, cnt + %22 lines read%22);%0A        LOG.log(Level.FINE, genecnt + %22 genes found%22);%0A        LOG.log(Level.FINE, %22Model has size: %22 + model.size());%0A%0A        return model;%0A    %7D%0A%7D%0A

Add missing file