[ 
https://issues.apache.org/jira/browse/MARMOTTA-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13613713#comment-13613713
 ] 

Raffaele Palmieri commented on MARMOTTA-175:
--------------------------------------------

There are two kins of problem,
the first is that for running this delete command:
DELETE FROM triples WHERE deleted = true
 you have to disable safe mode on mysql, that I have enabled, because deleted 
is not a key field.
The second is the syntax of query, I suggest to use this multidelete command:
-------------------------------------------------------------------------------------------
DELETE t FROM 
triples as t LEFT JOIN 
((SELECT triple_id FROM reasoner_justifications) 
UNION (SELECT triple_id FROM reasoner_just_supp_triples) 
UNION (SELECT triple_id FROM versions_removed) 
UNION (SELECT triple_id FROM versions_added) )as v
on t.id=v.triple_id
where v.triple_id is null and t.deleted=true
--------------------------------------------------------------------------------
Do you agree?
Raffaele.
                
> Garbage collection on triple tables
> -----------------------------------
>
>                 Key: MARMOTTA-175
>                 URL: https://issues.apache.org/jira/browse/MARMOTTA-175
>             Project: Marmotta
>          Issue Type: Bug
>          Components: Triple Store
>    Affects Versions: 3.1-incubating
>         Environment: Centos 6.4 64b - JDK 1.6.0_38 - MySql 5.1.67 -  Tomcat 
> 7.0.37
>            Reporter: Raffaele Palmieri
>            Assignee: Sebastian Schaffert
>            Priority: Minor
>              Labels: garbage, mysql, triplestore
>
> During garbage collection of triple tables in log there is the following line:
> SQL error while executing garbage collection on triples table: You have an 
> error in your SQL syntax; check the manual that corresponds to your MySQL 
> server version for the right syntax to use near 'UNION (SELECT triple_id FROM 
> reasoner_just_supp_triples WHERE triple_id = triple' at line 1

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to