Skip to content

Commit

Permalink
rename get_shape_stuff to prepare_shapes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssssarah committed Aug 16, 2024
1 parent 1334e32 commit 19e3556
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kgforge/specializations/models/rdf_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def _validate(

return resource

def _get_shape_stuff(self, r: Resource, type_: str) -> Tuple[str, ShapeWrapper, Graph, Graph, Resource]:
def _prepare_shapes(self, r: Resource, type_: str) -> Tuple[str, ShapeWrapper, Graph, Graph, Resource]:
type_to_validate = RdfService.type_to_validate_against(r, type_)
shape, shacl_graph, ont_graph = self.service.get_shape_graph(
node_shape_uriref=self.service.get_shape_uriref_from_class_fragment(type_to_validate)
Expand All @@ -179,7 +179,7 @@ def _validate_many(self, resources: List[Resource], type_: str, inference: str)

def validate_iterator():
for r in resources:
type_to_validate, shape, shacl_graph, ont_graph, r = self._get_shape_stuff(r, type_)
type_to_validate, shape, shacl_graph, ont_graph, r = self._prepare_shapes(r, type_)
yield type_to_validate, shape, shacl_graph, ont_graph, r, inference, self.service.context

resources_2 = Pool(processes=VALIDATION_PARALLELISM).starmap(RdfModel.fc_call, validate_iterator())
Expand All @@ -190,7 +190,7 @@ def validate_iterator():

def _validate_one(self, resource: Resource, type_: str, inference: str) -> None:

type_to_validate, shape, shacl_graph, ont_graph, r = self._get_shape_stuff(resource, type_)
type_to_validate, shape, shacl_graph, ont_graph, r = self._prepare_shapes(resource, type_)

RdfModel._validate(
resource=r, type_to_validate=type_to_validate, inference=inference, shape=shape, shacl_graph=shacl_graph,
Expand Down

0 comments on commit 19e3556

Please sign in to comment.