13 views
Skip to first unread message

Samuel Morello

unread,
May 14, 2012, 1:43:56 PM5/14/12
to 4store-support
Hi,

Can someone tell me if it is possible to do this :

PREFIX dc: <http://purl.org/dc/terms/>

DELETE {
<aUri> dc:title ?title ;
dc:description ?description .
}


WHERE {
<aUri> dc:title ?title ;
dc:description ?description .
}


I did try many things, but I can not make it work ?
Thanks,

Samuel


Steve Harris

unread,
May 14, 2012, 2:21:11 PM5/14/12
to 4store-...@googlegroups.com
It is, yes, as long as you have a new enough 4store, and rasqal.

Someone reported that they couldn't get it to work, but I've not been able to reproduce that.

Do you have a fragment of data that this update doesn't work with, and can you say what versions of 4store and rasqal you're using?

- Steve
> --
> You received this message because you are subscribed to the Google Groups "4store-support" group.
> 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, Nottingham, Notts, NG80 1ZZ

Samuel Morello

unread,
May 15, 2012, 4:54:39 AM5/15/12
to 4store-...@googlegroups.com
Hi,


I use the head version of github (yesterday install but it appears also with a previous version: 4 weeks ago install) with rasqal 0.9.28
The triples are inserted in a graph.


Here is a sequence i tried :

1. INSERT

INSERT {
graph <http://graph.com/mygraph> {
<http://uri.com/resource1> <http://uri.com/predicate1> 'Literal1' .
<http://uri.com/resource1> <http://uri.com/predicate2> 'Literal2' .
}
}




2. DELETE from GRAPH (does nothing)

DELETE {
graph <http://graph.com/mygraph> {
<http://uri.com/resource1> <http://uri.com/predicate1> 'Literal1' .
<http://uri.com/resource1> <http://uri.com/predicate2> 'Literal2' .
}
}




3. DELETE (does nothing)

DELETE {
<http://uri.com/resource1> <http://uri.com/predicate1> ?t ;
<http://uri.com/predicate2> ?t .
}






4. DELETE with WHERE (only remove the first triple)

DELETE {
<http://uri.com/resource1> <http://uri.com/predicate1> ?t ;
<http://uri.com/predicate2> ?t .
} WHERE {
<http://uri.com/resource1> <http://uri.com/predicate1> ?t ;
<http://uri.com/predicate2> ?t .
}






Many thanks,

Samuel


Le lundi 14 mai 2012 à 20:21, Steve Harris a écrit :

> It is, yes, as long as you have a new enough 4store, and rasqal.
>
> Someone reported that they couldn't get it to work, but I've not been able to reproduce that.
>
> Do you have a fragment of data that this update doesn't work with, and can you say what versions of 4store and rasqal you're using?
>
> - Steve
>
> On 2012-05-14, at 18:43, Samuel Morello wrote:
>
> > Hi,
> >
> > Can someone tell me if it is possible to do this :
> >
> > PREFIX dc: <http://purl.org/dc/terms/>
> >
> > DELETE {
> > <aUri> dc:title ?title ;
> > dc:description ?description .
> > }
> >
> >
> > WHERE {
> > <aUri> dc:title ?title ;
> > dc:description ?description .
> > }
> >
> >
> > I did try many things, but I can not make it work ?
> > Thanks,
> >
> > Samuel
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups "4store-support" group.
> > To post to this group, send email to 4store-...@googlegroups.com (mailto:4store-...@googlegroups.com).
> > To unsubscribe from this group, send email to 4store-suppor...@googlegroups.com (mailto: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, Nottingham, Notts, NG80 1ZZ
>
> --
> You received this message because you are subscribed to the Google Groups "4store-support" group.
> To post to this group, send email to 4store-...@googlegroups.com (mailto:4store-...@googlegroups.com).
> To unsubscribe from this group, send email to 4store-suppor...@googlegroups.com (mailto:4store-suppor...@googlegroups.com).

Samuel Morello

unread,
May 15, 2012, 5:12:51 AM5/15/12
to 4store-...@googlegroups.com
Sorry i made errors while copying the code i sent but the result is the same when corrected :

Only remove the first triple :

DELETE {
graph <http://graph.com/mygraph> {
<http://uri.com/resource1> <http://uri.com/predicate1>?t1 .
<http://uri.com/resource1> <http://uri.com/predicate2> ?t2 .
}
} WHERE {
graph <http://graph.com/mygraph> {
<http://uri.com/resource1> <http://uri.com/predicate1>?t1 .
<http://uri.com/resource1> <http://uri.com/predicate2> ?t2 .
}
}



Only remove the first triple :

DELETE {
<http://uri.com/resource1> <http://uri.com/predicate1>?t1 .
<http://uri.com/resource1> <http://uri.com/predicate2> ?t2 .
} WHERE {
<http://uri.com/resource1> <http://uri.com/predicate1>?t1 .
<http://uri.com/resource1> <http://uri.com/predicate2> ?t2 .

Steve Harris

unread,
May 15, 2012, 11:21:09 AM5/15/12
to 4store-...@googlegroups.com
On 15 May 2012, at 09:54, Samuel Morello wrote:

> Hi,
>
>
> I use the head version of github (yesterday install but it appears also with a previous version: 4 weeks ago install) with rasqal 0.9.28
> The triples are inserted in a graph.
>
>
> Here is a sequence i tried :
>
> 1. INSERT
>
> INSERT {
> graph <http://graph.com/mygraph> {
> <http://uri.com/resource1> <http://uri.com/predicate1> 'Literal1' .
> <http://uri.com/resource1> <http://uri.com/predicate2> 'Literal2' .
> }
> }
>
>
>
>
> 2. DELETE from GRAPH (does nothing)
>
> DELETE {
> graph <http://graph.com/mygraph> {
> <http://uri.com/resource1> <http://uri.com/predicate1> 'Literal1' .
> <http://uri.com/resource1> <http://uri.com/predicate2> 'Literal2' .
> }
> }

This one is a syntax error, should be DELETE WHERE { … }

If a workaround is helpful, then DELETE DATA in this case works, I can confirm that DELETE WHERE doesn't. I suspect the lack of variables is confusing it. Should be an easy fix.

> 3. DELETE (does nothing)
>
> DELETE {
> <http://uri.com/resource1> <http://uri.com/predicate1> ?t ;
> <http://uri.com/predicate2> ?t .
> }

This one should do nothing - there's no valid binding for ?t, in my testing the fixed one:

DELETE {
<http://uri.com/resource1> <http://uri.com/predicate1> ?t1 ;
<http://uri.com/predicate2> ?t2 .
} WHERE {
<http://uri.com/resource1> <http://uri.com/predicate1> ?t1 ;
<http://uri.com/predicate2> ?t2 .
}

Does remove both triples, with 4store Git HEAD and rasqal 0.9.28.

Query: SELECT DISTINCT * WHERE { GRAPH ?G { ?s ?p ?o } } ORDER BY ?G ?s ?p ?o
?G ?s ?p ?o
<http://graph.com/mygraph> <http://uri.com/resource1> <http://uri.com/predicate2> "Literal2"

Update: DELETE {
<http://uri.com/resource1> <http://uri.com/predicate1> ?t1 ;
<http://uri.com/predicate2> ?t2 .
} WHERE {
<http://uri.com/resource1> <http://uri.com/predicate1> ?t1 ;
<http://uri.com/predicate2> ?t2 .
}

Query: SELECT DISTINCT * WHERE { GRAPH ?G { ?s ?p ?o } } ORDER BY ?G ?s ?p ?o
?G ?s ?p ?o

- Steve
> 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

Samuel Morello

unread,
May 15, 2012, 11:29:30 AM5/15/12
to 4store-...@googlegroups.com
Thanks,
I know i made mistake while copying the code but the solution here does not work at all for me ????
It only removes the first triple


Where should i look ?
I am on mac and relook at the version and it is ok

Thanks,
Samuel
> Registered office: Landmark House, Experian Way, NG2 Business Park, Nottingham, Nottinghamshire, England NG80 1ZZ
>

Steve Harris

unread,
May 15, 2012, 11:55:24 AM5/15/12
to 4store-...@googlegroups.com
I am also on a Mac (10.7 Lion).

Can you uncomment the DEBUG_MERGE line in /src/frontend/debug.h, recompile, and install, then run

$ 4s-backend-setup test
$ 4s-backend test
$ 4s-update test "INSERT { GRAPH <http://graph.com/mygraph> { <http://uri.com/resource1> <http://uri.com/predicate1> 'Literal1' . <http://uri.com/resource1> <http://uri.com/predicate2> 'Literal2' .}}"
$ 4s-update test 'DELETE { <http://uri.com/resource1> <http://uri.com/predicate1> ?t1 ; <http://uri.com/predicate2> ?t2 . } WHERE { <http://uri.com/resource1> <http://uri.com/predicate1> ?t1 ; <http://uri.com/predicate2> ?t2 .}'
$ 4s-query test 'SELECT * WHERE { GRAPH ?g { ?s ?p ?o }}'

There will be loads of debug output, can you paste that.

- Steve
> To post to this group, send email to 4store-...@googlegroups.com.
> To unsubscribe from this group, send email to 4store-suppor...@googlegroups.com.

Samuel Morello

unread,
May 15, 2012, 12:08:34 PM5/15/12
to 4store-...@googlegroups.com
I am terribly sorry but i can not make it work ...
I did the following :

git clone https://github.com/garlik/4store.git

uncomment the DEBUG_MERGE line in /src/frontend/debug.h

./autogen.sh

./configure --prefix=/usr/local/Cellar/fourstore/HEAD --with-storage-path=/usr/local/var/fourstore --sysconfdir=/usr/local/etc/fourstore --enable-dedup-insert
make
sudo make install

and then all the 4s-update lines you sent.
I only get the following result in the output and no debug logs :
<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
<head>
<variable name="g"/>
<variable name="s"/>
<variable name="p"/>
<variable name="o"/>
</head>
<results>
<result>
<binding name="g"><uri>http://graph.com/mygraph</uri></binding>
<binding name="s"><uri>http://uri.com/resource1</uri></binding>
<binding name="p"><uri>http://uri.com/predicate2</uri></binding>
<binding name="o"><literal>Literal2</literal></binding>
</result>
</results>
</sparql>



Thanks,
Sam

Steve Harris

unread,
May 15, 2012, 12:36:03 PM5/15/12
to 4store-...@googlegroups.com
So, I think that means you have some old 4store binaries installed in another location, presumably /usr/local/bin/. Can you run 4s-update --version, and check it against git describe --tags. Both should be v1.1.4-207-g530264c, or something very similar.

I've just retested with --enable-dedup-insert, incase that was causing a bug, but I can confirm that it still works.

With DEBUG_MERGE and Git HEAD you should have had output that looks like:
ADD triple(uri<http://uri.com/resource1>, uri<http://uri.com/predicate1>, variable(t1)) to B1
ADD triple(uri<http://uri.com/resource1>, uri<http://uri.com/predicate2>, variable(t2)) to B1
Merge B1 to B0

After compact:
B0, join NONE, parent B0
P0 triple(uri<http://uri.com/resource1>, uri<http://uri.com/predicate1>, variable(t1))
P1 triple(uri<http://uri.com/resource1>, uri<http://uri.com/predicate2>, variable(t2))

Processing B0, parent is B0
execute 0/2: triple(uri<http://uri.com/resource1>, uri<http://uri.com/predicate1>, variable(t1)) DISTINCT
mmmms (_,_[f7d2d213bd234f98],_[d842c1cfc4e4d77d],?) -> 1
append all, result:
t1 t2
row order p-nb A00 D-1 p-n A00 D-1
0 0 4ce5342b423f766b null
1 bindings (1)
execute 1/2: triple(uri<http://uri.com/resource1>, uri<http://uri.com/predicate2>, variable(t2)) DISTINCT
mmmms (_,_[f7d2d213bd234f98],_[e0bcc1593adc4a1e],?) -> 1
old: 1 bindings
t1 t2
row p-nb A00 D-1 pun A00 D-1
0 4ce5342b423f766b null
new: 1 bindings
t1 t2
row p-nb A00 D-1 p-nb A00 D-1
0 null 373af919ca19a580
result: 1 bindings
t1 t2
row p-nb A00 D-1 p-nb A00 D-1
0 4ce5342b423f766b 373af919ca19a580
1 bindings (1)
Processing B1, parent is B0
skipping B1, no bindings
skipping B1, no bindings
> To post to this group, send email to 4store-...@googlegroups.com.
> To unsubscribe from this group, send email to 4store-suppor...@googlegroups.com.

Samuel Morello

unread,
May 15, 2012, 12:47:50 PM5/15/12
to 4store-...@googlegroups.com
Yes that's true.
Sorry for that...
I did not correctly installed 4store.
Everythings work fine now
Sorry and many thanks for the support

Samuel
> > ./autogen.sh (http://autogen.sh)

Steve Harris

unread,
May 15, 2012, 12:50:20 PM5/15/12
to 4store-...@googlegroups.com
No problem. We got a testcase out of it if nothing else :)

- Steve
> To post to this group, send email to 4store-...@googlegroups.com.
> To unsubscribe from this group, send email to 4store-suppor...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages