On 10/03/14 09:08, Soheila Dehghanzadeh wrote:
Hi All,
I ran a query on a dataset and i have the result binding of my query solutions.
sol1: user=u1, location=loc1, LocationType=type1sol2: user=u1, location=loc2,
LocationType=type2
now i want to extend my existing query result set with an inference rule. This
inference rule requires combining the existing dataset with above result set to
extend the result set by adding new solutions.
@prefix pre: <http://jena.hpl.hp.com/prefix#>.
[rule1:
(?sol pre:user ?a) (?sol pre:location ?b) (?sol pre:lcationType
?c)
(?b location:ispartof ?d) (?d rdf:type ?type)
-> (sol2 pre:user
?a) (sol2 pre:location ?d) (sol2 pre:locationType ?type) ]
As we can see in the rule above all rules will endup adding properties to sol2
while in fact i want sol2 get a dynamic name for each new inference and add a
new solution not adding properties to the same solution. any comment is greatly
appreciated.
Not sure I follow the requirement exactly but if you want a rule to
create a new resource you have two choices - create a blank node or
create a URI node with some synthesized URI. See makeTemp & makeSkolem
for the first case, see uriConcat for the second.
Be careful that don't end up with a rule which will keep matching on its
own results and creating an unbounded number of new resources.
Dave