0

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.

  • It's not entirely clear what you're asking. A dataset is a collection of graphs for a SPARQL query (a collection of (collections of) triples). A query solution is a set of variable bindings. They don't contain the same kind of thing, so you can't add one to another. Your SPARQL query isn't well formed, so it's not entirely clear what it's supposed to mean. Can you clarify what exactly you already have, and what you're trying to do? – Joshua Taylor Mar 06 '14 at 18:41
  • Hi Joshua, Actually I convert each querysolution to a set of triples by naming that solution and using it as the subject of 3 triples. `sol1 user u1` and `sol1 location loc1` and `sol1 locationtype type1` then i add them to my big dataset and write a rule for reasoning on them. – Soheila DehghanZadeh Mar 07 '14 at 08:20

0 Answers0