チェンジセット 173 : SPARQLBuilderWWW/src/java/org
- 更新日時:
- 2014/09/26 10:09:41 (10 年 前)
- パス:
- SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/OWL
- ファイル:
-
- 2 変更
凡例:
- 変更なし
- 追加
- 削除
-
SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/OWL/AcquiredStructureAnalyzer.java
r133 r173 35 35 36 36 public static void main(String[] args) throws Exception{ 37 JenaModelGenerator jmGene = new JenaModelGenerator("c:\\temp\\reactomeF18s.ttl"); 37 38 JenaModelGenerator jmGene = new JenaModelGenerator("c:\\temp\\biosamplesF11.ttl"); 39 // JenaModelGenerator jmGene = new JenaModelGenerator("c:\\temp\\reactomeF18s.ttl"); 38 40 AcquiredStructureAnalyzer impl 39 41 = new AcquiredStructureAnalyzer(jmGene.getEndpointURI(), jmGene.getGraphURIs(), jmGene.getModel()); 40 // System.out.println("--------------------------"); 41 // SClass[] scs = impl.getOWLClasses(null, null, null, true); 42 // System.out.println("list classes:---------------"); 43 // for(SClass sc: scs){ 44 // System.out.println(sc.toString()); 42 43 System.out.println("--------------------------"); 44 SClass[] scs = impl.getOWLClasses(null, null, null, true); 45 System.out.println("list classes:---------------"); 46 for(SClass sc: scs){ 47 System.out.println(sc.toString()); 48 } 49 System.out.println("--------------------------"); 50 51 // ClassLink[] cls = impl.getNextClass(null,"http://www.biopax.org/release/biopax-level3.owl#Protein",100,true ); 52 // for(ClassLink cl: cls){ 53 // System.out.println(cl.toString()); 45 54 // } 46 55 // System.out.println("--------------------------"); 47 48 ClassLink[] cls = impl.getNextClass(null,"http://www.biopax.org/release/biopax-level3.owl#Protein",100,true );49 for(ClassLink cl: cls){50 System.out.println(cl.toString());51 }52 System.out.println("--------------------------");53 56 54 57 } … … 217 220 queryStr.append(" {"); 218 221 queryStr.append(" ?cr <").append(URICollection.PROPERTY_SB_OBJECT_CLASS).append("> <" + originClass + ">. \n"); 219 queryStr.append(" ?cr <").append(URICollection.PROPERTY_SB_SUBJECT_CLASS).append("> ? d. \n");222 queryStr.append(" ?cr <").append(URICollection.PROPERTY_SB_SUBJECT_CLASS).append("> ?c. \n"); 220 223 queryStr.append(" ?cr <").append(URICollection.PROPERTY_VOID_DISTINCT_SUBJECTS).append("> ?numLnkInsEnd. \n"); 221 224 queryStr.append(" ?cr <").append(URICollection.PROPERTY_VOID_DISTINCT_OBJECTS).append("> ?numLnkInsStart. \n"); … … 277 280 if(ccls != null && dcls == null ){ 278 281 // direction forward 279 direction = Direction. forward;282 direction = Direction.reverse; 280 283 clsURI = ccls.getURI(); 281 284 }else{ 282 285 if( ccls == null && dcls != null ){ 283 direction = Direction. reverse;286 direction = Direction.forward; 284 287 clsURI = dcls.getURI(); 285 288 }else{ -
SPARQLBuilderWWW/src/java/org/biohackathon/SPARQLBuilder/OWL/OWLClassGraph.java
r161 r173 26 26 ClassLink classLink; 27 27 List<ClassLink> path; 28 boolean converge;28 //boolean converge; 29 29 30 30 public LinkAndPath(ClassLink classLink, List<ClassLink> path){ 31 31 this.classLink = classLink; 32 32 this.path = path; 33 this.converge = false;34 } 35 36 public LinkAndPath(ClassLink classLink, List<ClassLink> path, String originalClassURI , boolean converge){33 //this.converge = false; 34 } 35 36 public LinkAndPath(ClassLink classLink, List<ClassLink> path, String originalClassURI){ 37 37 this.classLink = classLink; 38 38 this.path = path; 39 39 this.originalClassURI = originalClassURI; 40 this.converge = converge;40 //this.converge = converge; 41 41 } 42 42 } … … 87 87 List<List<ClassLink>> paths = new ArrayList<>(); 88 88 List<LinkAndPath> lp = new LinkedList<>(); 89 lp.add(new LinkAndPath(new ClassLink("",startClass,null,Direction.both,0,0,0,0,0,false,false), new LinkedList<ClassLink>(), "" , false));89 lp.add(new LinkAndPath(new ClassLink("",startClass,null,Direction.both,0,0,0,0,0,false,false), new LinkedList<ClassLink>(), "")); 90 90 try{ 91 91 for ( int i = 0; i < nsteps; i++ ){ … … 94 94 while ( lit.hasNext() ){ 95 95 LinkAndPath crrlp = lit.next(); 96 /*if ( crrlp.classLink.getLinkedClassURI().equals("http://www.biopax.org/release/biopax-level3.owl#Pathway") ){ 97 System.out.println("here!"); 98 }*/ 96 99 ClassLink[] classLinks = rdfsa.getNextClass(null, crrlp.classLink.getLinkedClassURI(), limit, countLinks); 97 100 for ( int j = 0 ; j < classLinks.length; j++ ){ 101 /*if ( classLinks[j].getLinkedClassURI().endsWith("http://www.biopax.org/release/biopax-level3.owl#BiochemicalReaction") ){ 102 ClassLink cltmp = classLinks[j]; 103 }*/ 98 104 List<ClassLink> crrpath = new LinkedList<>(crrlp.path); 99 105 crrpath.add(classLinks[j]); … … 118 124 } 119 125 } 120 121 nextlp.add(new LinkAndPath(classLinks[j], crrpath, crrlp.classLink.getLinkedClassURI(), false)); 126 /* 127 if ( classLinks[j].getDirection() != Direction.reverse ){ 128 System.out.println("here b"); 129 }*/ 130 131 nextlp.add(new LinkAndPath(classLinks[j], crrpath, crrlp.classLink.getLinkedClassURI())); 122 132 } 123 133 }