> Hello,I am trying to excute this rule in Jena: > > [r1: (?c http://somewhere#rel1 ?price) > (?c http://somewhere#rel2 ?value) lessThan(?price, ?value) -> > (?y http://somewhere#AnyRelation 'Some Text')] > I have two questions:1- I would like ?y to be a specific instance of a > specific class and created during the excution of the rule. How to create > that instance in the rule? if it can be, is there a way that instance to be > not blank node? > I found this in the Jena documentations: > > makeInstance(?x, ?p, ?v)makeInstance(?x, ?p, ?t, ?v) > but I do not know how to use it because ?v is the blank node so what is ?x? That built-in only creates blank nodes used as a value for a known resource ?x and property ?p. If you want to create an instance, why don't you use the URI you have in mind? > > 2- How to add prefixes in rules? You can add this to the file containing the rules:
@prefix pre: <http://domain/url#>. From the Jena documentation [1]: "Defines a prefix pre which can be used in the rules. The prefix is local to the rule file." [1] https://jena.apache.org/documentation/inference/#rules > ThanksAbdul > > > -- Lorenz Bühmann AKSW group, University of Leipzig Group: http://aksw.org - semantic web research center
