From 1637c7a41e615ab705d54ab77a452811c9f1515d Mon Sep 17 00:00:00 2001 From: Timo Date: Tue, 8 Oct 2024 22:00:17 +0200 Subject: [PATCH] fix for wikibase ns --- public/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/index.html b/public/index.html index 9db8abd5..800e430e 100644 --- a/public/index.html +++ b/public/index.html @@ -858,7 +858,7 @@

Relationview

$('#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)=>{ + 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 ?rel . ?prop rdfs:label ?relLabel. filter(lang(?relLabel) = \"en\").}UNION{?rel ?relLabel . FILTER(lang(?relLabel)=\"en\") }}").then((results)=>{ for(result in results){ toappend=""+thetitle+"" if(results[result]["rel"]["value"] in geoproperties && geoproperties[results[result]["rel"]["value"]]=="ObjectProperty"){ @@ -886,7 +886,7 @@

Relationview

toappend+="" $('#relationtablebody').append(toappend) } - d3.sparql($('#endpointselect').val(), "SELECT DISTINCT ?rel ?relLabel ?val ?valLabel WHERE { ?tocon <"+typeproperty+"> ?val . ?tocon ?rel ?con . ?con <"+typeproperty+"> <"+concept+ "> . 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)=>{ + d3.sparql($('#endpointselect').val(), "SELECT DISTINCT ?rel ?relLabel ?val ?valLabel WHERE { ?tocon <"+typeproperty+"> ?val . ?tocon ?rel ?con . ?con <"+typeproperty+"> <"+concept+ "> . OPTIONAL{?val ?valLabel FILTER(lang(?valLabel)=\"en\") } {?prop ?rel . ?prop rdfs:label ?relLabel. filter(lang(?relLabel) = \"en\").}UNION{?rel ?relLabel . FILTER(lang(?relLabel)=\"en\") }}").then((results)=>{ for(result in results){ toappend="\"Class\"/" suri=shortenURI(results[result]["val"]["value"]) @@ -1105,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 ?relLabel ?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 ?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