Skip to content

Commit

Permalink
fix bug with undefined sparql query when clicking some nodes in the D…
Browse files Browse the repository at this point in the history
…iagramView

Signed-off-by: pogi7 <[email protected]>
  • Loading branch information
pogi7 committed May 8, 2024
1 parent c8b6b4d commit c12dd84
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 5 additions & 5 deletions controller/src/sparql/SparqlClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ export async function SparqlClient(query: string, service: SparqlServiceType, ir
throw new Error(`No SPARQL queries found in current model.`);
}

if (!QUERY && !query) {
vscode.window.showErrorMessage(`Unknown SPARQL query: ${query}`);
throw new Error(`Unknown SPARQL query: ${query}`);
}

if (!QUERY) {
QUERY = query
// Uncomment to have VSCode notify users about SPARQL query not being defined in src/vision/sparql directory
Expand All @@ -38,6 +33,11 @@ export async function SparqlClient(query: string, service: SparqlServiceType, ir
QUERY = QUERY.replace(/\$\{iri\}/g, iri);
}

if (!QUERY && !query) {
vscode.window.showErrorMessage(`Unknown SPARQL query: ${query}`);
throw new Error(`Unknown SPARQL query: ${query}`);
}

if (service === "query") {
console.log(`EXECUTE QUERY SERVICE: ${QUERY}`)
return await queryEngine(QUERY);
Expand Down
4 changes: 4 additions & 0 deletions view/src/components/Diagram/diagramUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,10 @@ const processNodes = (
}
}

if (node.type === "NA") {
node.type = "default";
}

const processedNode: any = {
id: node.id,
data: node.data,
Expand Down

0 comments on commit c12dd84

Please sign in to comment.