from rdflib import Graph from rdflib import RDF, URIRef, Namespace XPUB = Namespace("http://xpub.nl/terms/") import sys g = Graph() # g.parse("https://project.xpub.nl/index.rdfa.html", format="rdfa") # parsing the local file is failing (issues with rdflib + pyrdfa3) g.parse("https://project.xpub.nl/index.html", format="rdfa") print (g.serialize(format="json-ld", context="https://xpub.nl/contexts/projects.json", auto_compact=True))