チェンジセット 182 : SPARQLBuilderWWW/src/java
- 更新日時:
- 2014/09/26 14:09:36 (10 年 前)
- ファイル:
-
- 1 変更
凡例:
- 変更なし
- 追加
- 削除
-
SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/OWL/RDFSchemaAnalyzerFactory.java
r133 r182 5 5 import java.util.Map; 6 6 7 import org.biohackathon.SPARQLBuilder.endpointMetadata.MetadataFile; 8 import org.biohackathon.SPARQLBuilder.endpointMetadata.MetadataManager; 9 7 10 import jp.riken.accc.db.rdf.crawler.dataStructure.sparql.JenaModelGenerator; 8 11 9 12 public class RDFSchemaAnalyzerFactory { 10 13 11 private Map<String, String> acquiredRDFFiles = null; 12 private static final String FILENAME = "C:\\cdata"; 14 private MetadataManager metadataManager = null; 15 // private Map<String, String> acquiredRDFFiles = null; 16 private static final String FILENAME = "C:\\cdata"; 13 17 14 18 public RDFSchemaAnalyzerFactory(String fileName){ 15 19 try{ 16 setAcqiredRDFFiles(new File(fileName)); 20 metadataManager = new MetadataManager(fileName); 21 // setAcqiredRDFFiles(new File(fileName)); 17 22 }catch(Exception e){ 18 23 System.err.println(e); … … 22 27 public RDFSchemaAnalyzerFactory(){ 23 28 try{ 24 setAcqiredRDFFiles(new File(FILENAME)); 29 metadataManager = new MetadataManager(FILENAME); 30 // setAcqiredRDFFiles(new File(FILENAME)); 25 31 }catch(Exception e){ 26 32 System.err.println(e); … … 28 34 } 29 35 30 private void setAcqiredRDFFiles(String dirFile) throws Exception{ 31 setAcqiredRDFFiles(new File(dirFile)); 36 // private void setAcqiredRDFFiles(String dirFile) throws Exception{ 37 // setAcqiredRDFFiles(new File(dirFile)); 38 // } 39 40 // private void setAcqiredRDFFiles(File data) throws Exception{ 41 // StructureCrawler sc = new StructureCrawler(data); 42 // acquiredRDFFiles = sc.getAcquiredStructureFiles(); 43 // } 44 45 public String[] getEndpointURIList(){ 46 return metadataManager.getURIList(); 47 } 48 49 public MetadataFile[] getMetadataFiles(){ 50 return metadataManager.getMetadataFiles(); 32 51 } 33 52 34 private void setAcqiredRDFFiles(File data) throws Exception{35 StructureCrawler sc = new StructureCrawler(data);36 acquiredRDFFiles = sc.getAcquiredStructureFiles();37 }38 53 39 public String[] getEndpointURIList(){40 if( acquiredRDFFiles == null ){41 return new String[0];42 }else{43 return acquiredRDFFiles.keySet().toArray(new String[0]);44 }45 }46 47 54 public RDFSchemaAnalyzer create(String uri) throws Exception{ 48 if( acquiredRDFFiles == null || !acquiredRDFFiles.containsKey(uri)){ 55 MetadataFile mFile = metadataManager.getMetadataFile(uri); 56 if( mFile == null ){ 49 57 return new EndpointAnalyzer(uri); 50 58 }else{ 51 JenaModelGenerator jmGene = new JenaModelGenerator( acquiredRDFFiles.get(uri));59 JenaModelGenerator jmGene = new JenaModelGenerator(mFile.getEndpointURI()); 52 60 return new AcquiredStructureAnalyzer(jmGene.getEndpointURI(), jmGene.getGraphURIs(), jmGene.getModel()); 53 61 }