[redland-dev] How to remove literals?

Jan Algermissen jalgermissen at topicmapping.com
Thu Apr 21 22:37:32 BST 2005


Hi,

I am using Redland (with MySQL storage) as a primary data store (meaning 
not only for
temporary storage of RDF graphs after parsing).

I just found out that literals seem to be kept in the database forever, 
which is sort of
a problem, because all updates to statements with literal objects will  
lead to  an unused
literal, which is the old value.

Example:

Given ex:foo ex:age "15" and an update to  ex:foo ex:age "17" (by 
removing the  previous statement)
will leave the literal "15"  as  'trash' in the database.

Is there any way I can remove the literals that are not objects of any 
statements?

Would it be ok (as a hack) to scan the database directly once in a while 
and just do an SQL delete on the Literals that are not referenced from 
the Object col of the statements table?


Thanks for clarification.

Jan

-- 
Jan Algermissen
Consultant & Programmer
http://jalgermissen.com




More information about the redland-dev mailing list