How to solve the speed problem of rule inference

Hi,
I materialize the inferences, my query is below:

INSERT {
    ?a :hasAncestor ?c
} WHERE {
    ?a :hasAncestor ?c
}

:Person_1 :hasAncestor :Person_2
:Person_2 :hasAncestor :Person_3
.
.
:Person_999 :hasAncestor :Person_1000

I want to infer the :Person_1 :hasAncestor :Person_2, :Person_3..., :Person_1000

1000 data need 91698 ms to implement the insert query
10000 and 100000 data will exceed query timeout(5s)

May I know how to increase execution speed for inferences?

Thanks.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.