Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Parse NTriples Quickstart
#!/usr/bin/env python
from rdflib.plugins.parsers.ntriples import NTriplesParser, Sink
filename = 'input.nt'
class MySink(Sink):
def triple(self, s, p, o):
sink = MySink()
parser = NTriplesParser(sink)
with open(filename, "rb") as anons:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment