我正在使用烧瓶应用程序并希望加载本体并打印该本体中有多少类和多少个人
这是我的代码,它不起作用
import flask
from owlready2 import *
app = flask.Flask(__name__)
app.config["DEBUG"] = True
@app.route('/', methods=['GET'])
def start():
onto_path.append("pizza.owl")
onto = get_ontology("pizza.owl")
onto.load()
print(onto.classes())
print(list(onto.individuals()))
html = ''
html += '<h2>clases: ' + onto.classes() + '</br>'
html += '<h3>individuals: ' + onto.individuals()
return html
#return "<h1>Distant Reading Archive</h1><p>This site is a prototype API for distant reading of science fiction novels.</p>"
app.run()