Hi,
Owlready has no support for prefixed IRI in SWRL rule, so you need to use the full IRI, e.g. : "
http://www.w3.org/2002/07/owl#Thing(?variable)"
However, a bug prevents full IRI to work when they are not from the current world (which is the case for Thing). I fixed that bug in the development version.
Alternatively, you can also pass a list of namespace to set_as_rule():
rule.set_as_rule("""Thing(?x) -> D(?x)""", namespaces = [owl, onto])
These namespaces will be searched in order for entity (NB this works with the current version of Owlready).
Jiba