Skip to content

Commit

Permalink
Renamed model_to_rdf for BaseEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
JosePizarro3 committed Jan 30, 2025
1 parent 254f2eb commit 70fa399
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bam_masterdata/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def export_to_rdf(force_delete, python_path):
module for module in py_modules if "vocabulary_types.py" not in module
]

# Process each module using the `to_json` method of each entity
# Process each module using the `model_to_rdf` method of each entity
graph = Graph()
for module_path in py_modules:
entities_to_rdf(graph=graph, module_path=module_path, logger=logger)
Expand Down
6 changes: 3 additions & 3 deletions bam_masterdata/cli/entities_to_rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,12 @@ def entities_to_rdf(
# ? For OBJECT TYPES
# ? `generated_code_prefix`, `auto_generated_codes`?
for name, obj in inspect.getmembers(module, inspect.isclass):
# Ensure the class has the `to_json` method
if not hasattr(obj, "defs") or not callable(getattr(obj, "to_rdf")):
# Ensure the class has the `model_to_rdf` method
if not hasattr(obj, "defs") or not callable(getattr(obj, "model_to_rdf")):
continue
try:
# Instantiate the class and call the method
entity = obj()
entity.to_rdf(namespace=BAM, graph=graph)
entity.model_to_rdf(namespace=BAM, graph=graph)
except Exception as err:
click.echo(f"Failed to process class {name} in {module_path}: {err}")

1 comment on commit 70fa399

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
bam_masterdata
   logger.py80100% 
bam_masterdata/cli
   cli.py905656 38%
   entities_to_excel.py5433 94%
   entities_to_json.py3655 86%
   entities_to_rdf.py726161 15%
   excel_to_entities.py328314314 4%
   fill_masterdata.py195181181 7%
bam_masterdata/datamodel
   collection_types.py370100% 
   dataset_types.py184184184 0%
   object_types.py15150100% 
   property_types.py8000100% 
   vocabulary_types.py137210100% 
bam_masterdata/metadata
   definitions.py850100% 
   entities.py883030 66%
bam_masterdata/openbis
   get_entities.py534343 19%
   login.py633 50%
bam_masterdata/utils
   utils.py4677 85%
TOTAL1731888795% 

Tests Skipped Failures Errors Time
72 1 💤 0 ❌ 0 🔥 19.473s ⏱️

Please sign in to comment.