kg_nom = py`
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_nom = ${kglab}.KnowledgeGraph(
name = "A recipe KG example based on Food.com",
base_uri = "https://www.food.com/recipe/",
namespaces = namespaces,
)
import io
with io.open('tmp.ttl','w',encoding='utf8') as f:
f.write(${await FileAttachment("ex2_0_tmp.ttl").text()})
kg_nom.load_rdf("tmp.ttl")
with io.open('nom.ttl','w',encoding='utf8') as f:
f.write(${await kgzip.file("kglab-main/dat/nom.ttl").text()})
kg_nom.load_rdf("nom.ttl")
kg_nom`