Skip to content

Commit 1d98d04

Browse files
use constant for CBD length in entities
1 parent f5d0aa4 commit 1d98d04

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

cmem_plugin_pyshacl/plugin_pyshacl.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
SHUI_SHAPE_CATALOG,
5858
THESAURUS_PROJECT,
5959
]
60+
CBD_LINES = 50
6061

6162

6263
def e_t(start: float) -> float:
@@ -485,11 +486,11 @@ def check_object( # noqa: C901 PLR0912
485486
if label:
486487
res_val = str(label)
487488
if not res_val:
488-
# first 50 lines of turtle CBD
489+
# first [CBD_LINES] lines of turtle CBD
489490
res_val = graph.cbd(obj).serialize(format="turtle")
490491
cbd_lines = res_val.split("\n")
491-
if len(cbd_lines) > 50: # noqa: PLR2004
492-
res_val = "\n".join(cbd_lines[:50]) + "\n..."
492+
if len(cbd_lines) > CBD_LINES:
493+
res_val = "\n".join(cbd_lines[:CBD_LINES]) + "\n..."
493494
elif isinstance(obj, Literal):
494495
if pred == SH.value:
495496
res_val = f'"{obj}"^^<{obj.datatype}>' if obj.datatype else f'"{obj}"'

0 commit comments

Comments
 (0)