TriplyDB / Yasgui

Yet Another Sparql GUI
https://yasgui.triply.cc
MIT License
178 stars 54 forks source link

there is any way to assign my api response to Yasr #208

Closed shanu3742 closed 1 year ago

shanu3742 commented 1 year ago

i get response from sparqul by using simple API call but now I want to pass my response to yasr and show that on webpage is there any way to assign my response to Yasr component in react

GerwinBosch commented 1 year ago

Hello @shanu3742,

You can do this by assigning YASR to a ref object and call yasrRef.current.setResponse when you receive the response

Let me know if this helps. Have a nice day!

shanu3742 commented 1 year ago

Hi @GerwinBosch i'm getting error like ncaught TypeError: yasrRef.current.setResponse is not a function i assign yasrRef variable to

<div` id="yasr" ref={yasrRef}></div>

and used it like

yasrRef.current.setResponse(result?.data?.results);
GerwinBosch commented 1 year ago

@shanu3742 I meant to put the instance of YASR in the ref when it is being initialized

shanu3742 commented 1 year ago

Now I'm getting result in the form of rawResponse but not in table from is any other things i have to do for that

GerwinBosch commented 1 year ago

I'm going to guess that you get back some kind of "normal" JSON. Make sure to add an accept header to your request. Use: application/sparql-results+json (preferred), application/sparql-results+xml, CSV or TSV for Select queries and any kind of serialized triple format for construct queries

shanu3742 commented 1 year ago

hi @GerwinBosch sorry for all the basic question and thanks for giving your valuable time , will you help me one more time how can I add other plugin like 'pivot','gchart' etc

GerwinBosch commented 1 year ago

Unfortunately, those are only available on yasgui.triply.cc and within TriplyDB see https://triply.cc/docs/yasgui-api#triplyDbPlugins

You can however write your own using https://triply.cc/docs/yasgui-api#writing-a-yasr-plugin

srinivasAarth commented 1 year ago

hi @GerwinBosch is there any way to disable the editing option in yasqe(query editor) I just want to show the query, not like interactive query editing I'm custom selecting variables, query properties, and relations from the input select fields so, I don't want the option like editing query on yasqe pannel

GerwinBosch commented 1 year ago

@srinivasAarth you can do that by setting readOnly:false

srinivasAarth commented 1 year ago

@GerwinBosch thanks for the response its working fine as like what I expected after adding the readOnly:true property

GerwinBosch commented 1 year ago

Oops got the boolean value wrong 😅. However, since your issues seem to be resolved can this issue be closed?

srinivasAarth commented 1 year ago

yes @GerwinBosch it was closed