Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/i3mainz/geopubby
Browse files Browse the repository at this point in the history
  • Loading branch information
situx committed Oct 10, 2024
2 parents 927334d + 9228495 commit 10399ea
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -862,7 +862,7 @@ <h3 id="relationtitle">Relationview</h3>
$('#relationtablebody').html("<tr><td colspan=3>Loading instance data....</td></tr>")
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 <http://www.w3.org/2000/01/rdf-schema#label> ?valLabel . FILTER(lang(?valLabel)=\"en\") } {?prop wikibase:directClaim ?rel . ?prop rdfs:label ?relLabel. filter(lang(?relLabel) = \"en\").}UNION{?rel <http://www.w3.org/2000/01/rdf-schema#label> ?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 <http://www.w3.org/2000/01/rdf-schema#label> ?valLabel . FILTER(lang(?valLabel)=\"en\") } OPTIONAL{?prop <http://wikiba.se/ontology#directClaim> ?rel . ?prop <http://www.w3.org/2000/01/rdf-schema#label> ?relLabel. filter(lang(?relLabel) = \"en\").} OPTIONAL{?rel <http://www.w3.org/2000/01/rdf-schema#label> ?relLabel . FILTER(lang(?relLabel)=\"en\") }}").then((results)=>{
for(result in results){
toappend="<tr><td></td><td></td><td>"+thetitle+"</td>"
if(results[result]["rel"]["value"] in geoproperties && geoproperties[results[result]["rel"]["value"]]=="ObjectProperty"){
Expand Down Expand Up @@ -890,7 +890,7 @@ <h3 id="relationtitle">Relationview</h3>
toappend+="</td></tr>"
$('#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 <http://www.w3.org/2000/01/rdf-schema#label> ?valLabel FILTER(lang(?valLabel)=\"en\") } {?prop wikibase:directClaim ?rel . ?prop rdfs:label ?relLabel. filter(lang(?relLabel) = \"en\").}UNION{?rel <http://www.w3.org/2000/01/rdf-schema#label> ?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 <http://www.w3.org/2000/01/rdf-schema#label> ?valLabel FILTER(lang(?valLabel)=\"en\") } OPTIONAL{?prop <http://wikiba.se/ontology#directClaim> ?rel . ?prop <http://www.w3.org/2000/01/rdf-schema#label> ?relLabel. filter(lang(?relLabel) = \"en\").} OPTIONAL{?rel <http://www.w3.org/2000/01/rdf-schema#label> ?relLabel . FILTER(lang(?relLabel)=\"en\") }}").then((results)=>{
for(result in results){
toappend="<tr><td><img onclick=\"getClassRelationDialog($('#jstree').jstree(true).get_node('" + results[result]["val"]["value"] + "'))\" src=\""+baseurl+"icons/class.png\" height=\"25\" width=\"25\" alt=\"Class\"/>"
suri=shortenURI(results[result]["val"]["value"])
Expand Down Expand Up @@ -941,7 +941,7 @@ <h3 id="relationtitle">Relationview</h3>
$('#relationtablebody').html("<tr><td colspan=3>Loading instance data....</td></tr>")
if(icon.includes("property")){
$('#relationtablebody').html("")
d3.sparql($('#endpointselect').val(), "SELECT DISTINCT ?sub ?obj ?subLabel ?objLabel WHERE { ?subb <"+concept+"> ?objj . ?subb <"+typeproperty+"> ?sub . ?objj <"+typeproperty+"> ?obj . OPTIONAL{?obj rdfs:label ?objLabel FILTER(lang(?objLabel)=\"en\") } OPTIONAL{?sub rdfs:label ?subLabel FILTER(lang(?subLabel)=\"en\") }}").then((results)=>{
d3.sparql($('#endpointselect').val(), "SELECT DISTINCT ?sub ?obj ?subLabel ?objLabel WHERE { ?subb <"+concept+"> ?objj . ?subb <"+typeproperty+"> ?sub . ?objj <"+typeproperty+"> ?obj . OPTIONAL{?obj <http://www.w3.org/2000/01/rdf-schema#label> ?objLabel FILTER(lang(?objLabel)=\"en\") } OPTIONAL{?sub <http://www.w3.org/2000/01/rdf-schema#label> ?subLabel FILTER(lang(?subLabel)=\"en\") }}").then((results)=>{
for(result in results){
toappend="<tr><td><img onclick=\"getClassRelationDialog($('#jstree').jstree(true).get_node('" + results[result]["sub"]["value"] + "'))\" src=\""+baseurl+"icons/class.png\" height=\"25\" width=\"25\" alt=\"Class\"/>"
suri=shortenURI(results[result]["sub"]["value"])
Expand All @@ -966,6 +966,7 @@ <h3 id="relationtitle">Relationview</h3>
toappend+="</td></tr>"
$('#relationtablebody').append(toappend)
}
$('#relationtable').DataTable({"scrollX":true,"scrollY":true});
});
}
}
Expand Down Expand Up @@ -1109,7 +1110,7 @@ <h3 id="relationtitle">Relationview</h3>
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 <http://www.w3.org/2000/01/rdf-schema#label> ?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 ) OPTIONAL{?prop <http://wikiba.se/ontology#directClaim> ?rel . ?prop <http://www.w3.org/2000/01/rdf-schema#label> ?relLabel. filter(lang(?relLabel) = \"en\").}OPTIONAL{?rel <http://www.w3.org/2000/01/rdf-schema#label> ?relLabel . FILTER(lang(?relLabel)=\"en\") }}\n GROUP BY ?rel ?relLabel ?valtype\n ORDER BY DESC(?countrel)").then((results)=>{
result="";
maxcons=1
first=true
Expand Down Expand Up @@ -1199,7 +1200,7 @@ <h3 id="relationtitle">Relationview</h3>
if(endp in endpointToProps){
typeproperty=endpointToProps[endp]["typeproperty"]
}
d3.sparql(endp, prefixList+" SELECT DISTINCT ?cls ?clsLabel WHERE {?ind <"+typeproperty+"> ?cls . ?ind ?rel ?geo. ?geo geo:asWKT ?wkt . ?cls rdf:type owl:Class . OPTIONAL{?cls rdfs:label ?clsLabel. }} ORDER BY ?cls").then((results) => {
d3.sparql(endp, prefixList+" SELECT DISTINCT ?cls ?clsLabel WHERE {?ind <"+typeproperty+"> ?cls . ?ind ?rel ?geo. ?geo geo:asWKT ?wkt . ?cls rdf:type owl:Class . OPTIONAL{?cls <http://www.w3.org/2000/01/rdf-schema#label> ?clsLabel. }} ORDER BY ?cls").then((results) => {
//currdfstore.execute(, function(success,results){
//console.log(success,results)
result="";
Expand Down

0 comments on commit 10399ea

Please sign in to comment.