sparna-git / Sparnatural

Sparnatural : visual SPARQL query builder for knowledge graphs in the browser, configurable with SHACL
http://sparnatural.eu
GNU Lesser General Public License v3.0
219 stars 41 forks source link

Study integration with Wikidata/Wikibase query result components ? #470

Open tfrancart opened 1 year ago

tfrancart commented 1 year ago

The code is here: https://github.com/wikimedia/wikidata-query-gui/tree/master/wikibase/queryService/ui/resultBrowser

https://github.com/wikimedia/wikidata-query-gui shows an example of how it can be called:

    var result = new wikibase.queryService.ui.resultBrowser.CoordinateResultBrowser();
    result.setResult( api.getResultRawData() );
    result.draw( element );

Would be good to find how the different views are triggered based on the SPARQL hint

Looks like it s based on JQuery.

The thing compiles nicely, generates a wdqs.js file, coulb be imported in the HTML page.

tfrancart commented 1 year ago

The parsing of the resultView:xxxx wikibase query hint is done here : https://github.com/wikimedia/wikidata-query-gui/blob/610c78949d4e1f71ff0ef2fa310cd384de27fd2d/wikibase/queryService/ui/ResultView.js#L490

ResultView.js could be a good entry point