From c41a779a213abb69c604df2875468b8c3f055534 Mon Sep 17 00:00:00 2001 From: situx Date: Tue, 8 Oct 2024 19:27:24 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20=20@=20334ec?= =?UTF-8?q?d8aa573b1304b9beb57cb28a9421e517168=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- geopubbyjs/index.html | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/geopubbyjs/index.html b/geopubbyjs/index.html index d39bf492..9db8abd5 100644 --- a/geopubbyjs/index.html +++ b/geopubbyjs/index.html @@ -852,14 +852,15 @@

Relationview

if(endp in endpointToProps){ typeproperty=endpointToProps[endp]["typeproperty"] } - $('#relationtitle').html("\"Class\"/ "+shortenURI(concept)+"") + thetitle="\"Class\"/"+node.text+"" + $('#relationtitle').html("\"Class\"/ "+node.text+"") $('#relationtablehead').html("Incoming ConceptIncoming PropertyConceptOutgoing PropertyOutgoing Concept") $('#relationtablebody').html("Loading instance data....") if(node.icon.includes("class.png")){ $('#relationtablebody').html("") d3.sparql(endp, "SELECT DISTINCT ?rel ?relLabel ?val ?valLabel WHERE { ?con <"+typeproperty+"> <"+concept+ "> . ?con ?rel ?item . ?item <"+typeproperty+"> ?val . OPTIONAL{?val ?valLabel . FILTER(lang(?valLabel)=\"en\") } {?prop wikibase:directClaim ?rel . ?prop rdfs:label ?relLabel. filter(lang(?relLabel) = \"en\").}UNION{?rel ?relLabel . FILTER(lang(?relLabel)=\"en\") }}").then((results)=>{ for(result in results){ - toappend="\"Class\"/"+shortenURI(concept)+"" + toappend=""+thetitle+"" if(results[result]["rel"]["value"] in geoproperties && geoproperties[results[result]["rel"]["value"]]=="ObjectProperty"){ toappend+="\"Geo" }else{ @@ -910,7 +911,7 @@

Relationview

}else{ toappend+=""+shortenURI(results[result]["rel"]["value"])+"" } - toappend+="\"Class\"/"+shortenURI(concept)+"" + toappend+=""+thetitle+"" $('#relationtablebody').append(toappend) } $('#relationtable').DataTable({"scrollX":true,"scrollY":true}); @@ -919,7 +920,7 @@

Relationview

} } -function getPropRelationDialog(uri,icon){ +function getPropRelationDialog(uri,icon,label=""){ concept=uri document.getElementById("relationDialog").showModal() try{ @@ -1104,7 +1105,7 @@

Relationview

if(endp in endpointToProps){ typeproperty=endpointToProps[endp]["typeproperty"] } - d3.sparql(endp, "SELECT (COUNT(distinct ?con) AS ?countcon) (COUNT(?rel) AS ?countrel) ?rel ?relLabel ?valtype\n WHERE { ?con <"+typeproperty+"> <"+concept+"> . ?con ?rel ?val .\n BIND( datatype(?val) AS ?valtype ) {?prop wikibase:directClaim ?rel . ?prop rdfs:label ?relLabel. filter(lang(?relLabel) = \"en\").}UNION{?rel ?relLabel . FILTER(lang(?relLabel)=\"en\") }}\n GROUP BY ?rel ?valtype\n ORDER BY DESC(?countrel)").then((results)=>{ + d3.sparql(endp, "SELECT (COUNT(distinct ?con) AS ?countcon) (COUNT(?rel) AS ?countrel) ?rel ?relLabel ?valtype\n WHERE { ?con <"+typeproperty+"> <"+concept+"> . ?con ?rel ?val .\n BIND( datatype(?val) AS ?valtype ) {?prop wikibase:directClaim ?rel . ?prop rdfs:label ?relLabel. filter(lang(?relLabel) = \"en\").}UNION{?rel ?relLabel . FILTER(lang(?relLabel)=\"en\") }}\n GROUP BY ?rel ?relLabel ?valtype\n ORDER BY DESC(?countrel)").then((results)=>{ result=""; maxcons=1 first=true @@ -1118,7 +1119,7 @@

Relationview

console.log(results[res]) if(!("valtype" in results[res]) || typeof(results[res]["valtype"]["value"])=="undefined"){ if(results[res]["rel"]["value"] in geoproperties && geoproperties[results[res]["rel"]["value"]]=="ObjectProperty"){ - result+="\"GeoGeo Object Property [x]" + result+="\"GeoGeo Object Property [x]" }else{ result+="\"ObjectObject Property [x]" } @@ -1136,7 +1137,16 @@

Relationview

result+="\"DatatypeDatatype Property [x]" } } - result+=""+shortenURI(results[res]["rel"]["value"])+" ["+((parseInt(results[res]["countrel"]["value"])/maxcons)*100).toFixed(2)+"%]" + result+="" + suri=shortenURI(results[res]["rel"]["value"]) + if("relLabel" in results[res]){ + result+=""+results[res]["relLabel"]["value"] + result+=" ("+shortenURI(results[res]["rel"]["value"])+")" + result+="" + }else{ + result+=""+shortenURI(results[res]["rel"]["value"])+"" + } + result+=" ["+((parseInt(results[res]["countrel"]["value"])/maxcons)*100).toFixed(2)+"%]" if(!("valtype" in results[res]) || typeof(results[res]["valtype"])=="undefined"){ result+=" [xsd:anyURI]" }else{