Index: BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/StructureCrawler.java
===================================================================
--- BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/StructureCrawler.java (revision 85)
+++ BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/StructureCrawler.java (revision 85)
@@ -0,0 +1,110 @@
+package org.biohackathon.SPARQLBuilder.OWL;
+
+import java.io.File;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import jp.riken.accc.db.rdf.crawler.dataStructure.SchemaCategory;
+import jp.riken.accc.db.rdf.crawler.dataStructure.sparql.JenaModelGenerator;
+import jp.riken.accc.db.rdf.crawler.dataStructure.sparql.RDFsCrawlerImpl;
+
+public class StructureCrawler {
+
+	private File dataDir = null;
+
+	public static void main(String[] args) throws Exception{
+		StructureCrawler sc = new StructureCrawler(new File("c:\\temp"));
+		sc.crawl("http://data.allie.dbcls.jp/sparql", "allie.ttl");
+		
+		Map<String,String> acTable = sc.getAcquiredStructureFiles();
+		Set<String> keySet = acTable.keySet();
+		for(String key: keySet){
+			String val = acTable.get(key);
+			System.out.println("File: " + key + " --- " + val);
+		}
+	}
+	
+	
+	
+	public Map<String, String> getAcquiredStructureFiles(){
+		Map<String, String> table = new HashMap<String, String>();
+		if( dataDir.isDirectory() ){
+			// read files
+			File[] files = dataDir.listFiles();
+			for(File file: files){
+				String uri = null;
+				try{
+					JenaModelGenerator jmGene = new JenaModelGenerator(file.getAbsolutePath());
+					uri = jmGene.getEndpointURI();
+				}catch(Exception ex){
+					//
+				}
+				if( uri != null ){
+					table.put(uri, file.getAbsolutePath());
+				}
+			}
+		}else{
+			if( dataDir.isFile() ){
+				String uri = null;
+				try{
+					JenaModelGenerator jmGene = new JenaModelGenerator(dataDir.getAbsolutePath());
+					uri = jmGene.getEndpointURI();
+				}catch(Exception ex){
+					//
+				}
+				if( uri != null ){
+					table.put(uri, dataDir.getAbsolutePath());
+				}
+			}
+		}
+		return table;
+	}
+	
+	
+	
+	public StructureCrawler(File dataDir) throws Exception {
+		this.dataDir = dataDir;
+	}
+
+	public void crawl(String endPURI, String outFileName) throws Exception {
+		RDFsCrawlerImpl impl = new RDFsCrawlerImpl(endPURI);
+		// Resource[] res = impl.getRDFProperties();
+		// Resource[] res = impl.getInferedRDFsClassesFromInstances();
+		// Resource[] res = impl.getDomainRangeDeclaredRDFProperties();
+		// Resource[] res = impl.getDeclaredRDFsClasses();
+		// for(Resource r: res){
+		// System.out.println(r.getURI().toString());
+		// }
+		// Model model = impl.getProperiesFromDomainRangeDecls();
+		// Model model = impl.getPropertiesFromInstanceDecls();
+		// RDFWriter writer = model.getWriter("N3");
+		// writer.setProperty("showXMLDeclaration","true");
+		// writer.write(model,System.out,"");
+		// model.close();
+
+		SchemaCategory sc = impl.determineSchemaCategory();
+
+		// RDF/XML, RDF/XML-ABBREV, N-TRIPLE, N3
+		String tFileName = null;
+		if (outFileName == null) {
+			if (endPURI.lastIndexOf("/", endPURI.length() - 2) > 0) {
+				tFileName = endPURI.substring(
+						endPURI.lastIndexOf("/", endPURI.length() - 2) + 1,
+						endPURI.length());
+			} else {
+				tFileName = endPURI;
+			}
+		} else {
+			tFileName = outFileName;
+			File outFile = new File(dataDir, tFileName);
+			if (outFile.exists()) {
+				outFile = File.createTempFile(tFileName, "", dataDir);
+			}
+			sc.write2File(outFile.getAbsolutePath(), "Turtle");
+			// System.out.println("Category:" + sc.getCategory());
+		}
+
+	}
+
+}
Index: BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/RDFSchemaAnalyzerFactory.java
===================================================================
--- BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/RDFSchemaAnalyzerFactory.java (revision 81)
+++ BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/RDFSchemaAnalyzerFactory.java (revision 85)
@@ -11,37 +11,9 @@
 	private Map<String, String> acquiredRDFFiles = null;
 
-	public void setAcqiredRDFFiles(File data){
-		if( data.isDirectory() ){
-			// read files
-			File[] files = data.listFiles();
-			acquiredRDFFiles = new HashMap<String, String>();
-			for(File file: files){
-				String uri = null;
-				try{
-					JenaModelGenerator jmGene = new JenaModelGenerator(file.getAbsolutePath());
-					uri = jmGene.getEndpointURI();
-				}catch(Exception ex){
-					//
-				}
-				if( uri != null ){
-					acquiredRDFFiles.put(uri, data.getAbsolutePath());
-				}
-			}
-		}else{
-			if( data.isFile() ){
-				String uri = null;
-				try{
-					JenaModelGenerator jmGene = new JenaModelGenerator(data.getAbsolutePath());
-					uri = jmGene.getEndpointURI();
-				}catch(Exception ex){
-					//
-				}
-				if( uri != null ){
-					acquiredRDFFiles = new HashMap<String, String>();
-					acquiredRDFFiles.put(uri, data.getAbsolutePath());
-				}
-			}
-		}
+	public void setAcqiredRDFFiles(File data) throws Exception{
+		StructureCrawler sc = new StructureCrawler(data);
+		acquiredRDFFiles = sc.getAcquiredStructureFiles();
 	}
+	
 	
 	public RDFSchemaAnalyzer create(String uri) throws Exception{
