Skip to content

Commit

Permalink
Make JSON look better
Browse files Browse the repository at this point in the history
  • Loading branch information
matentzn committed Dec 8, 2024
1 parent 015de17 commit 26f052c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/sssom_validate_ui/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,15 @@ def _render_tool_information():
f"Currently, the validator checks the the first {limit_lines_evaluated} lines of the provided SSSOM file."
)

area_txt = "Paste your SSSOM mapping text here:"
area_txt = ("Paste your SSSOM mapping in TSV format here. For information on how to format a SSSOM TSV "
"correctly see [here](https://mapping-commons.github.io/sssom/spec-formats-tsv/):")

sssom_text = st.text_area(area_txt, generate_example(), height=400, key="sssom_input")
example_url = ""
sssom_url_input = st.text_input(
"Paste a URL to your SSSOM file here.", example_url, key="sssom_input_url"
"Paste a URL to your SSSOM file here. "
"The URL will take precedence over anything you might see in the text area above.",
example_url, key="sssom_input_url"
)

if st.button("Validate"):
Expand Down Expand Up @@ -151,12 +154,12 @@ def _render_tool_information():
with st.expander("Conversion report"):
st.markdown(result.get_sssom_conversion_report())
_render_serialisation_section(result.sssom_rdf, "RDF", "turtle")
_render_serialisation_section(result.sssom_json, "JSON", "json")
_render_serialisation_section(result.sssom_json, "JSON-LD", "json")

st.header("Additional information")
_render_tool_information()

st.header("Contact")
st.markdown("### Contact")
st.image("src/sssom_validate_ui/resources/monarch.png", use_container_width=False, width=300)
st.markdown("Presented by the [Monarch Initiative](https://monarchinitiative.org/)")
st.markdown(
Expand Down
2 changes: 1 addition & 1 deletion src/sssom_validate_ui/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _run_sssom_conversion(self):
)
msdf_subset_for_display.clean_prefix_map()

self.sssom_json = json.dumps(to_json(msdf_subset_for_display))
self.sssom_json = json.dumps(to_json(msdf_subset_for_display), indent=4)

if msdf.metadata.get("extension_definitions"):
logging.warning(
Expand Down

0 comments on commit 26f052c

Please sign in to comment.