diff --git a/public/index.html b/public/index.html index 6170d3fc..f10dc2e0 100644 --- a/public/index.html +++ b/public/index.html @@ -805,6 +805,7 @@

Relationview

}catch(e){ } $('#relationtitle').html("\"Class\"/ "+shortenURI(concept)+"") + $('#relationtablehead').html("Incoming ConceptIncoming PropertyConceptOutgoing PropertyOutgoing Concept") $('#relationtablebody').html("Loading instance data....") if(node.icon.includes("class.png")){ $('#relationtablebody').html("") @@ -812,20 +813,20 @@

Relationview

for(result in results){ toappend="\"Class\"/"+shortenURI(concept)+"" if(results[result]["rel"]["value"] in geoproperties && geoproperties[results[result]["rel"]["value"]]=="ObjectProperty"){ - toappend+="\"Geo"+shortenURI(results[result]["rel"]["value"])+"" + toappend+="\"Geo"+shortenURI(results[result]["rel"]["value"])+"" }else{ - toappend+="\"Object"+shortenURI(results[result]["rel"]["value"])+"" + toappend+="\"Object"+shortenURI(results[result]["rel"]["value"])+"" } - toappend+="\"Class\"/"+shortenURI(results[result]["val"]["value"])+"" + toappend+="\"Class\"/"+shortenURI(results[result]["val"]["value"])+"" $('#relationtablebody').append(toappend) } d3.sparql($('#endpointselect').val(), "SELECT DISTINCT ?rel ?val WHERE { ?tocon ?val . ?tocon ?rel ?con . ?con <"+concept+ "> . }").then((results)=>{ for(result in results){ - toappend="\"Class\"/"+shortenURI(results[result]["val"]["value"])+"" + toappend="\"Class\"/"+shortenURI(results[result]["val"]["value"])+"" if(results[result]["rel"]["value"] in geoproperties && geoproperties[results[result]["rel"]["value"]]=="ObjectProperty"){ - toappend+="\"Geo"+shortenURI(results[result]["rel"]["value"])+"" + toappend+="\"Geo"+shortenURI(results[result]["rel"]["value"])+"" }else{ - toappend+="\"Object"+shortenURI(results[result]["rel"]["value"])+"" + toappend+="\"Object"+shortenURI(results[result]["rel"]["value"])+"" } toappend+="\"Class\"/"+shortenURI(concept)+"" $('#relationtablebody').append(toappend) @@ -836,22 +837,23 @@

Relationview

} } -function getPropRelationDialog(node){ - concept=node.id +function getPropRelationDialog(uri,icon){ + concept=uri document.getElementById("relationDialog").showModal() try{ $('#relationtable').DataTable().destroy(); }catch(e){ } - $('#relationtitle').html("\"Class\"/ "+shortenURI(concept)+"") + $('#relationtitle').html("\"Class\"/ "+shortenURI(concept)+"") + $('#relationtablehead').html("Incoming ConceptPropertyOutgoing Concept") $('#relationtablebody').html("Loading instance data....") - if(node.icon.includes("class.png")){ + if(icon.includes("property")){ $('#relationtablebody').html("") - d3.sparql($('#endpointselect').val(), "SELECT DISTINCT ?sub ?obj WHERE { ?sub <"+concept+"> ?obj . }").then((results)=>{ + d3.sparql($('#endpointselect').val(), "SELECT DISTINCT ?sub ?obj WHERE { ?subb <"+concept+"> ?objj . ?subb ?sub . ?objj ?obj .}").then((results)=>{ for(result in results){ - toappend="\"Class\"/"+shortenURI(results[result]["sub"]["value"])+"" - toappend="\"Class\"/ - toappend+="\"Class\"/"+shortenURI(results[result]["obj"]["value"])+"" + toappend="\"Class\"/"+shortenURI(results[result]["sub"]["value"])+"" + toappend+="\"Class\"/ "+shortenURI(concept)+"" + toappend+="\"Class\"/"+shortenURI(results[result]["obj"]["value"])+"" $('#relationtablebody').append(toappend) } });