Re: Classes with ? at the end can be created, but not queried

Posted by Jiba on
URL: http://owlready.306.s1.nabble.com/Classes-with-at-the-end-can-be-created-but-not-queried-tp3319p3321.html

Hello,

I tried to reproduce the problem with the following code, but I was unable to. Could you try it, and see what happens ?

Jiba


from owlready2 import *
import sys, os, time, types, datetime

onto = get_ontology("http://test.org/onto.owl")

with onto:
  C = types.new_class("C?", (Thing,))
  class D(C): pass
print(C)

r = default_world.sparql("""
SELECT ?s WHERE { ?s rdfs:subClassOf <""" + C.iri + """> . }
""")

print(list(r))
print(list(C.subclasses()))