Skip to content

Commit e56eb39

Browse files
committed
fix shape URIs when generating shex from void
1 parent c226987 commit e56eb39

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

deploy.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818

1919

2020
# NOTE: if OOM error, check `dmsg` on server and search for `oom`
21-
# sudo -u podman bash -c 'journalctl -k'
21+
# sudo -u podman bash -c 'journalctl -k '
22+
23+
# sudo -u podman bash -c 'cd /var/containers/podman/sparql-llm ; tail -f data/logs/expasygpt_podman.log'
24+
25+
2226

2327
ssh_cmd() {
2428
ssh -t expasychat "sudo -u podman bash -c 'cd /var/containers/podman/sparql-llm ; XDG_RUNTIME_DIR=/run/user/1001 $1'"

src/sparql-llm/src/sparql_llm/sparql_void_shapes_loader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def get_shex_dict_from_void(
4747
subj = prefix_converter.compress(subject_cls)
4848
except Exception as _e:
4949
subj = f"<{subject_cls}>"
50-
shex_dict[subject_cls] = {"shex": f"{subj} {{\n a [ {subj} ] ;\n"}
50+
shape_iri = f"shape:{subj.replace(':', '_')}"
51+
shex_dict[subject_cls] = {"shex": f"{shape_iri} {{\n a [ {subj} ] ;\n"}
5152

5253
for predicate, object_list in predicates.items():
5354
try:

tutorial/graph.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@ async def validate_output(
162162
) -> dict[str, bool | list[tuple[str, str]] | int]:
163163
"""Node to validate the output of a LLM call, e.g. SPARQL queries generated."""
164164
recall_messages = []
165-
print(state["messages"])
165+
# print(state["messages"])
166166
last_msg = next(
167167
msg.content
168168
for msg in reversed(state["messages"])
169169
if isinstance(msg, AIMessage) and msg.content
170170
)
171-
print(last_msg)
171+
# print(last_msg)
172172
# last_msg = state["messages"][-1].content
173173
validation_outputs = validate_sparql_in_msg(
174174
last_msg, prefixes_map, endpoints_void_dict

0 commit comments

Comments
 (0)