Sesame 3 dan Federation


Sebelumnya saya posting tentang Sesame 2 di Ubuntu, sekarang saya mencoba upgrade ke sesame versi 3, mengingat versi inilah yang mendukung federation query on the fly. Yuk ikuti step-stepnya :

  1. Install tomcat6
    apt-get install tomcat6
  2. Membuat direktori repositori sesame
    mkdir -p /usr/share/tomcat6/.aduna/openrdf-sesame/
    chown -R tomcat6:tomcat6 /usr/share/tomcat6/.aduna
  3. Edit /etc/tomcat6/policy.d/50local.policy
    // =============================================
    // Additional permissions for openrdf-sesame
    grant codeBase "file:${catalina.base}/webapps/openrdf-sesame/-" {
    permission java.util.PropertyPermission "info.aduna.platform.appdata.basedir", "read";
    permission java.util.PropertyPermission "aduna.platform.applicationdata.dir", "read";
    permission java.util.PropertyPermission "user.home", "read";
    //permission java.security.AllPermission;
    permission java.lang.RuntimePermission "createSecurityManager";
    permission java.util.logging.LoggingPermission "control";
    permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/logs", "read";
    permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/logs", "write";
    permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/conf/logback.xml", "read";
    permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/conf/proxy.properties", "read";
    permission java.util.PropertyPermission "*", "read,write";
    permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/conf", "read,write";
    //permission java.io.FilePermission /usr/share/tomcat6/.aduna/openrdf-sesame/*", "read,write";
    permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/conf/proxy.properties.default", "read,write";
    permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/templates", "read";
    permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/configurations", "read,write";
    permission java.io.FilePermission "/usr/share/tomcat6/.aduna/openrdf-sesame/-", "read,write,delete";
    permission java.lang.RuntimePermission "shutdownHooks";
    permission java.lang.RuntimePermission "getProtectionDomain";
    permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
    };
    // ===================================================
  4. Restart tomcat6
    /etc/init.d/tomcat6 restart
  5. Download sesame 3 war disini
  6. Deploy war file tersebut lewat tomcat manager http://localhost:8080/manager/
  7. Download sesame 3 tar.gz atau zip disini dan ekstrak ke direktori misal /home/iin
  8. Jalankan console.sh
    /home/iin/openrdf-sesame-3.0-alpha1/bin/console.sh
    maka akan terjadi seperti ini
    Connected to /tmp/sesame2639
    Commands end with '.' at the end of a line
    Type 'help.' for help
    > connect /usr/share/tomcat6/.aduna/openrdf-sesame/.
    Disconnecting from /tmp/sesame2639
    Connected to /usr/share/tomcat6/.aduna/openrdf-sesame
    > info.
    OpenRDF Sesame console 3.0-alpha1
    Connected to: /usr/share/tomcat6/.aduna/openrdf-sesame
    Data location: file:/usr/share/tomcat6/.aduna/openrdf-sesame/
    > show r.
    --no repositories found--
  9. Membuat template federation query misal bsbm federation yang ada disini. Saya kopi paste disini :
    @prefix rep: .
    @prefix sr: .
    @prefix sail: .
    @prefix hr: .
    @prefix fed: .
    [] a rep:Repository ;
    rep:repositoryTitle "BSBM Federation" ;
    rep:repositoryImpl [
    rep:repositoryType "openrdf:SailRepository" ;
    sr:sailImpl [
    sail:sailType "openrdf:Federation" ;
    fed:member [
    rep:repositoryType "openrdf:HTTPRepository" ;
    hr:serverURL "http://producers:8080" ;
    hr:repositoryID "producers"
    ];
    fed:member [
    rep:repositoryType "openrdf:HTTPRepository" ;
    hr:serverURL "http://vendors:8080" ;
    hr:repositoryID "vendors"
    ];
    fed:member [
    rep:repositoryType "openrdf:HTTPRepository" ;
    hr:serverURL "http://ratings:8080" ;
    hr:repositoryID "ratings"
    ]
    ]
    ].
    simpan file templates tersebut dengan nama bsbm.ttl ke dalam direktori /usr/share/tomcat6/.aduna/openrdf-sesame/templates. Jika direktori templates belum ada, bisa dibuat πŸ™‚ Sekarang kita bisa mulai buat repository federation
    > create bsbm.
    Please specify values for the following variables:
    Repository ID [bsbm]: bsbm
    Title [BSBM Federation]: bsbm
    Server URL [http://producers:8080]: http://api.talis.com/stores/openlibrary/services/sparql
    Remote Repository ID [producers]: openlibrary
    Server URL [http://vendors:8080]: http://dbpedia.org/sparql
    Remote Repository ID [vendors]: dbpedia
    Server URL [http://ratings:8080]: http://sparql.sindice.com/sparql
    Remote Repository ID [ratings]: sindice
    Repository created
    > show r.
    +----------
    |bsbm ("bsbm")
    +----------

Alhamdulillah selesai juga buat Federation ini πŸ˜€

Iklan
    • ai
    • Mei 24th, 2011
  1. mbak sesame apaan sih?kok kaya nama kartun jalan sesame?maklum ya mbak awam di bidang per Linux an.

  1. No trackbacks yet.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s