チェンジセット 272 : SPARQLBuilderWWW2016/src/java
- 更新日時:
- 2016/03/15 15:26:22 (9 年 前)
- パス:
- SPARQLBuilderWWW2016/src/java/org/biohackathon/SPARQLBuilder/OWL
- ファイル:
-
- 3 変更
凡例:
- 変更なし
- 追加
- 削除
-
SPARQLBuilderWWW2016/src/java/org/biohackathon/SPARQLBuilder/OWL/AcquiredStructureAnalyzer.java
r271 r272 5 5 import org.biohackathon.SPARQLBuilder.endpointMetadata.MetadataManager; 6 6 7 import jp.riken.accc.db.sparqlBuilderMetadata.crawler.dataStructure.sparql.JenaModelGenerator;8 import jp.riken.accc.db.sparqlBuilderMetadata.crawler.dataStructure.sparql.URICollection;9 7 import jp.riken.accc.db.sparqlBuilderMetadata.crawler.dataStructure.sparql.crawler.ClassPartition; 10 8 import jp.riken.accc.db.sparqlBuilderMetadata.crawler.dataStructure.sparql.crawler.ClassRelation; … … 14 12 import jp.riken.accc.db.sparqlBuilderMetadata.crawler.dataStructure.sparql.crawler.PropertyPartition; 15 13 16 import com.hp.hpl.jena.query.Query;17 import com.hp.hpl.jena.query.QueryExecution;18 import com.hp.hpl.jena.query.QueryExecutionFactory;19 import com.hp.hpl.jena.query.QueryFactory;20 import com.hp.hpl.jena.query.QuerySolution;21 import com.hp.hpl.jena.query.ResultSet;22 import com.hp.hpl.jena.rdf.model.Literal;23 import com.hp.hpl.jena.rdf.model.Model;24 import com.hp.hpl.jena.rdf.model.Property;25 import com.hp.hpl.jena.rdf.model.Resource;26 14 27 15 //public class OWLQueryBuilderForCrawlerImpl implements OWLQueryBuilder { … … 85 73 // default 86 74 Dataset dataset = cm.getDefaultDataset(); 87 List<SClass> tempClassList = getOWLClassList( dataset, keywords, language);75 List<SClass> tempClassList = getOWLClassList(endpointURI, null, dataset, keywords, language); 88 76 for(SClass sClass: tempClassList){ 89 77 classList.add(sClass); … … 95 83 for(String graphURI: graphURIs){ 96 84 dataset = cm.getDataset(graphURI); 97 tempClassList = getOWLClassList( dataset, keywords, language);85 tempClassList = getOWLClassList(endpointURI, graphURI, dataset, keywords, language); 98 86 for(SClass sClass: tempClassList){ 99 87 classList.add(sClass); … … 105 93 } 106 94 107 private List<SClass> getOWLClassList( Dataset dataset, String[] keywords, String language) throws Exception{95 private List<SClass> getOWLClassList(String endpointURI, String graphURI, Dataset dataset, String[] keywords, String language) throws Exception{ 108 96 ArrayList<SClass> results = new ArrayList<SClass>(); 109 97 … … 127 115 128 116 if( keywords == null || keywords.length == 0 ){ 129 SClass sClass = new SClass(classURI, labels, entities );117 SClass sClass = new SClass(classURI, labels, entities, endpointURI, graphURI); 130 118 results.add(sClass); 131 119 }else{ … … 145 133 } 146 134 if( hit ){ 147 SClass sClass = new SClass(classURI, labels, entities );135 SClass sClass = new SClass(classURI, labels, entities, endpointURI, graphURI); 148 136 results.add(sClass); 149 137 } -
SPARQLBuilderWWW2016/src/java/org/biohackathon/SPARQLBuilder/OWL/RDFSchemaAnalyzerFactory.java
r271 r272 8 8 9 9 private MetadataManager metadataManager = null; 10 private static final String FILENAME = "C:\\cdata"; 11 10 private static final String FILENAME = "C:\\home\\kobayashi"; 11 12 13 public static void main(String[] args) throws Exception{ 14 RDFSchemaAnalyzerFactory factory = new RDFSchemaAnalyzerFactory(); 15 RDFSchemaAnalyzer analyzer = factory.create(); 16 SClass[] sClassList = analyzer.getOWLClasses(null, null); 17 for(SClass sClass: sClassList){ 18 System.out.println(sClass.getClassURI()); 19 } 20 } 21 12 22 public RDFSchemaAnalyzerFactory(String fileName){ 13 23 try{ -
SPARQLBuilderWWW2016/src/java/org/biohackathon/SPARQLBuilder/OWL/SClass.java
r267 r272 8 8 private int numOfInstances; 9 9 private HashSet<Label> labels; 10 private String endpointURI = null; 11 private String graphURI = null; 10 12 11 13 /** … … 19 21 * @since 28.01.2014 20 22 */ 21 public SClass(String classURI, Label[] labels, int numOfInstances ) {23 public SClass(String classURI, Label[] labels, int numOfInstances, String endpointURI, String graphURI) { 22 24 this.classURI = classURI; 23 25 this.numOfInstances = numOfInstances; 24 26 setLabels(labels); 27 this.endpointURI = endpointURI; 28 this.graphURI = graphURI; 25 29 } 26 30 … … 82 86 } 83 87 88 public final String getEndpointURI() { 89 return endpointURI; 90 } 91 92 public final void setEndpointURI(String endpointURI) { 93 this.endpointURI = endpointURI; 94 } 95 96 public final String getGraphURI() { 97 return graphURI; 98 } 99 100 public final void setGraphURI(String graphURI) { 101 this.graphURI = graphURI; 102 } 103 104 105 84 106 }