How to delete all objects associated with the particular URI>

0 views
Skip to first unread message

zania...@gmail.com

unread,
Jun 11, 2013, 1:39:06 AM6/11/13
to sta...@clarkparsia.com
Hello Guys,

I need few clarifications on, how to delete/remove all objects associated with a particular URI?  
Below is my sample data

<#Project-b74ea22a-94bc-467f-a1f4-e6e5c6c54e05>
    a sx:Project  ;
    prj:name "CType" ;
    prj: UID 12.

<#Task-0-b74ea22a-94bc-467f-a1f4-e6e5c6c54e05>
    a sx:Task ;
    sx:partOfProject <#Project-b74ea22a-94bc-467f-a1f4-e6e5c6c54e05> ;
    tsk:uID 0 ;
    tsk: desc "task 1" .

<#Resource-0-b74ea22a-94bc-467f-a1f4-e6e5c6c54e05>
    a sx: Resource ;
    sx:partOfProject <#Project-b74ea22a-94bc-467f-a1f4-e6e5c6c54e05> ;


Here project has two objects associated with TASK and RESOURCE. Like wise, we have 10+ objects are attached to each Project.

Please suggest any suitable approach to delete these using SNARL Java API.

Intention here is to update the data for same project id. So we are trying to delete all the triples and trying to insert again.


Cheers!!
Zenny


Mike Grove

unread,
Jun 11, 2013, 6:31:02 AM6/11/13
to stardog
Probably the easiest thing is given a connection to just use the remover:

URI aURIToRemove = ...
Connection aConn = ...
aConn.begin();
aConn.remove().statements(aURIToRemove, null, null);
aConn.remove().statements(null, null, aURIToRemove);
aConn.commit();

That'll remove all the statements where the individual you wish to delete appears in either the subject or object position.

Cheers,

Mike




--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
 
 

Reply all
Reply to author
Forward
0 new messages