Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
shihanwan committed Oct 16, 2024
1 parent 9be03b5 commit 5b0eedb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
8 changes: 5 additions & 3 deletions memonto/stores/triple/jena.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def get(
def get_all(self, graph_id: str = None) -> str:
g_id = f"data-{graph_id}" if graph_id else "data"

query=f"""
query = f"""
CONSTRUCT {{
?s ?p ?o .
}} WHERE {{
Expand All @@ -227,8 +227,10 @@ def get_all(self, graph_id: str = None) -> str:
return ""

return str(result)

def get_context(self, matched: dict[str, dict], graph_id: str, depth: int = 1) -> str:

def get_context(
self, matched: dict[str, dict], graph_id: str, depth: int = 1
) -> str:
g_id = f"data-{graph_id}" if graph_id else "data"
nodes_set = set()

Expand Down
8 changes: 6 additions & 2 deletions memonto/utils/rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,12 @@ def generate_image(g: Graph, ns: dict[str, Namespace], path: str = None) -> None
if isinstance(o, BNode) and (o, TRIPLE_PROP.uuid, None) in g:
continue

s_label = bnode_labels[s] if isinstance(s, BNode) else to_human_readable(str(s), ns)
o_label = bnode_labels[o] if isinstance(o, BNode) else to_human_readable(str(o), ns)
s_label = (
bnode_labels[s] if isinstance(s, BNode) else to_human_readable(str(s), ns)
)
o_label = (
bnode_labels[o] if isinstance(o, BNode) else to_human_readable(str(o), ns)
)
p_label = to_human_readable(str(p), ns)

dot.node(s_label, s_label)
Expand Down

0 comments on commit 5b0eedb

Please sign in to comment.