Dear Jena Developer,
     I am a Ph.D student in PKU in Beijing, China. I am now learnning about 
Jena. I can find many materials on the web to teach me how to use Jena API, but 
very few about  how Jena works. I just confuse about  the mechanism that Jena 
work with rules.
    I wrote a simple test class with java to make jena API work with a simple 
rule. The source code is in the attachment.

   In this code, I add two triple((a, p, b), and (b, p, c)) into a graph, and 
with a rule(r1) to find the triple(a,p,c). However, I cannot find out how Jena 
API work out the reasoning task and figure out the new triple.
   Since I print(?a,?c) when the rule works, in order to find out when does the 
application work with the rule. It seems that after the  sentence 
"ExtendedIterator<Triple> triples = infgraph.find(null, p, null);", the app 
print out "a, c". So during which sentence(it seems "infgraph.find(null, p, 
null)", but not "infgraph = reasoner.bind(test)") does the application find out 
the new triple, and when does the Rete algorithm works?
 
  Thank your.
  Best wishes.
 -- 
Wang Wusheng 
Research Center for Modern Services 
1020 Resource Plaza, Peking University, 100871 
Email: [email protected]
       [email protected] 
TEL:   +8610 62752177

Reply via email to