Hi ,

Thanks Morsey..

I have created a Sesame Repository using "openrdf-sesame-2.6.10 "
Find below sample code.

import org.openrdf.model.Value;
import org.openrdf.query.BindingSet;
import org.openrdf.query.QueryLanguage;
import org.openrdf.query.TupleQuery;
import org.openrdf.query.TupleQueryResult;
import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.sail.SailRepository;
import org.openrdf.sail.nativerdf.NativeStore;
import org.openrdf.sail.inferencer.fc.ForwardChainingRDFSInferencer;
import org.openrdf.rio.RDFFormat;
import java.io.File;
public class SesameRepository {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        File dataDir = new
File("/home/gaurav/My_Work/RM_req/19455/SesameAPI/MyRdfFile");
        Repository myRepository = new SailRepository( new
ForwardChainingRDFSInferencer(new NativeStore(dataDir)));
        try{
            myRepository.initialize();
            File file = new
File("/home/gaurav/My_Work/RM_req/19455/Steve-martin.nt");   //taken for
sample
            RepositoryConnection con = myRepository.getConnection();
            String baseURI = "http://example.org/example/local";;
            con.add(file, baseURI, RDFFormat.NTRIPLES);
            String queryString = "SELECT x, y FROM {x} p {y}";
            TupleQuery tupleQuery =
con.prepareTupleQuery(QueryLanguage.SERQL, queryString);
            TupleQueryResult result = tupleQuery.evaluate();
            while (result.hasNext()) {
                   BindingSet bindingSet = result.next();
                   Value valuex = bindingSet.getValue("x");
                   Value valuey = bindingSet.getValue("y");
                   System.out.println(valuex+""+valuey);
                   }
           }
        catch(Exception e)
            {
            System.out.println("Some Exception Occured\n");
            }
    }

}


Now I want to update my repository (insert some more records/Delete some
records) than can anyone please let me know how can i do it with handling
all the possible error/exception situations. I do not require exact code
but the class/method name for the same.

Thanks..!


On Mon, Feb 25, 2013 at 7:01 PM, Mohamed Morsey <
mor...@informatik.uni-leipzig.de> wrote:

> Hi Gaurav,
>
>
> On 02/25/2013 02:11 PM, gaurav pant wrote:
>
>> Hi All,
>>
>> I have local sesame repository. I want to update this database repeatedly
>> by syncing DBpedia provided live dumps.I am trying to write a program using
>> open-sesame Java API.
>>
>> If we check the live dump , suppose for today (http://live.dbpedia.org/**
>> liveupdates/2013/02/25/12/<http://live.dbpedia.org/liveupdates/2013/02/25/12/>)
>> , than we will find that there are multiple added/removed files available
>> for the same timestamps.Like 25-Feb-2013 12:00 timestamps there are around
>> 16 files.So in which sequence I need to import the file so that my local
>> data will not be inconsistence.
>>
>
> Those are not the dump files, you can find the dump files at [1].
> We create those dump files on monthly basis, and the users can use the
> latest one as the starting point of synchronization.
>
> The files under [2] are the changeset files, i.e. the diff files resulting
> from comparing the newly extracted triples with the existing ones.
> Those files are the ones used for synchronization.
> The sync tool [3], we have developed, continuously downloads those
> changeset files and use them to synchronize a DBpedia-Live mirror with the
> official live endpoint.
>
>
>
>> Also for inserting data , if I will directly import this dump to
>> repository than it will create duplicate records rather than updating
>> records.I am under such impression that there is no function available for
>> bulk update/delete using the live update dump.
>>
>> Hence I am thinking to follow below approach.
>>
>> "Process the DBpedia update live dump line by line and insert/delete it
>> into/from database using  INSERT DATA or DELETE DATA queries."
>>
>
> The sync tool mainly works with Virtuoso [4], but since it's open source
> you can easily adapt it to work with Sesame if necessary.
> You can find more information about DBpedia-Live at [5].
>
>
>
>>
>> Please correct me if I am wrong.
>>
>> --
>> Regards
>> Gaurav Pant
>> +91-7709196607,+91-9405757794
>>
>
> [1] http://live.dbpedia.org/dumps/
> [2] http://live.dbpedia.org/**liveupdates<http://live.dbpedia.org/liveupdates>
> [3] 
> http://sourceforge.net/**projects/dbpintegrator/files/<http://sourceforge.net/projects/dbpintegrator/files/>
> [4] http://virtuoso.openlinksw.**com/ <http://virtuoso.openlinksw.com/>
> [5] http://wiki.dbpedia.org/**DBpediaLive<http://wiki.dbpedia.org/DBpediaLive>
>
> --
> Kind Regards
> Mohamed Morsey
> Department of Computer Science
> University of Leipzig
>
>


-- 
Regards
Gaurav Pant
+91-7709196607,+91-9405757794
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Dbpedia-discussion mailing list
Dbpedia-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dbpedia-discussion

Reply via email to