Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion JPS_BASE_LIB/python_wrapper/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='twa',
version='0.0.6',
version='0.0.7',
author='Jiaru Bai; Daniel Nurkowski',
author_email='jb2197@cam.ac.uk; danieln@cmclinnovations.com',
license='MIT',
Expand Down
2 changes: 1 addition & 1 deletion JPS_BASE_LIB/python_wrapper/twa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from twa.JPSGateway import JPSGateway

__version__ = "0.0.6"
__version__ = "0.0.7"
6 changes: 6 additions & 0 deletions JPS_BASE_LIB/python_wrapper/twa/data_model/base_ontology.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,12 @@ def __init__(self, **data):
data['rdfs_label'] = {data['rdfs_label']}
super().__init__(**data)

def __str__(self) -> str:
return self.instance_iri

def __repr__(self) -> str:
return self.__str__()

def model_post_init(self, __context: Any) -> None:
"""
The post init process of the BaseClass.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,13 +262,15 @@ def get_outgoing_and_attributes(self, node_iris: Set[str]) -> Dict[str, Dict[str
Returns:
Dict[str, Dict[str, Set[Any]]]: The dictionary of the outgoing edges and attributes of the given nodes, where the key is the node IRI
"""
result = {}
if isinstance(node_iris, str):
node_iris = [node_iris]
if isinstance(node_iris, list):
node_iris = set(node_iris)
if not node_iris:
return result
query = f"""SELECT ?s ?p ?o WHERE {{VALUES ?s {{ {' '.join([f'<{utils.trim_iri(iri)}>' for iri in node_iris])} }} ?s ?p ?o.}}"""
response = self.perform_query(query)
result = {}
for r in response:
if r['s'] not in result:
result[r['s']] = {}
Expand Down
Loading