i have a result binding in jena query solution(say sol1: user=u1, location=loc1, LocationType=type1
) and I want to use a dataset to extend my result binding using a set of jena rules. in fact, having sol1 and having
loc1 location:ispartof loc2
loc2 rdf:type loc2Type
in my dataset, i want to add this new solution to my result set:
sol2: user1=u1, location=loc2, locationType=loc2Type
for that, i need to add my solution set to my dataset, write a rule like
@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) ]
do inference based on above rule.Afterward to extract all solutions from dataset i need to query dataset with
@prefix pre: <http://jena.hpl.hp.com/prefix#>.
select * WHERE {?sol pre:user ?a. ?sol pre:location ?b. ?sol pre:lcationType ?c.}
Now my problem is
1) is there any way to prevent adding my solutions to my big dataset by writing resoning rule on 2 datasets?
2)how to individually name each new solution in rule consequence?
Thanks.