if parser is None:
    raise Exception('Failed to create RDF.Parser raptor')
count = 0
for s in parser.parse_as_stream(uri, uri):
    count = count + 1
print('Parsing added', count, 'statements')
Validating RDF files using Raptor or Sax