diff --git a/libs/ng-yasgui/src/lib/components/yasgui/yasgui.component.ts b/libs/ng-yasgui/src/lib/components/yasgui/yasgui.component.ts index 6800c7cb..283d4eaa 100644 --- a/libs/ng-yasgui/src/lib/components/yasgui/yasgui.component.ts +++ b/libs/ng-yasgui/src/lib/components/yasgui/yasgui.component.ts @@ -19,6 +19,9 @@ export class YasguiComponent implements OnInit, OnChanges, OnDestroy { @Input() query?: string; + @Input() + isQueryExecuted = false; + @ViewChild('yasgui', { static: true }) yasguiRef!: ElementRef; @@ -58,6 +61,14 @@ export class YasguiComponent implements OnInit, OnChanges, OnDestroy { if (this.yasgui.current().yasqe.getValue() !== this.query) { this.yasgui.current().yasqe.setValue(this.query); } + + if (this.isQueryExecuted && this.options?.yasqe) { + this.yasgui.current().yasqe.query({ + url: this.options.yasqe.sparql, + reqMethod: 'POST', + args: { arg1: this.query }, + }); + } } private async createYasgui(): Promise { diff --git a/libs/ng-yasgui/src/lib/models/yasgui.ts b/libs/ng-yasgui/src/lib/models/yasgui.ts index 6a3f5bc3..efe81f51 100644 --- a/libs/ng-yasgui/src/lib/models/yasgui.ts +++ b/libs/ng-yasgui/src/lib/models/yasgui.ts @@ -15,6 +15,7 @@ export interface Yasqe { getValue(): string; on(event: string | 'change', handler: (e: any) => void): void; setOption(option: any): void; + query: Function; } // http://doc.yasgui.org/doc/#clientConfig