david4096 commited on
Commit
1cb9bf9
·
1 Parent(s): 2170507

Example query

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -1,7 +1,3 @@
1
- import gradio as gr
2
- from huggingface_hub import InferenceClient
3
- import rdflib
4
-
5
  import gradio as gr
6
  import rdflib
7
 
@@ -23,7 +19,7 @@ def run_sparql(query):
23
  return f"Error: {e}"
24
 
25
  # Gradio interface
26
- query_input = gr.Textbox(label="SPARQL Query", lines=5, placeholder="Enter your SPARQL query here")
27
  output_text = gr.Textbox(label="Query Results", lines=10)
28
 
29
  # Launch the app
@@ -31,8 +27,8 @@ demo = gr.Interface(
31
  fn=run_sparql,
32
  inputs=query_input,
33
  outputs=output_text,
34
- title="SPARQL Query Interface",
35
- description="Enter a SPARQL query to retrieve data from the Turtle file.",
36
  )
37
 
38
  if __name__ == "__main__":
 
 
 
 
 
1
  import gradio as gr
2
  import rdflib
3
 
 
19
  return f"Error: {e}"
20
 
21
  # Gradio interface
22
+ query_input = gr.Textbox(label="SPARQL Query", lines=5, placeholder="SELECT DISTINCT ?b WHERE {?a ?b ?c}")
23
  output_text = gr.Textbox(label="Query Results", lines=10)
24
 
25
  # Launch the app
 
27
  fn=run_sparql,
28
  inputs=query_input,
29
  outputs=output_text,
30
+ title="Hugging Face Datasets SPARQL Query Interface",
31
+ description="Enter a SPARQL query to retrieve data from the Turtle file. Generated by [huggingface-rdf](https://github.com/david4096/huggingface-rdf).",
32
  )
33
 
34
  if __name__ == "__main__":