def rapper_count(f, lang):
    p = subprocess.Popen(['rapper', '-i', lang, '-c', f], stdout=subprocess
        .PIPE, stderr=subprocess.PIPE)
output, err = p.communicate()
ret = p.poll()
if ret != 0:
    raise Exception('Error parsing with rapper\n%s' % err)
return int(err.split()[-2])
Validating RDF files using Raptor or Sax