kg = py`
from os.path import dirname
import os, io
namespaces = {
"nom": "http://example.org/#",
"wtm": "http://purl.org/heals/food/",
"ind": "http://purl.org/heals/ingredient/",
"skos": "http://www.w3.org/2004/02/skos/core#",
}
kg = ${kglab}.KnowledgeGraph(
name = "A recipe KG example based on Food.com",
base_uri = "https://www.food.com/recipe/",
namespaces = namespaces,
)
with io.open('recipes.ttl','wb') as f:
f.write(${await kgzip
.file("kglab-main/dat/recipes.ttl")
.arrayBuffer()}.tobytes())
kg.load_rdf("recipes.ttl") ;
kg
`