Skip to content
This repository has been archived by the owner on Dec 26, 2021. It is now read-only.

Commit

Permalink
rename "Triple constraint" => "Statement constraint"
Browse files Browse the repository at this point in the history
  • Loading branch information
tombaker committed Dec 15, 2020
1 parent 61c695f commit b1d8951
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion csv2shex/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ def model(context):
print(" Shape elements:")
for element in shape_elements:
print(f" {element}")
print(" Triple constraint elements:")
print(" Statement Constraint elements:")
for element in tconstraint_elements:
print(f" {element}")
3 changes: 1 addition & 2 deletions csv2shex/csvreader.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ def _get_rows(csvfile):
"""Return list of row dicts from CSV file."""
csv_dictreader = DictReader(Path(csvfile).open(newline="", encoding="utf-8-sig"))
rows = list(csv_dictreader)
breakpoint(context=5)
if "propertyID" not in list(rows[0].keys()):
if "propertyID" not in csv_dictreader.fieldnames:
raise CsvError("Valid DCTAP CSV must have a 'propertyID' column.")
return rows

Expand Down
2 changes: 1 addition & 1 deletion csv2shex/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def pprint_csvshapes(csvshapes_list, verbose=False):
pprint_output.append(8 * " " + key + ": " + str(csvshape_dict[key]))

for tc_dict in csvshape_dict.get("tc_list"):
pprint_output.append(" Triple Constraint")
pprint_output.append(" Statement Constraint")
for key in tconstraint_elements:
if not verbose and tc_dict[key]:
pprint_output.append(12 * " " + str(key) + ": " + str(tc_dict[key]))
Expand Down
2 changes: 1 addition & 1 deletion csv2shex/mkshex.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def get_nc() -> NodeConstraint:
# if csv_tc.valueShape:
# if rval:
# raise ValueError(
# "Triple constraint cannot have both "
# "Statement constraint cannot have both "
# "a NodeConstraint and a ValueConstraint"
# )
# return IRIREF(csv_tc.valueShape)
Expand Down
12 changes: 6 additions & 6 deletions tests/test_inspect_pprint_csvshapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ def test_get_csvshape_dicts_list_two_shapes():
Shape
shapeID: :a
start: True
Triple Constraint
Statement Constraint
propertyID: dct:creator
Triple Constraint
Statement Constraint
propertyID: dct:date
Shape
shapeID: :b
Triple Constraint
Statement Constraint
propertyID: foaf:name
"""
)
Expand All @@ -93,7 +93,7 @@ def test_get_csvshape_dicts_list_two_shapes_verbose():
shapeLabel: None
shapeClosed: False
start: True
Triple Constraint
Statement Constraint
propertyID: dct:creator
propertyLabel: None
mandatory: False
Expand All @@ -104,7 +104,7 @@ def test_get_csvshape_dicts_list_two_shapes_verbose():
valueConstraintType: None
valueShape: None
note: None
Triple Constraint
Statement Constraint
propertyID: dct:date
propertyLabel: None
mandatory: False
Expand All @@ -120,7 +120,7 @@ def test_get_csvshape_dicts_list_two_shapes_verbose():
shapeLabel: None
shapeClosed: False
start: False
Triple Constraint
Statement Constraint
propertyID: foaf:name
propertyLabel: None
mandatory: False
Expand Down

0 comments on commit b1d8951

Please sign in to comment.