Skip to content

Commit

Permalink
Store initialization configuration in forge._config method (#333)
Browse files Browse the repository at this point in the history
  • Loading branch information
crisely09 authored and MFSY committed Jul 5, 2024
1 parent 50130ec commit 0b3b91f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 6 additions & 1 deletion kgforge/core/forge.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ def __init__(self, configuration: Union[str, Dict], **kwargs) -> None:
else:
config = deepcopy(configuration)

# Store initial configuration
self._config = {"config": deepcopy(config), "kwargs": deepcopy(kwargs)}

# Debugging.
self._debug = kwargs.pop("debug", False)

Expand Down Expand Up @@ -352,7 +355,9 @@ def validate(
RDFS entailment rules (https://www.w3.org/TR/rdf-mt/). In this example 'owlrl' or 'rdfsowlrl' are also possible values while no inference will be performed with None .
:return: None
"""
self._model.validate(data, execute_actions_before, type_=type_, inference=inference)
self._model.validate(
data, execute_actions_before, type_=type_, inference=inference
)

# Resolving User Interface.

Expand Down
2 changes: 2 additions & 0 deletions tests/core/test_forge.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class TestForgeInitialization:

def test_initialization(self, config):
forge = KnowledgeGraphForge(config)
assert forge._config['config'] == config
assert forge._config['kwargs'] == {}
assert os.environ['PYSHACL_USE_FULL_MIXIN'] == "True"
assert type(forge._model).__name__ == MODEL
assert type(forge._store).__name__ == STORE
Expand Down

0 comments on commit 0b3b91f

Please sign in to comment.