It would help if you explained the intent of the rule, as written it looks a bit odd. You start by selecting a 3 way cross products of all types so you are immediately making life hard for the rule engine i.e.
(?a rdf:type owl:Class) (?b rdf:type owl:Class) (?d rdf:type owl:Class)
So given 100 owl:Class
instances in your data your rule has to consider 100*100*100 combinations i.e 1 million combinations. Which is why adding a small amount of extra data makes this so much worse.
As for what the equal()
and unequal()
assertions are trying to do I am entirely unsure.
Are you simply trying to assert rdf:type
for indirect super-classes? In which case this can be done more simply like so:
[(?a rdf:subClassOf ?b) (?b rdf:type ?c) -> (?a rdf:type ?c)]
Note that it doesn't matter if the triples generated already exist since RDF is a set of triples so duplicate data is simply ignored.