チェンジセット 213 : SPARQLBuilderWWW/web
- 更新日時:
- 2014/12/04 15:18:36 (10 年 前)
- ファイル:
-
- 1 変更
凡例:
- 変更なし
- 追加
- 削除
-
SPARQLBuilderWWW/web/sparqlbuilder.js
r209 r213 726 726 document.getElementById("sparqlBuilderPlural").innerHTML = "s"; 727 727 728 if(obj ['paths'].length == 0){728 if(obj.length == 0){ 729 729 document.getElementById("sparqlBuilderResultmessage").style.color = "red"; 730 730 document.getElementById("sparqlBuilderResultmessage").style.fontWeight = "bold"; 731 731 document.getElementById("sparqlBuilderPlural").innerHTML = ""; 732 }else if(obj ['paths'].length == 1){732 }else if(obj.length == 1){ 733 733 document.getElementById("sparqlBuilderPlural").innerHTML = ""; 734 734 } 735 735 736 if(obj ['paths'].length <= 10){737 viewnum = obj ['paths'].length;736 if(obj.length <= 10){ 737 viewnum = obj.length; 738 738 document.getElementById("sparqlBuilderViewall").style.display = "none"; 739 739 }else if(this.pathlimit == 10){ … … 741 741 document.getElementById("sparqlBuilderViewall").style.display = "block"; 742 742 }else{ 743 viewnum = obj ['paths'].length;743 viewnum = obj.length; 744 744 document.getElementById("sparqlBuilderViewall").style.display = "none"; 745 745 } 746 746 747 document.getElementById("sparqlBuilderPathnum").innerHTML = obj ['paths'].length;747 document.getElementById("sparqlBuilderPathnum").innerHTML = obj.length; 748 748 document.getElementById("sparqlBuilderResultmessage").style.display = "block"; 749 749 … … 752 752 if(i == 0){ 753 753 // 蛻晏屓縺縺代Ν繝シ繝医ヮ繝シ繝峨r繝励ャ繧キ繝・ 754 ret['nodes'].push({'name': obj[ 'paths'][0]['startClassLabel'], 'uri': obj['paths'][0]['startClassURI'], 'group': 0, 'x':50, 'y':50, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend', 'nodecolor': '#d0a36a'});754 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': '#d0a36a'}); 755 755 } 756 756 // 蜈医↓source縺ォ0�医Ν繝シ繝茨シ峨r莉」蜈・ … … 760 760 761 761 // classLinks縺ョ謨ー縺縺醍ケー繧願ソ斐@縺ェ縺後i 762 for(var j = 0;j < obj[ 'paths'][i]['classLinks'].length; j++){762 for(var j = 0;j < obj[i]['classLinks'].length; j++){ 763 763 764 764 // 繝ェ繝ウ繧ッ縺ョ蜷榊燕繧旦RL譛ォ蟆セ縺九i蜿門セ� 765 var propertytext = obj[ 'paths'][i]['classLinks'][j]['propertyURI'];765 var propertytext = obj[i]['classLinks'][j]['predicate']; 766 766 var propertysplit1 = propertytext.split("/"); 767 767 var propertysplit2 = propertysplit1[propertysplit1.length - 1]; … … 780 780 for(var k = 0; k < ret['nodes'].length; k++){ 781 781 // 蜷碁嚴螻、縺九▽蜷後§蜷榊燕縺ョ繧ゅ�縺後≠縺」縺溘itargets驟榊�縺ォ逡ェ蜿キ繧定ソス蜉 782 if(ret['nodes'][k]['group'] == (j+1) && obj[ 'paths'][i]['classLinks'][j]['linkedClassURI'] == ret['nodes'][k]['uri']){782 if(ret['nodes'][k]['group'] == (j+1) && obj[i]['classLinks'][j]['linkedClass'] == ret['nodes'][k]['uri']){ 783 783 targets.push(k); 784 784 } … … 792 792 for(var m = 0; m < ret['links'].length; m++){ 793 793 // 縺ゅ▲縺溷エ蜷井サ雁屓縺ョ繧ゅ�縺ッ霑ス蜉縺帙★source繧呈峩譁ー縺励※谺。縺ク 794 if(ret['links'][m]['source'] == source && ret['links'][m]['target'] == targets[l] && ret['links'][m]['uri'] == obj[ 'paths'][i]['classLinks'][j]['propertyURI'] && !isCommonNow){794 if(ret['links'][m]['source'] == source && ret['links'][m]['target'] == targets[l] && ret['links'][m]['uri'] == obj[i]['classLinks'][j]['propertyURI'] && !isCommonNow){ 795 795 // 蜈ア騾壹Ν繝シ繝医ヵ繝ゥ繧ー繧偵が繝ウ 796 796 isCommonNow = true; … … 803 803 if(!isCommonNow){ 804 804 isCommon = false; 805 ret['nodes'].push({'name': obj[ 'paths'][i]['classLinks'][j]['nodeLabel'], 'uri': obj['paths'][i]['classLinks'][j]['linkedClassURI'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend', 'nodecolor': '#cccccc'});806 ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property': propertytext, 'uri': obj[ 'paths'][i]['classLinks'][j]['propertyURI'], 'view' : 'no'});805 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'}); 806 ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property': propertytext, 'uri': obj[i]['classLinks'][j]['predicate'], 'view' : 'no'}); 807 807 source = ret['nodes'].length - 1; 808 808 } … … 812 812 813 813 isCommon = false; 814 ret['nodes'].push({'name': obj[ 'paths'][i]['classLinks'][j]['nodeLabel'], 'uri': obj['paths'][i]['classLinks'][j]['linkedClassURI'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend', 'nodecolor': '#cccccc'});815 ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property': propertytext, 'uri': obj[ 'paths'][i]['classLinks'][j]['propertyURI'], 'view' : 'no'});814 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'}); 815 ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property': propertytext, 'uri': obj[i]['classLinks'][j]['predicate'], 'view' : 'no'}); 816 816 source = ret['nodes'].length - 1; 817 817 } 818 818 // 譌「縺ォ蜈ア騾壹Ν繝シ繝医〒縺ェ縺�↑繧画眠隕剰ソス蜉縺励※谺。縺ク 819 819 }else{ 820 ret['nodes'].push({'name': obj[ 'paths'][i]['classLinks'][j]['nodeLabel'], 'uri': obj['paths'][i]['classLinks'][j]['linkedClassURI'], 'group': (j+1), 'x':0, 'y':0, 'dy':0, 'nodeid':ret['nodes'].length, 'view' : 'no', 'path': 'notend', 'nodecolor': '#cccccc'});821 ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property': propertytext, 'uri': obj[ 'paths'][i]['classLinks'][j]['propertyURI'], 'view' : 'no'});820 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'}); 821 ret['links'].push({'source':source, 'target':ret['nodes'].length - 1, 'value':5, 'property': propertytext, 'uri': obj[i]['classLinks'][j]['predicate'], 'view' : 'no'}); 822 822 source = ret['nodes'].length - 1; 823 823 } 824 824 825 825 } 826 ret['nodes'][ret['nodes'].length - 1]['path'] = obj[ 'paths'][i];826 ret['nodes'][ret['nodes'].length - 1]['path'] = obj[i]; 827 827 ret['nodes'][ret['nodes'].length - 1]['nodecolor'] = '#8cddc0'; 828 828 this.PATHNUM++;