You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
436 B
Python

12 months ago
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))