Skip to content

Instantly share code, notes, and snippets.

Embed
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):
pass
sink = MySink()
parser = NTriplesParser(sink)
with open(filename, "rb") as anons:
parser.parse(anons)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.