Skip to content

Commit

Permalink
update spoty demo index
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrancart committed Feb 1, 2025
1 parent dfd3d10 commit 3098323
Showing 1 changed file with 33 additions and 50 deletions.
83 changes: 33 additions & 50 deletions demos/demo-SpOTy/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ <h1><a href="index.html" data-i18n="page.title"></a></h1>
distinct="true"
limit="100"
debug="true"
prefixes="schema:https://schema.org/ spotyonto:https://w3id.org/SpOTy/ontology#"
prefixes="skos:http://www.w3.org/2004/02/skos/core# schema:https://schema.org/ spotyonto:https://w3id.org/SpOTy/ontology#"
></spar-natural>

<input type="hidden" id="query-json"></input>
Expand Down Expand Up @@ -544,58 +544,41 @@ <h5 class="modal-title" id="jsonModelLabel" data-i18n="import.modal.title"></h5>
}



sparnatural.addEventListener("init", (event) => {

console.log("comunica init listener")

sparnatural.customization = {
sparqlHandler: {
async executeSparql(
sparql,
callback,
errorCallback
) {
console.log("Received SPARQL "+sparql);

// ... execute SPARQL ...
if (window.podConnectComponent.logedSession) {
console.log('Connected to pod') ;


let results = await window.callbackQueryPod(
sparql,
window.podConnectComponent.logedSession
);
console.log('results...');
//console.log(solidQueryUi.allResultsRecived) ;/**/
if (results instanceof Error) {

errorCallback(results) ;

} else{

console.log(results) ;

callback(results);
}

/*let solidQueryUi = document.querySelector("solid-query-ui");
console.log('query launched on index.html') ;
let results = await solidQueryUi.playLdfQueryUI(sparql) ;*/


//callback(results) ;

} else {
let error = window.errorCollbackQueryPod('Not connected to pod') ;

errorCallback(error) ;
sparnatural.customization = {
sparqlHandler: {
async executeSparql(
sparql,
callback,
errorCallback
) {
console.log("Received SPARQL "+sparql);

// ... execute SPARQL ...
if (window.podConnectComponent.logedSession) {
console.log('Connected to pod') ;

let results = await window.callbackQueryPod(
sparql,
window.podConnectComponent.logedSession
);

if (results instanceof Error) {
errorCallback(results) ;
} else{
console.log(results) ;
callback(results);
}
}

/*let solidQueryUi = document.querySelector("solid-query-ui");
console.log('query launched on index.html') ;
let results = await solidQueryUi.playLdfQueryUI(sparql) ;*/
} else {
let error = window.errorCollbackQueryPod('Not connected to pod') ;
errorCallback(error) ;
}
}
}
});
};


</script>
Expand Down

0 comments on commit 3098323

Please sign in to comment.