import re
for row in qres:
print(" %s is %s" % tuple(re.sub(r'^.*[/#]', '', r) for r in row))
for row in qres:
print(" %s is %s" % tuple(g.qname(r).split(':')[1] for r in row))
import rdflib
g = rdflib.Graph()
qres = g.query(
"""
select ?i ?type where {
?i a/(rdfs:subClassOf)* ?type
}""")
for row in qres:
i, type_ = [e.n3(g.namespace_manager) for e in row]
print(f"{i} is {type_}")
so:Apurva is so:Man so:Apurva is so:Mortal so:Cathy is so:Girl so:Cathy is so:Mad
```
--
http://github.com/RDFLib
---
You received this message because you are subscribed to the Google Groups "rdflib-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rdflib-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rdflib-dev/0b0cd799-73d5-40e2-961a-c02ca8ad896eo%40googlegroups.com.
On 9 Jun 2020, at 9:10 am, Wes Turner <wes.t...@gmail.com> wrote:
To view this discussion on the web visit https://groups.google.com/d/msgid/rdflib-dev/CACfEFw83MFLMYJmBWind0CuHPar5YkV0t8aR%3DUUh3m3-xKAk8A%40mail.gmail.com.