| 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 jp.riken.accc.db.rdf.crawler.dataStructure.sparql.JenaModelGenerator;
|
|---|
| 8 |
|
|---|
| 9 | public class RDFSchemaAnalyzerFactory {
|
|---|
| 10 |
|
|---|
| 11 | private Map<String, String> acquiredRDFFiles = null;
|
|---|
| 12 |
|
|---|
| 13 | public void setAcqiredRDFFiles(File data) throws Exception{
|
|---|
| 14 | StructureCrawler sc = new StructureCrawler(data);
|
|---|
| 15 | acquiredRDFFiles = sc.getAcquiredStructureFiles();
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | public String[] getEndpointURIList(){
|
|---|
| 19 | if( acquiredRDFFiles == null ){
|
|---|
| 20 | return new String[0];
|
|---|
| 21 | }else{
|
|---|
| 22 | return acquiredRDFFiles.keySet().toArray(new String[0]);
|
|---|
| 23 | }
|
|---|
| 24 | }
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 | public RDFSchemaAnalyzer create(String uri) throws Exception{
|
|---|
| 28 | if( acquiredRDFFiles == null || !acquiredRDFFiles.containsKey(uri)){
|
|---|
| 29 | return new EndpointAnalyzer(uri);
|
|---|
| 30 | }else{
|
|---|
| 31 | JenaModelGenerator jmGene = new JenaModelGenerator(acquiredRDFFiles.get(uri));
|
|---|
| 32 | return new AcquiredStructureAnalyzer(jmGene.getEndpointURI(), jmGene.getGraphURIs(), jmGene.getModel());
|
|---|
| 33 | }
|
|---|
| 34 | }
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 | }
|
|---|