チェンジセット 125 : BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/AcquiredStructureAnalyzer.java
- 更新日時:
- 2014/07/22 14:38:34 (10 年 前)
- ファイル:
-
- 1 変更
凡例:
- 変更なし
- 追加
- 削除
-
BH13SPARQLBuilder/src/org/biohackathon/SPARQLBuilder/OWL/AcquiredStructureAnalyzer.java
r112 r125 5 5 6 6 import jp.riken.accc.db.rdf.crawler.dataStructure.sparql.JenaModelGenerator; 7 import jp.riken.accc.db.rdf.crawler.dataStructure.sparql.URICollection; 7 8 8 9 import com.hp.hpl.jena.query.Query; … … 34 35 35 36 public static void main(String[] args) throws Exception{ 36 JenaModelGenerator jmGene = new JenaModelGenerator("c:\\ cdata\\allie.ttl");37 JenaModelGenerator jmGene = new JenaModelGenerator("c:\\temp\\reactomeF18s.ttl"); 37 38 AcquiredStructureAnalyzer impl 38 39 = new AcquiredStructureAnalyzer(jmGene.getEndpointURI(), jmGene.getGraphURIs(), jmGene.getModel()); … … 45 46 System.out.println("--------------------------"); 46 47 47 ClassLink[] cls = impl.getNextClass(null,"http://purl.org/allie/ontology/201108#ShortForm",100,true );48 for(ClassLink cl: cls){49 System.out.println(cl.toString());50 }51 System.out.println("--------------------------");48 // ClassLink[] cls = impl.getNextClass(null,"http://purl.org/allie/ontology/201108#ShortForm",100,true ); 49 // for(ClassLink cl: cls){ 50 // System.out.println(cl.toString()); 51 // } 52 // System.out.println("--------------------------"); 52 53 53 54 } … … 80 81 queryStr.append("PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n"); 81 82 queryStr.append("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n"); 82 queryStr.append("SELECT DISTINCT ?c ?pLabel ? numOfInstances\n");83 queryStr.append("SELECT DISTINCT ?c ?pLabel ?entities\n"); 83 84 // if (targetGraphURIs != null) { 84 85 // for (String graphURI : targetGraphURIs) { … … 89 90 // } 90 91 queryStr.append("WHERE{\n"); 91 queryStr.append(" ?c rdf:type rdfs:Class. \n"); 92 queryStr.append(" ?c <http://sparqlbuilder.org/numberOfInstances> ?numOfInstances. \n"); 93 queryStr.append(" OPTIONAL{ ?c rdfs:label ?pLabel. }\n"); 92 queryStr.append(" ?cp <").append(URICollection.PROPERTY_VOID_CLASS).append("> ?c. \n"); 93 queryStr.append(" ?cp <"); 94 queryStr.append(URICollection.PROPERTY_VOID_ENTITIES); 95 queryStr.append("> ?entities. \n"); 96 queryStr.append(" OPTIONAL{ ?c <"); 97 queryStr.append(URICollection.PROPERTY_RDFS_LABEL); 98 queryStr.append("> ?pLabel. }\n"); 94 99 95 100 if (keywords != null && keywords.length != 0) {