Issue with INSERT WHERE

15 views
Skip to first unread message

nrajguru

unread,
May 5, 2012, 7:15:00 PM5/5/12
to 4store-...@googlegroups.com
I am trying to insert values using INSERT WHERE. The query is as follows,

INSERT {
<http://some.com#test2> rdf:type <http://dbpedia.org/ontology/Floor> .
?URI1257846444363706 <http://dbpedia.org/ontology/TestFloor> <http:// some.com #test2> .
<http:// some.com #test2> <http://dbpedia.org/ontology/floorNo> 'B11' .
}
WHERE {
?URI1257846444278864 rdf:type <http://dbpedia.org/ontology/Campus> .
?URI1257846444278864 <http://dbpedia.org/ontology/hasCampusCode> 'ABC' .
?URI1257846444363706 rdf:type <http://dbpedia.org/ontology/Building> .
?URI1257846444278864 <http://dbpedia.org/ontology/Building> ?URI1257846444363706 .
?URI1257846444363706 <http://dbpedia.org/ontology/hasBuildingCode> 'XYZ' .
}


When I run the above query the triples in INSERT are not inserted in the store (I tried retrieving the triples using a SELECT query, but it returns no results). I have checked all the triples in WHERE clause and all of them do exist in the store.

PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT * {
?URI1257846444278864 rdf:type <http://dbpedia.org/ontology/Campus> .
?URI1257846444278864 <http://dbpedia.org/ontology/hasCampusCode> 'ABC' .
?URI1257846444363706 rdf:type <http://dbpedia.org/ontology/Building> .
?URI1257846444278864 <http://dbpedia.org/ontology/Building> ?URI1257846444363706 .
?URI1257846444363706 <http://dbpedia.org/ontology/hasBuildingCode> 'XYZ' .

}

Results:
<head>
    <variable name="URI1257846444278864"/>
    <variable name="URI1257846444363706"/>
  </head>
  <results>
    <result>
      <binding name="URI1257846444278864"><uri>http://some.com/Ontology/2012.owl#ranfa1087b9-6cee-4433-a4d3-816e9b1af208</uri></binding>
      <binding name="URI1257846444363706"><uri>http://some.com/Ontology/2012.owl#ran1224548700931885</uri></binding>
    </result>
  </results>



But the same INSERT WHERE with just one variable works fine,

INSERT { 
<http://some.com#test2> rdf:type <http://dbpedia.org/ontology/Floor> . 
?URI1257846444363706 <http://dbpedia.org/ontology/TestFloor> <http:// some.com #test2> . 
<http:// some.com #test2> <http://dbpedia.org/ontology/floorNo> 'B11' . 

WHERE { 
?URI1257846444363706 rdf:type <http://dbpedia.org/ontology/Building> . 
?URI1257846444363706 <http://dbpedia.org/ontology/hasBuildingCode> 'XYZ' . 
}



Is something wrong in the 1st INSERT WHERE ?

Steve Harris

unread,
May 6, 2012, 5:18:19 AM5/6/12
to 4store-...@googlegroups.com
This was somewhat answered on Stack Overflow, but this is a more appropriate place to ask, probably.

- Steve

--
You received this message because you are subscribed to the Google Groups "4store-support" group.
To view this discussion on the web visit https://groups.google.com/d/msg/4store-support/-/yB-sSxXKilYJ.
To post to this group, send email to 4store-...@googlegroups.com.
To unsubscribe from this group, send email to 4store-suppor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/4store-support?hl=en.

-- 
Steve Harris, CTO
Garlik, a part of Experian 
1-3 Halford Road, Richmond, TW10 6AW, UK
+44 20 8439 8203  http://www.garlik.com/
Registered in England and Wales 653331 VAT # 887 1335 93
Registered office: Landmark House, Experian Way, NG2 Business Park, Nottingham, Nottinghamshire, England NG80 1ZZ

nrajguru

unread,
May 8, 2012, 1:54:16 PM5/8/12
to 4store-support
Thanks for your reply.

I did try the SELECT * with just the WHERE part. I have attached the
results above with my question. URIs for the two entities, being
looked up in WHERE clause, are present in the store.

I am using following versions,
Raptor version 2.0.4
Rasqal version 0.9.26
4Store v1.1.4-168-g98398ef
> >       <binding name="URI1257846444278864"><uri>http://some.com/Ontology/2012.owl#ranfa1087b9-6cee-4433-a4d3-816e9b1a...</uri></binding>
> >       <binding name="URI1257846444363706"><uri>http://some.com/Ontology/2012.owl#ran1224548700931885</uri></binding>
> >     </result>
> >   </results>
>
> > But the same INSERT WHERE with just one variable works fine,
>
> > INSERT {
> > <http://some.com#test2> rdf:type <http://dbpedia.org/ontology/Floor> .
> > ?URI1257846444363706 <http://dbpedia.org/ontology/TestFloor> <http:// some.com #test2> .
> > <http:// some.com #test2> <http://dbpedia.org/ontology/floorNo> 'B11' .
> > }
> > WHERE {
> > ?URI1257846444363706 rdf:type <http://dbpedia.org/ontology/Building> .
> > ?URI1257846444363706 <http://dbpedia.org/ontology/hasBuildingCode> 'XYZ' .
> > }
>
> > Is something wrong in the 1st INSERT WHERE ?
>
> > --
> > You received this message because you are subscribed to the Google Groups "4store-support" group.
> > To view this discussion on the web visithttps://groups.google.com/d/msg/4store-support/-/yB-sSxXKilYJ.
> > To post to this group, send email to 4store-...@googlegroups.com.
> > To unsubscribe from this group, send email to 4store-suppor...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/4store-support?hl=en.

Steve Harris

unread,
May 8, 2012, 2:06:21 PM5/8/12
to 4store-...@googlegroups.com
Interesting, that looks like a bug.

I will try and reproduce. Could you create a ticket at https://github.com/garlik/4store/issues ?

Thanks,
Steve
> For more options, visit this group at http://groups.google.com/group/4store-support?hl=en.

nrajguru

unread,
May 8, 2012, 2:46:09 PM5/8/12
to 4store-support

Steve Harris

unread,
May 8, 2012, 3:07:33 PM5/8/12
to 4store-...@googlegroups.com
Excellent, thanks.
> For more options, visit this group at http://groups.google.com/group/4store-support?hl=en.
Reply all
Reply to author
Forward
0 new messages