Index: SPARQLBuilderWWW/web/newsparqlbuilder.js
===================================================================
--- SPARQLBuilderWWW/web/newsparqlbuilder.js (revision 238)
+++ SPARQLBuilderWWW/web/newsparqlbuilder.js (revision 239)
@@ -3,5 +3,5 @@
 var MAXDEPTH = 0;
 var TREESPACE = 0;
-var NODEHEIGHT = 0;
+var NODEHEIGHT = 50;
 var DRAWHEIGHT = 0;
 
@@ -37,5 +37,5 @@
 	var sbdiv = $('div#SPARQLBUILDER');
 	if(sbdiv.find('div').length == 0){
-		var sbtop = '<div class="SBTopItems"><input type="button" class="SBTopButton" value="Open SPARQLBuilder" onclick="openSPARQLBuilder()"><input type="button" class="SBTopButton" value="Try with Sample" onclick="openSample(\'http://www.ebi.ac.uk/rdf/services/reactome/sparql\', \'http://www.biopax.org/release/biopax-level3.owl#Protein\', \'http://www.biopax.org/release/biopax-level3.owl#Pathway\')"><br><textarea class="SBSparqlArea" rows="10"></textarea><br><input type="button" class="SBTopButton" value="Send SPARQL" onclick="sendSPARQL()"><input type="button" class="SBTopButton" value="Download Result" onclick="downloadResult()"></div>';
+		var sbtop = '<div class="SBTopItems"><input type="button" class="SBTopButton" value="Open SPARQLBuilder" onclick="openSPARQLBuilder()"><input type="button" class="SBTopButton" value="Try with Sample" onclick="openSample(\'http://www.ebi.ac.uk/rdf/services/reactome/sparql\', \'http://www.biopax.org/release/biopax-level3.owl#Protein\', \'http://www.biopax.org/release/biopax-level3.owl#Pathway\')"><br><textarea class="SBSparqlArea" rows="10"></textarea><br><input type="button" class="SBTopButton" value="Send SPARQL" onclick="sendSPARQL()"><input type="button" class="SBTopButton" value="Download Result" onclick="downloadResult()"></div><div class="SBTutorialLink">Tutorial for SPARQL Builder GUI is <a href="http://www.sparqlbuilder.org/doc/how-to-use-sparql-builder-gui/">here</a>.</div>';
 		var sbmodal = '<div class="SBModalView"><div class="SBModalContents"><div class="SBForms"><div class="SBSelects"><select class="SBEndPointSelect"></select><select class="SBStartClassSelect"></select><select class="SBEndClassSelect"></select></div><div class="SBPermaLink"><input type="button" class="SBPermaLinkButton" value="Permalink" onclick="openPermalink()" disabled="disabled"></div></div><div class="SBMessage"><div class="SBResult"><span class="SBPathnum"></span> Path<span class="SBPlural"></span> found.</div><input type="button" class="SBViewAll" value="View All Path" onclick="viewAll()"></div><div class="SBGraph"><div class="SBAjaxLoad" style="display: none;"><div class="SBLoadIcon"><img src="images/ajax-loader.gif"></div></div></div><div class="SBPath"><div class="SBSelectedPath"></div></div><div class="SBModalButtons"><input type="button" class="SBModalButton" value="Close" onclick="closeSPARQLBuilder()"></div></div></div>';
 
@@ -261,10 +261,10 @@
 	$('.SBResult').hide();
 	$('.SBViewAll').hide();
-	$('.SBSelectedPath').html('<h1>Please <span style="color: hsl(150, 50%, 75%);">select a leaf node</span> and <span style=\"color: hsl(200, 50%, 75%);\">push button</span> to generate a SPARQL</h1><img src=\"images/pathline.png\" style="display:none;">');
+	$('.SBSelectedPath').html('<h1>Please <span style="color: hsl(150, 50%, 75%);">select a leaf node</span> and click to generate a SPARQL</h1><img src=\"images/pathline.png\" style="display:none;">');
 
 	var url = "http://www.sparqlbuilder.org/api/plist?ep=" + encodeURIComponent(endpoint)
 															+ "&startclass=" + encodeURIComponent(startclass)
 															+ "&endclass="   + encodeURIComponent(endclass);
-	//var self = this;
+
 	switchLoadIcon("view");
 	setTimeout(function(){
@@ -389,5 +389,5 @@
 
 	// make_data繝｡繧ｽ繝�ラ縺ｮ邨先棡繧貞叙蠕�
-	var json = make_data(0);
+	var json = make_data();
 
 	// 繝代せ謨ｰ縺�縺ｧ縺ｪ縺代ｌ縺ｰ
@@ -477,5 +477,12 @@
 			.style("stroke", '#fafafa')
 			.style("stroke-width", '1.5px')
-			.style("cursor", 'pointer');
+			// 譛ｫ遶ｯ繝弱�繝峨�縺ｿ繝槭え繧ｹ繧｢繧､繧ｳ繝ｳ繧偵�繧､繝ｳ繧ｿ繝ｼ縺ｫ
+			.style("cursor", function(d){
+				if(d.path == "notend"){
+					return 'normal';
+				}else{
+					return 'pointer';
+				}
+			});
 
 		// nodes驟榊�繧呈ｸ｡縺励ヮ繝ｼ繝峨ユ繧ｭ繧ｹ繝医�菴懈�
@@ -507,5 +514,5 @@
 			.attr("class", "tscore")
 			.attr("x", function(d) { return (d.x + scoreleftmargin); })
-			.attr("y", function(d) { return d.y; })
+			.attr("y", function(d) { return d.y + 4; })
 			.text(function(d) { return d.score; })
 			.style("fill", '#ff0000')
@@ -544,10 +551,10 @@
 			if(d.nodeid == 0 || d.path == "notend"){
 				// 繝代せ陦ｨ遉ｺ鬆伜沺繧偵ョ繝輔か繝ｫ繝医↓
-				$('.SBSelectedPath').html('<h1>Please <span style="color: hsl(150, 50%, 75%);">select a leaf node</span> and <span style=\"color: hsl(200, 50%, 75%);\">push button</span> to generate a SPARQL</h1>');
+				$('.SBSelectedPath').html('<h1>Please <span style="color: hsl(150, 50%, 75%);">select a leaf node</span> and click to generate a SPARQL</h1>');
 			// 譛ｫ遶ｯ繝弱�繝峨↑繧�
 			}else{
 
-				// 繝代せ陦ｨ遉ｺ鬆伜沺逕ｨ譁�ｭ怜��医ず繧ｧ繝阪Ξ繝ｼ繝医�繧ｿ繝ｳ繧偵∪縺夊ｿｽ蜉��
-				var resultText = '<div class="SBGenButton" onclick="generateSPARQL()">Generate<br />SPARQL</div>';
+				// 繝代せ陦ｨ遉ｺ鬆伜沺逕ｨ譁�ｭ怜�
+				var resultText = '';
 				// 繝代せ縺ｮ蜷榊燕驟榊�蛻�ｾ後ｍ縺九ｉ郢ｰ繧願ｿ斐＠縺ｪ縺後ｉ
 				for (var i = pathname.length;i > 0; i--){
@@ -645,10 +652,10 @@
 				});
 
-            // 蜷�Μ繝ｳ繧ｯ縺ｫ蟇ｾ縺�
-            link
-                // 邱壹�濶ｲ蛻､螳�
-                .style("stroke", function(d){
-
-                	var strokecolor = "#999";
+			// 蜷�Μ繝ｳ繧ｯ縺ｫ蟇ｾ縺�
+			link
+				// 邱壹�濶ｲ蛻､螳�
+				.style("stroke", function(d){
+
+					var strokecolor = "#999";
 
 					// 繝代せ縺ｮ繝弱�繝画焚縺縺醍ｹｰ繧願ｿ斐＠縺ｪ縺後ｉ
@@ -661,286 +668,238 @@
 					}
 
+					// 邱壹�濶ｲ繧定ｿ斐☆
 					return strokecolor;
-                });
-
-            // 縺薙％縺ｾ縺ｧ縺ｮ險ｭ螳壹ｒ蜈�↓蜀肴緒逕ｻ
-            redraw();
-
-        // 繝弱�繝峨∈縺ｮ繧ｯ繝ｪ繝�け縺ｧ驕ｸ謚槫崋螳壼喧�亥所縺ｳ謚倥ｊ逡ｳ縺ｿ蜃ｦ逅�ｼ�
-        }).on("click", function(d){
-
-            // 蜷�ヮ繝ｼ繝峨↓蟇ｾ縺�
-            node
-                // 霈ｪ驛ｭ邱壹�蛻､螳�
-                .style("stroke", function(d) {
-                    // 繝�ヵ繧ｩ繝ｫ繝医�濶ｲ繧偵そ繝�ヨ
-                    var strokecolor = "#fafafa"
-                    // 陦ｨ遉ｺ繝輔Λ繧ｰ縺後が繝ｳ繝槭え繧ｹ荳ｭ繝ｻ蝗ｺ螳壻ｸｭ繝ｻ遘ｻ蜍穂ｸｭ�磯∈謚槭＆繧後※縺�ｋ繝弱�繝会ｼ峨↑繧峨�
-                    if(d.view == "now" || d.view == "clicked" || d.view == "moved"){
-                        // 濶ｲ繧定ｵ､縺ｫ
-                        strokecolor = "#ffaaaa"
-                        // 陦ｨ遉ｺ繝輔Λ繧ｰ繧貞崋螳壻ｸｭ縺ｫ
-                        d.view = "clicked";
-                    }
-                    // 縺薙％縺ｾ縺ｧ縺ｧ縺ｧ縺阪◆濶ｲ繧定ｿ斐☆
-                    return strokecolor;
-                });
-
-            // 蜷�Μ繝ｳ繧ｯ縺ｫ蟇ｾ縺�
-            tlink
-                // 繝�く繧ｹ繝郁｡ｨ遉ｺ蛻､螳�
-                .text(function(d) {
-                    // 繝�ヵ繧ｩ繝ｫ繝医〒遨ｺ縺ｫ
-                    var linktext = "";
-                    // 陦ｨ遉ｺ繝輔Λ繧ｰ縺檎樟蝨ｨ陦ｨ遉ｺ荳ｭ縺ｾ縺溘�蝗ｺ螳壼喧貂医∩縺ｪ繧峨��医°縺､謚倥ｊ逡ｳ縺ｿ荳ｭ縺ｧ縺ｪ縺代ｌ縺ｰ��
-                    if((d.view == "now" || d.view == "fix") && (node.data()[d.target].view != "hide")){
-                        // 繝ｪ繝ｳ繧ｯ繝�く繧ｹ繝医↓繝励Ο繝代ユ繧｣縺ｮ蛟､繧偵そ繝�ヨ
-                        linktext = d.property
-                        // 陦ｨ遉ｺ繝輔Λ繧ｰ繧貞崋螳壻ｸｭ縺ｫ
-                        d.view = "fix";
-                    }
-                    // 繝�く繧ｹ繝医ｒ霑斐☆
-                    return linktext;
-                });
-
-            // 縺薙％縺ｾ縺ｧ縺ｮ蜃ｦ逅�ｵ先棡繧貞�縺ｫ蜀肴緒逕ｻ
-            redraw();
-
-        });
-
-        // 蜀肴緒逕ｻ髢｢謨ｰ
-        var redraw = function (duration){
-
-            // 縺九￠繧区凾髢薙′譛ｪ謖�ｮ壹↑繧峨�
-            if(duration == undefined){
-                // 0.5遘偵°縺代※繧｢繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ
-                duration = 500;
-            }
-
-            // 蜷�Μ繝ｳ繧ｯ縺ｫ縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ
-            link
-                .transition()
-                .duration(duration)
-                .attr("x1", function(d) {return node.data()[d.source].x;})
-                .attr("y1", function(d) {return node.data()[d.source].y;})
-                .attr("x2", function(d) {return node.data()[d.target].x;})
-                .attr("y2", function(d) {return node.data()[d.target].y;});
-
-            // 蜷�ヮ繝ｼ繝峨↓縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ�医°縺､謚倥ｊ縺溘◆縺ｾ繧御ｸｭ縺ｮ蝣ｴ蜷医�謠冗判蛻�ｲ仙�逅�ｼ�
-            node
-                .transition()
-                .duration(duration)
-                .attr("cx", function(d) {return d.x;})
-                .attr("cy", function(d) {return d.y;});
-
-            // 蜷�ヮ繝ｼ繝峨ユ繧ｭ繧ｹ繝医↓縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ縲√ユ繧ｭ繧ｹ繝域緒逕ｻ菴咲ｽｮ繧剃ｸ贋ｸ九↓謖ｯ繧具ｼ医°縺､謚倥ｊ縺溘◆縺ｾ繧御ｸｭ縺ｮ蝣ｴ蜷医�謠冗判蛻�ｲ仙�逅�ｼ�
-            tnode
-            .transition()
-            .duration(duration)
-            .attr("x", function(d) {return d.x;})
-            .attr("y", function(d) {
-                // 繝�ヵ繧ｩ繝ｫ繝医〒蟆代＠荳九￡繧�
-                var updown = (self.NODEHEIGHT * 0.4);
-                // 螂�焚逡ｪ逶ｮ縺ｮ豺ｱ縺輔↑繧牙ｰ代＠荳翫￡繧�
-                if(d.group % 2 == 1){
-                    updown = -(self.NODEHEIGHT * 0.2);
-                }
-                // 縺昴�蛟､繧帝ｫ倥＆縺ｫ霑斐☆縺薙→縺ｧ繝�く繧ｹ繝域緒逕ｻ菴咲ｽｮ縺御ｺ偵＞驕輔＞縺ｫ縺ｪ繧�
-                return d.y + updown;
-            });
-
-            // 蜷�Μ繝ｳ繧ｯ繝�く繧ｹ繝医↓縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ
-            tlink
-                .transition()
-                .duration(duration)
-                .attr("x", function(d) {return (node.data()[d.source].x + node.data()[d.target].x) / 2;})
-                .attr("y", function(d) {return ((node.data()[d.source].y + node.data()[d.target].y) / 2) + 5;});
-
-        };
-
-        // 閭梧勹驛ｨ蛻�′繧ｯ繝ｪ繝�け縺輔ｌ縺溘ｉ陦ｨ遉ｺ縺ｮ蝗ｺ螳壼喧繧定ｧ｣髯､
-        bg.on("click", function() {
-            // 繝��繝ｫ繝√ャ繝励ｒ髱櫁｡ｨ遉ｺ
-            $('.SBTooltip').hide();
-            d3.selectAll(".node").style("stroke-width", function(d) { return '1.5px'; });
-            d3.selectAll(".node").style("stroke", function(d) { return '#ffffff'; });
-
-            // 蜷�ヮ繝ｼ繝峨�霈ｪ驛ｭ邱壹�濶ｲ繧偵ョ繝輔か繝ｫ繝医↓
-            node
-                .style("stroke", function(d){
-                    if(d.view != "hide"){
-                        d.view = "no";
-                    }
-                    return "#fafafa";
-                });
-
-            // 繝ｪ繝ｳ繧ｯ繝�く繧ｹ繝医ｒ蜈ｨ縺ｦ遨ｺ縺ｫ
-            tlink
-                .text(function(d) {
-                    d.view = "no";
-                    return "";
-                });
-
-            // 繝ｪ繝ｳ繧ｯ縺ｮ濶ｲ繧貞�縺ｦ繝�ヵ繧ｩ繝ｫ繝医↓
-            link
-                .style("stroke", function(d){
-                    return "#999";
-                });
-
-            /*
-            if(svg.attr("width") == width){
-	            svg.attr("width", (width / 5))
-	            .attr("height", (width * 9 / 16 / 5))
-	            .attr("viewBox", "0 0 " + width + " " + (width * 9 / 16));
-            }else{
-	            svg.attr("width", width)
-	            .attr("height", height)
-	            .attr("viewBox", "0 0 " + width + " " + height);
-            }
-            */
-
-        });
-
-        // 蛻晏屓縺ｮ縺ｿduration繧�縺ｨ謖�ｮ壹＠蜀肴緒逕ｻ�医い繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ縺ｪ縺暦ｼ�
-        redraw(0);
-
-    }else{
-        // SVG縺ｮ蜑企勁
-        d3.select(".SBGraph svg").remove();
-    }
+				});
+
+			// 縺薙％縺ｾ縺ｧ縺ｮ險ｭ螳壹ｒ蜈�↓蜀肴緒逕ｻ
+			redraw();
+
+		// 繧ｯ繝ｪ繝�け縺輔ｌ縺溘→縺�
+		}).on("click", function(d){
+			// 譛ｫ遶ｯ繝弱�繝峨↑繧峨せ繝代�繧ｯ繝ｫ逋ｺ陦�
+			if(d.path != "notend"){
+				generateSPARQL();
+			}
+		});
+
+		// 蜀肴緒逕ｻ髢｢謨ｰ
+		var redraw = function (duration){
+
+			// 縺九￠繧区凾髢薙′譛ｪ謖�ｮ壹↑繧峨�
+			if(duration == undefined){
+				// 0.5遘偵°縺代※繧｢繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ
+				duration = 500;
+			}
+
+			// 蜷�Μ繝ｳ繧ｯ縺ｫ縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ
+			link
+				.transition()
+				.duration(duration)
+				.attr("x1", function(d) {return node.data()[d.source].x;})
+				.attr("y1", function(d) {return node.data()[d.source].y;})
+				.attr("x2", function(d) {return node.data()[d.target].x;})
+				.attr("y2", function(d) {return node.data()[d.target].y;});
+
+			// 蜷�ヮ繝ｼ繝峨↓縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ
+			node
+				.transition()
+				.duration(duration)
+				.attr("cx", function(d) {return d.x;})
+				.attr("cy", function(d) {return d.y;});
+
+			// 蜷�ヮ繝ｼ繝峨ユ繧ｭ繧ｹ繝医↓縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ縲√ユ繧ｭ繧ｹ繝域緒逕ｻ菴咲ｽｮ繧剃ｸ贋ｸ九↓謖ｯ繧�
+			tnode
+				.transition()
+				.duration(duration)
+				.attr("x", function(d) {return d.x;})
+				.attr("y", function(d) {
+					// 繝�ヵ繧ｩ繝ｫ繝医〒蟆代＠荳九￡繧�
+					var updown = (NODEHEIGHT * 0.4);
+					// 螂�焚逡ｪ逶ｮ縺ｮ豺ｱ縺輔↑繧牙ｰ代＠荳翫￡繧�
+					if(d.group % 2 == 1){
+						updown = -(NODEHEIGHT * 0.2);
+					}
+					// 縺昴�蛟､繧帝ｫ倥＆縺ｫ霑斐☆縺薙→縺ｧ繝�く繧ｹ繝域緒逕ｻ菴咲ｽｮ縺御ｺ偵＞驕輔＞縺ｫ縺ｪ繧�
+					return d.y + updown;
+				});
+
+			// 蜷�Μ繝ｳ繧ｯ繝�く繧ｹ繝医↓縺､縺�※險ｭ螳壹＆繧後◆菴咲ｽｮ縺ｫ蜀肴緒逕ｻ
+			tlink
+				.transition()
+				.duration(duration)
+				.attr("x", function(d) {return (node.data()[d.source].x + node.data()[d.target].x) / 2;})
+				.attr("y", function(d) {return ((node.data()[d.source].y + node.data()[d.target].y) / 2) + 4;});
+
+		};
+
+		// 蛻晏屓縺ｮ縺ｿduration繧�縺ｨ謖�ｮ壹＠蜀肴緒逕ｻ�医い繝九Γ繝ｼ繧ｷ繝ｧ繝ｳ縺ｪ縺暦ｼ�
+		redraw(0);
+
+	}else{
+		// SVG縺ｮ蜑企勁
+		d3.select(".SBGraph svg").remove();
+	}
 };
 
-make_data = function(tdepth, ret, parent, depth){
-	// ret縺梧悴螳夂ｾｩ縺ｪ繧峨�螳夂ｾｩ縺励※莉｣蜈･
-	if (ret == undefined){
-		ret = new Object();
-		ret['nodes'] = new Array();
-		ret['links'] = new Array();
-	}
-
+
+// 繝��繧ｿ菴懈�繝｡繧ｽ繝�ラ
+make_data = function(){
+
+	// 邨先棡逕ｨ繧ｪ繝悶ず繧ｧ繧ｯ繝医ｒ蛻晄悄蛹�
+	ret = new Object();
+	ret['nodes'] = new Array();
+	ret['links'] = new Array();
+
+	// 蜷�ｨｮ螟画焚縺ｮ蛻晄悄蛹�
 	PATHNUM = 0;
 	MAXDEPTH = 0;
 	TREESPACE = 0;
-	NODEHEIGHT = 50;
 	DRAWHEIGHT = NODEHEIGHT;
 
+	// 陦ｨ遉ｺ縺吶ｋ繝代せ謨ｰ
 	var viewnum;
 
+	// jsontext繧貞叙蠕�
 	var obj = jsontext;
 
+	// 邨先棡繝代せ謨ｰ縺ｮ繧ｹ繧ｿ繧､繝ｫ繧偵Μ繧ｻ繝�ヨ
 	$('.SBResult').css('color', 'black').css('font-weight', 'normal').css('margin-top', '4px');
 
+	// 隍�焚蠖｢縺ｮs繧偵▽縺代ｋ
 	$('.SBPlural').text('s');
 
+	// 繝代せ縺ｮ謨ｰ縺�縺縺｣縺溘ｉ
 	if(obj.length == 0){
+		// 邨先棡繝代せ謨ｰ縺ｮ繧ｹ繧ｿ繧､繝ｫ繧定ｵ､縺ｮ螟ｪ蟄励↓縺鈴伜沺蜀�ｸ贋ｸ倶ｸｭ螟ｮ縺ｫ
 		$('.SBResult').css('color', 'red').css('font-weight', 'bold').css('margin-top', '20px');
+		// 隍�焚蠖｢縺ｮs繧貞炎髯､
 		$('.SBPlural').text('');
+	// 繝代せ謨ｰ縺�縺ｪ繧�
 	}else if(obj.length == 1){
+		// 隍�焚蠖｢縺ｮs繧貞炎髯､
 		$('.SBPlural').text('');
 	}
 
+	// 繝代せ縺ｮ謨ｰ縺悟香莉･荳九↑繧�
 	if(obj.length <= 10){
+		// 陦ｨ遉ｺ謨ｰ繧偵ヱ繧ｹ謨ｰ縺ｫ
 		viewnum = obj.length;
+		// 邨先棡繝代せ謨ｰ縺ｮ繧ｹ繧ｿ繧､繝ｫ繧帝伜沺蜀�ｸ贋ｸ倶ｸｭ螟ｮ縺ｫ
 		$('.SBResult').css('margin-top', '20px');
+		// 蜈ｨ陦ｨ遉ｺ繝懊ち繝ｳ繧帝國縺�
 		$('.SBViewall').hide();
+	// 繝ｪ繝溘ャ繝医′10縺ｪ繧峨�
 	}else if(pathlimit == 10){
+		// 陦ｨ遉ｺ繝代せ謨ｰ繧�0縺ｫ
 		viewnum = 10;
+		// 蜈ｨ陦ｨ遉ｺ繝懊ち繝ｳ繧貞�縺�
 		$('.SBViewall').show();
+	// 繝ｪ繝溘ャ繝医′縺ｪ縺代ｌ縺ｰ
 	}else{
+		// 陦ｨ遉ｺ繝代せ謨ｰ繧貞�繝代せ謨ｰ縺ｫ
 		viewnum = obj.length;
+		// 邨先棡繝代せ謨ｰ縺ｮ繧ｹ繧ｿ繧､繝ｫ繧帝伜沺蜀�ｸ贋ｸ倶ｸｭ螟ｮ縺ｫ
 		$('.SBResult').css('margin-top', '20px');
+		// 蜈ｨ陦ｨ遉ｺ繝懊ち繝ｳ繧帝國縺�
 		$('.SBViewall').hide();
 	}
 
+	// 邨先棡繝代せ謨ｰ縺ｮ蛟､繧呈峩譁ｰ
 	$('.SBPathnum').text(obj.length);
+	// 邨先棡繝代せ謨ｰ繧定｡ｨ遉ｺ
 	$('.SBResult').show();
 
-    // obj繝医ャ繝鈴嚴螻､縺ｮ謨ｰ縺縺醍ｹｰ繧願ｿ斐＠縺ｪ縺後ｉ
-    for(var i = 0; i < viewnum; i++){
-        if(i == 0){
-            // 蛻晏屓縺縺代Ν繝ｼ繝医ヮ繝ｼ繝峨ｒ繝励ャ繧ｷ繝･
-            ret['nodes'].push({'name': obj[0]['label'], 'uri': obj[0]['startClass'], 'group': 0, 'x':50, 'y':50, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend', 'nodecolor': 'hsl(40, 50%, 75%)'});
-        }
-        // 蜈医↓source縺ｫ0�医Ν繝ｼ繝茨ｼ峨ｒ莉｣蜈･
-        var source = 0;
-        // 蜈ｱ騾壹Ν繝ｼ繝亥愛螳壹ｒtrue縺ｫ
-        var isCommon = true;
-
-        var score = obj[i]['score'];
-
-        // classLinks縺ｮ謨ｰ縺縺醍ｹｰ繧願ｿ斐＠縺ｪ縺後ｉ
-        for(var j = 0;j < obj[i]['classLinks'].length; j++){
-
-            // 繝ｪ繝ｳ繧ｯ縺ｮ蜷榊燕繧旦RL譛ｫ蟆ｾ縺九ｉ蜿門ｾ�
-            var propertytext = obj[i]['classLinks'][j]['predicate'];
-            var propertysplit1 = propertytext.split("/");
-            var propertysplit2 = propertysplit1[propertysplit1.length - 1];
-            var propertysplit3 = propertysplit2.split("#");
-            propertytext = propertysplit3[propertysplit3.length - 1];
-
-            if(MAXDEPTH < j+1){
-                MAXDEPTH = j+1;
-            }
-            // 縺薙％縺ｾ縺ｧ蜈ｱ騾壹Ν繝ｼ繝医↑繧�
-            if(isCommon){
-                // 莉雁屓繧ょ�騾壹°遒ｺ隱阪☆繧九◆繧√�繝輔Λ繧ｰ
-                var isCommonNow = false;
-                // nodes驟榊�縺ｫ蜷後§linkedClass縺梧里縺ｫ縺ゅｋ縺狗｢ｺ隱�
-                var targets = [];
-                for(var k = 0; k < ret['nodes'].length; k++){
-                    // 蜷碁嚴螻､縺九▽蜷後§蜷榊燕縺ｮ繧ゅ�縺後≠縺｣縺溘ｉtargets驟榊�縺ｫ逡ｪ蜿ｷ繧定ｿｽ蜉
-                    if(ret['nodes'][k]['group'] == (j+1) && obj[i]['classLinks'][j]['linkedClass'] == ret['nodes'][k]['uri']){
-                        targets.push(k);
-                    }
-                }
-
-                // 譌｢縺ｫ縺ゅ▲縺溷ｴ蜷医�links驟榊�縺ｫ蜷後§link縺悟ｭ伜惠縺吶ｋ縺狗｢ｺ隱�
-                if(targets.length != 0){
-                    // 蜈医⊇縺ｩ隕九▽縺代◆targets縺ｮ謨ｰ縺縺醍ｹｰ繧願ｿ斐＠縺ｪ縺後ｉ
-                    for(var l = 0; l <targets.length; l++){
-                        // links驟榊�縺ｫ蜈ｨ縺丞酔縺俶擅莉ｶ縺ｮ繧ゅ�縺後≠繧九°遒ｺ隱�
-                        for(var m = 0; m < ret['links'].length; m++){
-                            // 縺ゅ▲縺溷ｴ蜷井ｻ雁屓縺ｮ繧ゅ�縺ｯ霑ｽ蜉縺帙★source繧呈峩譁ｰ縺励※谺｡縺ｸ
-                            if(ret['links'][m]['source'] == source && ret['links'][m]['target'] == targets[l] && ret['links'][m]['uri'] == obj[i]['classLinks'][j]['predicate'] && !isCommonNow){
-                                // 蜈ｱ騾壹Ν繝ｼ繝医ヵ繝ｩ繧ｰ繧偵が繝ｳ
-                                isCommonNow = true;
-                                source = targets[l];
-                            }
-                        }
-                    }
-
-                    // 蜷дarget繧堤｢ｺ隱阪＠縺ｦ蜈ｱ騾壹Ν繝ｼ繝医〒縺ｯ縺ｪ縺九▲縺溷ｴ蜷域眠隕剰ｿｽ蜉
-                    if(!isCommonNow){
-                        isCommon = false;
-                        ret['nodes'].push({'name': obj[i]['classLinks'][j]['label'], 'uri': obj[i]['classLinks'][j]['linkedClass'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend', 'nodecolor': '#cccccc'});
-                        ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property': propertytext, 'uri': obj[i]['classLinks'][j]['predicate'], 'view' : 'no'});
-                        source = ret['nodes'].length - 1;
-                    }
-
-                // 縺ｪ縺九▲縺溷ｴ蜷医�蛻･譚｡莉ｶ縺ｪ縺ｮ縺ｧ譁ｰ隕剰ｿｽ蜉縺励※谺｡縺ｸ
-                }else{
-
-                    isCommon = false;
-                    ret['nodes'].push({'name': obj[i]['classLinks'][j]['label'], 'uri': obj[i]['classLinks'][j]['linkedClass'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend', 'nodecolor': '#cccccc'});
-                    ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property': propertytext, 'uri': obj[i]['classLinks'][j]['predicate'], 'view' : 'no'});
-                    source = ret['nodes'].length - 1;
-                }
-            // 譌｢縺ｫ蜈ｱ騾壹Ν繝ｼ繝医〒縺ｪ縺�↑繧画眠隕剰ｿｽ蜉縺励※谺｡縺ｸ
-            }else{
-                ret['nodes'].push({'name': obj[i]['classLinks'][j]['label'], 'uri': obj[i]['classLinks'][j]['linkedClass'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend', 'nodecolor': '#cccccc'});
-                ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property': propertytext, 'uri': obj[i]['classLinks'][j]['predicate'], 'view' : 'no'});
-                source = ret['nodes'].length - 1;
-            }
-
-        }
-        ret['nodes'][ret['nodes'].length - 1]['path'] = obj[i];
-        ret['nodes'][ret['nodes'].length - 1]['score'] = score;
-        ret['nodes'][ret['nodes'].length - 1]['nodecolor'] = 'hsl(150, 50%, 75%)';
-        PATHNUM++;
-    }
-    TREESPACE = $('.SBGraph').width() / (MAXDEPTH + 1);
-
-    // 縺ｧ縺阪◆邨先棡繧定ｿ斐☆
-    return ret;
+	// obj繝医ャ繝鈴嚴螻､縺ｮ謨ｰ縺縺醍ｹｰ繧願ｿ斐＠縺ｪ縺後ｉ
+	for(var i = 0; i < viewnum; i++){
+		if(i == 0){
+			// 蛻晏屓縺縺代Ν繝ｼ繝医ヮ繝ｼ繝峨ｒ繝励ャ繧ｷ繝･
+			ret['nodes'].push({'name': obj[0]['label'], 'uri': obj[0]['startClass'], 'group': 0, 'x':50, 'y':50, 'nodeid':ret['nodes'].length, 'path': 'notend', 'nodecolor': 'hsl(40, 50%, 75%)'});
+		}
+		// 蜈医↓source縺ｫ0�医Ν繝ｼ繝茨ｼ峨ｒ莉｣蜈･
+		var source = 0;
+		// 蜈ｱ騾壹Ν繝ｼ繝亥愛螳壹ｒtrue縺ｫ
+		var isCommon = true;
+
+		// 縺薙�繝代せ縺ｮ繧ｹ繧ｳ繧｢繧貞叙蠕�
+		var score = obj[i]['score'];
+
+		// classLinks縺ｮ謨ｰ縺縺醍ｹｰ繧願ｿ斐＠縺ｪ縺後ｉ
+		for(var j = 0;j < obj[i]['classLinks'].length; j++){
+
+			// 繝ｪ繝ｳ繧ｯ縺ｮ蜷榊燕繧旦RL譛ｫ蟆ｾ縺九ｉ蜿門ｾ�
+			var propertytext = obj[i]['classLinks'][j]['predicate'];
+			var propertysplit1 = propertytext.split("/");
+			var propertysplit2 = propertysplit1[propertysplit1.length - 1];
+			var propertysplit3 = propertysplit2.split("#");
+			propertytext = propertysplit3[propertysplit3.length - 1];
+
+			// 豺ｱ縺輔′譛螟ｧ繧医ｊ螟ｧ縺阪￠繧後�譖ｴ譁ｰ
+			if(MAXDEPTH < j+1){
+				MAXDEPTH = j+1;
+			}
+			// 縺薙％縺ｾ縺ｧ蜈ｱ騾壹Ν繝ｼ繝医↑繧�
+			if(isCommon){
+				// 莉雁屓繧ょ�騾壹°遒ｺ隱阪☆繧九◆繧√�繝輔Λ繧ｰ
+				var isCommonNow = false;
+				// nodes驟榊�縺ｫ蜷後§linkedClass縺梧里縺ｫ縺ゅｋ縺狗｢ｺ隱�
+				var targets = [];
+				for(var k = 0; k < ret['nodes'].length; k++){
+					// 蜷碁嚴螻､縺九▽蜷後§蜷榊燕縺ｮ繧ゅ�縺後≠縺｣縺溘ｉtargets驟榊�縺ｫ逡ｪ蜿ｷ繧定ｿｽ蜉
+					if(ret['nodes'][k]['group'] == (j+1) && obj[i]['classLinks'][j]['linkedClass'] == ret['nodes'][k]['uri']){
+						targets.push(k);
+					}
+				}
+
+				// 譌｢縺ｫ縺ゅ▲縺溷ｴ蜷医�links驟榊�縺ｫ蜷後§link縺悟ｭ伜惠縺吶ｋ縺狗｢ｺ隱�
+				if(targets.length != 0){
+					// 蜈医⊇縺ｩ隕九▽縺代◆targets縺ｮ謨ｰ縺縺醍ｹｰ繧願ｿ斐＠縺ｪ縺後ｉ
+					for(var l = 0; l <targets.length; l++){
+						// links驟榊�縺ｫ蜈ｨ縺丞酔縺俶擅莉ｶ縺ｮ繧ゅ�縺後≠繧九°遒ｺ隱�
+						for(var m = 0; m < ret['links'].length; m++){
+							// 縺ゅ▲縺溷ｴ蜷井ｻ雁屓縺ｮ繧ゅ�縺ｯ霑ｽ蜉縺帙★source繧呈峩譁ｰ縺励※谺｡縺ｸ
+							if(ret['links'][m]['source'] == source && ret['links'][m]['target'] == targets[l] && ret['links'][m]['uri'] == obj[i]['classLinks'][j]['predicate'] && !isCommonNow){
+								// 蜈ｱ騾壹Ν繝ｼ繝医ヵ繝ｩ繧ｰ繧偵が繝ｳ
+								isCommonNow = true;
+								source = targets[l];
+							}
+						}
+					}
+
+					// 蜷дarget繧堤｢ｺ隱阪＠縺ｦ蜈ｱ騾壹Ν繝ｼ繝医〒縺ｯ縺ｪ縺九▲縺溷ｴ蜷域眠隕剰ｿｽ蜉
+					if(!isCommonNow){
+						isCommon = false;
+						ret['nodes'].push({'name': obj[i]['classLinks'][j]['label'], 'uri': obj[i]['classLinks'][j]['linkedClass'], 'group': (j+1), 'x':0, 'y':0, 'nodeid':ret['nodes'].length, 'path': 'notend', 'nodecolor': '#cccccc'});
+						ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'property': propertytext, 'uri': obj[i]['classLinks'][j]['predicate']});
+						source = ret['nodes'].length - 1;
+					}
+
+				// 縺ｪ縺九▲縺溷ｴ蜷医�蛻･譚｡莉ｶ縺ｪ縺ｮ縺ｧ譁ｰ隕剰ｿｽ蜉縺励※谺｡縺ｸ
+				}else{
+
+					isCommon = false;
+					ret['nodes'].push({'name': obj[i]['classLinks'][j]['label'], 'uri': obj[i]['classLinks'][j]['linkedClass'], 'group': (j+1), 'x':0, 'y':0, 'nodeid':ret['nodes'].length, 'path': 'notend', 'nodecolor': '#cccccc'});
+					ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'property': propertytext, 'uri': obj[i]['classLinks'][j]['predicate']});
+					source = ret['nodes'].length - 1;
+				}
+			// 譌｢縺ｫ蜈ｱ騾壹Ν繝ｼ繝医〒縺ｪ縺�↑繧画眠隕剰ｿｽ蜉縺励※谺｡縺ｸ
+			}else{
+				ret['nodes'].push({'name': obj[i]['classLinks'][j]['label'], 'uri': obj[i]['classLinks'][j]['linkedClass'], 'group': (j+1), 'x':0, 'y':0, 'nodeid':ret['nodes'].length, 'path': 'notend', 'nodecolor': '#cccccc'});
+				ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'property': propertytext, 'uri': obj[i]['classLinks'][j]['predicate']});
+				source = ret['nodes'].length - 1;
+			}
+
+		}
+		// 譛蠕鯉ｼ域忰遶ｯ繝弱�繝会ｼ峨↓蜷�ｨｮ蛟､繧定ｿｽ蜉
+		ret['nodes'][ret['nodes'].length - 1]['path'] = obj[i];
+		ret['nodes'][ret['nodes'].length - 1]['score'] = score;
+		ret['nodes'][ret['nodes'].length - 1]['nodecolor'] = 'hsl(150, 50%, 75%)';
+		// 繝代せ謨ｰ繧定ｿｽ蜉
+		PATHNUM++;
+	}
+	// 繝弱�繝蛾俣縺ｮ繧ｹ繝壹�繧ｹ繧定ｨ育ｮ�
+	TREESPACE = $('.SBGraph').width() / (MAXDEPTH + 1);
+
+	// 縺ｧ縺阪◆邨先棡繧定ｿ斐☆
+	return ret;
 };
 
