Upload 2 files
Browse files- app.py +9 -16
- 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 = "
|
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 |
-
#
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
pySHACL>=0.25.0
|
6 |
pandas>=2.0.0
|
7 |
|
8 |
-
#
|
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 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
python-dotenv>=1.0.0
|
23 |
-
|
24 |
-
|
|
|
|
|
|
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
|