jimfhahn commited on
Commit
24b611a
Β·
verified Β·
1 Parent(s): 34f5d50

Upload 2 files

Browse files
Files changed (2) hide show
  1. app.py +9 -16
  2. requirements.txt +17 -18
app.py CHANGED
@@ -477,7 +477,7 @@ def validate_rdf_interface(rdf_content: str, template: str, use_ai: bool = True)
477
 
478
  if result["conforms"]:
479
  suggestions = "βœ… No issues found! Your RDF/XML is valid according to the selected template."
480
- corrected_rdf = "<!-- Already valid - no corrections needed -->\n" + rdf_content
481
  else:
482
  if use_ai:
483
  suggestions = get_ai_suggestions(results_text, rdf_content)
@@ -605,6 +605,14 @@ def create_interface():
605
  )
606
 
607
  validate_btn = gr.Button("πŸ” Validate RDF", variant="primary", size="lg")
 
 
 
 
 
 
 
 
608
 
609
  # Results section
610
  with gr.Row():
@@ -645,16 +653,6 @@ def create_interface():
645
  placeholder="Corrected RDF will appear here after validation..."
646
  )
647
 
648
- # Examples and controls
649
- with gr.Row():
650
- gr.Markdown("### πŸ“š Examples & Tools")
651
-
652
- with gr.Row():
653
- example1_btn = gr.Button("βœ… Valid RDF Example", variant="secondary")
654
- example2_btn = gr.Button("❌ Invalid RDF Example", variant="secondary")
655
- example3_btn = gr.Button("πŸ“– BibFrame Example", variant="secondary")
656
- clear_btn = gr.Button("πŸ—‘οΈ Clear All", variant="stop")
657
-
658
  # Event handlers
659
  validate_btn.click(
660
  fn=validate_rdf_interface,
@@ -680,11 +678,6 @@ def create_interface():
680
  outputs=[rdf_input]
681
  )
682
 
683
- example3_btn.click(
684
- lambda: get_rdf_examples("bibframe"),
685
- outputs=[rdf_input]
686
- )
687
-
688
  clear_btn.click(
689
  lambda: ("", "", "", "", ""),
690
  outputs=[rdf_input, status_output, results_output, suggestions_output, corrected_output]
 
477
 
478
  if result["conforms"]:
479
  suggestions = "βœ… No issues found! Your RDF/XML is valid according to the selected template."
480
+ corrected_rdf = "βœ… Your RDF/XML is already valid - no corrections needed!"
481
  else:
482
  if use_ai:
483
  suggestions = get_ai_suggestions(results_text, rdf_content)
 
605
  )
606
 
607
  validate_btn = gr.Button("πŸ” Validate RDF", variant="primary", size="lg")
608
+
609
+ # Examples and controls
610
+ gr.Markdown("### πŸ“š Examples & Tools")
611
+
612
+ with gr.Row():
613
+ example1_btn = gr.Button("βœ… Valid RDF Example", variant="secondary")
614
+ example2_btn = gr.Button("❌ Invalid RDF Example", variant="secondary")
615
+ clear_btn = gr.Button("πŸ—‘οΈ Clear All", variant="stop")
616
 
617
  # Results section
618
  with gr.Row():
 
653
  placeholder="Corrected RDF will appear here after validation..."
654
  )
655
 
 
 
 
 
 
 
 
 
 
 
656
  # Event handlers
657
  validate_btn.click(
658
  fn=validate_rdf_interface,
 
678
  outputs=[rdf_input]
679
  )
680
 
 
 
 
 
 
681
  clear_btn.click(
682
  lambda: ("", "", "", "", ""),
683
  outputs=[rdf_input, status_output, results_output, suggestions_output, corrected_output]
requirements.txt CHANGED
@@ -1,24 +1,23 @@
1
- # Requirements for Hugging Face Gradio App with MCP Server
2
- # Core dependencies
3
- gradio>=4.0.0
4
- rdflib>=7.0.0
5
- pySHACL>=0.25.0
6
  pandas>=2.0.0
7
 
8
- # AI integrations
9
- huggingface_hub>=0.20.0
10
- openai>=1.0.0
11
-
12
- # MCP support (optional)
13
- mcp>=0.9.0
14
-
15
- # Web and utilities
16
- flask>=2.3.0
17
  flask-cors>=4.0.0
18
- requests>=2.31.0
19
  waitress>=2.1.0
20
 
21
- # Additional utilities
 
 
 
 
 
 
 
22
  python-dotenv>=1.0.0
23
- aiofiles>=23.0.0
24
- asyncio-mqtt>=0.13.0
 
 
 
1
+ # Core web framework and RDF processing
2
+ Flask>=2.3.0
3
+ rdflib>=6.2.0
4
+ pySHACL>=0.20.0
 
5
  pandas>=2.0.0
6
 
7
+ # Web utilities and CORS
 
 
 
 
 
 
 
 
8
  flask-cors>=4.0.0
 
9
  waitress>=2.1.0
10
 
11
+ # Gradio with MCP support for HF Spaces
12
+ gradio>=5.39.0
13
+
14
+ # AI integrations
15
+ openai>=1.0.0
16
+
17
+ # HTTP and utilities
18
+ requests>=2.28.0
19
  python-dotenv>=1.0.0
20
+
21
+ # Development tools (useful for SSH spaces)
22
+ ipython>=8.0.0
23
+ jupyterlab>=4.0.0