差分発生行の前後
無視リスト:
更新日時:
2014/12/19 18:01:25 (10 年 前)
更新者:
atsuko
ログメッセージ:

パス探索アルゴリズムを大幅変更

ファイル:
1 変更

凡例:

変更なし
追加
削除
  • SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/OWL/QueryPathGenerator.java

    r204 r221  
    1717    private RDFSchemaAnalyzerFactory factory = null; 
    1818    private RDFSchemaAnalyzer analyzer = null; 
    19     //private OWLClassGraph graph; 
     19    private OWLClassGraph graph; 
    2020    //private PathMatrix matrix = null; 
    2121     
     
    4343        //QueryPathGenerator qpg = new QueryPathGenerator(sp, "c:\\cdata"); 
    4444        QueryPathGenerator qpg1 = new QueryPathGenerator(sp, "cdata/"); 
     45        //qpg1.testOWLClassGraph(); 
    4546        //SClass[] cl = qpg.getClasses(null); 
    4647    } 
     
    5354        factory = new RDFSchemaAnalyzerFactory(CDIR); 
    5455        setSPARQLendpoint(sparqlEndpoint); 
     56        setOWLClassGraph(); 
    5557    } 
    5658 
     
    5860        factory = new RDFSchemaAnalyzerFactory(crawlFileName); 
    5961        setSPARQLendpoint(sparqlEndpoint); 
     62        setOWLClassGraph(); 
    6063    } 
    6164     
     
    7780     
    7881    public Path[] getPaths(String startClass, String endClass, boolean countLink){ 
    79         if ( analyzer == null ){ 
    80             System.err.println("ERROR. SPARQL endpoint is not decided."); 
     82        if ( graph == null ){ 
     83            setOWLClassGraph(); 
    8184        } 
    82         OWLClassGraph graph = new OWLClassGraph(startClass, endClass); 
    83         return graph.getPaths(analyzer, countLink); 
     85        return graph.getPaths(startClass, endClass); 
     86        //return graph.getPaths_old(analyzer, true, startClass, endClass); 
    8487    } 
    8588     
     
    129132        return label; 
    130133    } 
     134     
     135    public void setOWLClassGraph(){ 
     136        graph = new OWLClassGraph(analyzer);  
     137    } 
     138     
     139    public OWLClassGraph getOWLClassGraph(){ 
     140        if ( graph == null ){ 
     141            graph = new OWLClassGraph(analyzer);              
     142        } 
     143        return graph; 
     144    } 
    131145}