introspector-react-app / introspector_rdf.py
mike dupont
adding ontology
41f1ee1
raw
history blame
387 Bytes
import rdflib
import json
g = rdflib.Graph()
g.parse("./introspector.ttl")
knows_query = """
SELECT DISTINCT ?aname ?bname
WHERE {
?a ?b .
?a foaf:name ?aname .
?b foaf:name ?bname .
}"""
def data():
# qres = g.query(knows_query)
res = []
for x in g:
res.append(x)
return res
if __name__ == "__main__":
print(json.dumps(data(),indent=2))