Skip to content

Commit

Permalink
fix: typos in parent relations not being detected
Browse files Browse the repository at this point in the history
see #71 to track this work
see #101 for example of errors that are detected by this change
  • Loading branch information
coolharsh55 committed Aug 25, 2023
1 parent 562c5de commit fed71c0
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions documentation-generator/verify_002.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,16 @@ def get_shacl_results(output):



from os import walk
from os import remove, walk
import subprocess


def test_shacl(paths, shape):
def test_shacl(shape):
print(f'validating with constraints in {shape}')
SHACL_VALIDATION_COMMAND['shapesfile'] = shape
command = list(SHACL_VALIDATION_COMMAND.values())
for file in paths:
if not file.endswith('.ttl'):
# skip non-turtle files
continue
command.append('-datafile')
command.append(file)
command.append('-datafile')
command.append('data.ttl')
print(f'command: {command}')
output = subprocess.run(command, stdout=subprocess.PIPE)
output = output.stdout.decode('utf-8')
Expand All @@ -93,6 +89,15 @@ def test_shacl(paths, shape):

#############################################################

g = Graph()
for file in DATA_PATHS:
if not file.endswith('.ttl'):
# skip non-turtle files
continue
g.parse(file)
g.serialize('data.ttl')

for shape in SHAPES:
test_shacl(DATA_PATHS, shape)
test_shacl(shape)

remove('data.ttl')

0 comments on commit fed71c0

Please sign in to comment.