Skip to content

Instantly share code, notes, and snippets.

@ozekik
Created March 20, 2020 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozekik/b2ae3be0fcaa59670d4dd4759cdffbed to your computer and use it in GitHub Desktop.
Save ozekik/b2ae3be0fcaa59670d4dd4759cdffbed to your computer and use it in GitHub Desktop.
LightPDF Bench 1
import lightrdf
import sys
parser = lightrdf.Parser()
cnt = 0
for triple in parser.parse(sys.argv[1]):
cnt += 1
print(cnt)
from lightrdf import RDFDocument
import sys
doc = RDFDocument(sys.argv[1])
cnt = 0
for triple in doc.search_triples(None, None, None):
cnt += 1
print(cnt)
from rdflib import Graph
import sys
g = Graph()
g.parse(sys.argv[1])
cnt = 0
for triple in g:
cnt += 1
print(cnt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment