Skip to content

Commit

Permalink
Fix validation of Turtle files
Browse files Browse the repository at this point in the history
  • Loading branch information
avillar committed Aug 1, 2024
1 parent b5a2951 commit 3e8700f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ogc/bblocks/validation/rdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def __init__(self, bblock: BuildingBlock, register: BuildingBlockRegister):

def _load_graph(self, filename: Path, output_filename: Path, report: ValidationReportItem,
contents: str | None = None,
base_uri: str | None = None) -> Graph | None:
graph = None
base_uri: str | None = None) -> Graph | None | bool:
graph = False
if filename.suffix == '.json':
if self.jsonld_error:
report.add_entry(ValidationReportEntry(
Expand Down Expand Up @@ -262,6 +262,7 @@ def _load_graph(self, filename: Path, output_filename: Path, report: ValidationR
'exception': e.__class__.__qualname__,
}
))
return

return graph

Expand All @@ -272,8 +273,10 @@ def validate(self, filename: Path, output_filename: Path, report: ValidationRepo
**kwargs) -> bool | None:
graph = self._load_graph(filename, output_filename, report, contents, base_uri)

if graph is None:
if graph is False:
return False
if graph is None:
return

if graph is not None and (contents or filename.suffix != '.ttl'):
try:
Expand Down

0 comments on commit 3e8700f

Please sign in to comment.