| 1 | package org.biohackathon.SPARQLBuilder.OWL;
|
|---|
| 2 |
|
|---|
| 3 | import java.io.File;
|
|---|
| 4 | import java.util.HashMap;
|
|---|
| 5 | import java.util.Map;
|
|---|
| 6 |
|
|---|
| 7 | import org.biohackathon.SPARQLBuilder.endpointMetadata.MetadataFile;
|
|---|
| 8 | import org.biohackathon.SPARQLBuilder.endpointMetadata.MetadataManager;
|
|---|
| 9 |
|
|---|
| 10 | import jp.riken.accc.db.sparqlBuilderMetadata.crawler.dataStructure.sparql.JenaModelGenerator;
|
|---|
| 11 | import jp.riken.accc.db.sparqlBuilderMetadata.crawler.dataStructure.sparql.crawler.CrawledMetadata;
|
|---|
| 12 |
|
|---|
| 13 | public class RDFSchemaAnalyzerFactory {
|
|---|
| 14 |
|
|---|
| 15 | private MetadataManager metadataManager = null;
|
|---|
| 16 | // private Map<String, String> acquiredRDFFiles = null;
|
|---|
| 17 | private static final String FILENAME = "C:\\cdata";
|
|---|
| 18 |
|
|---|
| 19 | public RDFSchemaAnalyzerFactory(String fileName){
|
|---|
| 20 | try{
|
|---|
| 21 | metadataManager = new MetadataManager(fileName);
|
|---|
| 22 | // setAcqiredRDFFiles(new File(fileName));
|
|---|
| 23 | }catch(Exception e){
|
|---|
| 24 | System.err.println(e);
|
|---|
| 25 | }
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | public RDFSchemaAnalyzerFactory(){
|
|---|
| 29 | try{
|
|---|
| 30 | metadataManager = new MetadataManager(FILENAME);
|
|---|
| 31 | // setAcqiredRDFFiles(new File(FILENAME));
|
|---|
| 32 | }catch(Exception e){
|
|---|
| 33 | System.err.println(e);
|
|---|
| 34 | }
|
|---|
| 35 | }
|
|---|
| 36 |
|
|---|
| 37 | // private void setAcqiredRDFFiles(String dirFile) throws Exception{
|
|---|
| 38 | // setAcqiredRDFFiles(new File(dirFile));
|
|---|
| 39 | // }
|
|---|
| 40 |
|
|---|
| 41 | // private void setAcqiredRDFFiles(File data) throws Exception{
|
|---|
| 42 | // StructureCrawler sc = new StructureCrawler(data);
|
|---|
| 43 | // acquiredRDFFiles = sc.getAcquiredStructureFiles();
|
|---|
| 44 | // }
|
|---|
| 45 |
|
|---|
| 46 | public String[] getEndpointURIList(){
|
|---|
| 47 | return metadataManager.getURIList();
|
|---|
| 48 | }
|
|---|
| 49 |
|
|---|
| 50 | public CrawledMetadata[] getMetadataFiles(){
|
|---|
| 51 | return metadataManager.getCrawlerMetadataList();
|
|---|
| 52 | }
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 | public RDFSchemaAnalyzer create(String uri) throws Exception{
|
|---|
| 56 | CrawledMetadata crawledMetadata = metadataManager.getCrawledMetadata(uri);
|
|---|
| 57 | if( crawledMetadata == null ){
|
|---|
| 58 | return new EndpointAnalyzer(uri);
|
|---|
| 59 | }else{
|
|---|
| 60 | return new AcquiredStructureAnalyzer(crawledMetadata);
|
|---|
| 61 | }
|
|---|
| 62 | }
|
|---|
| 63 | }
|
|---|