Hi Andy,

I was able to work it out. From the documentation I was able to understand
which tables to include but the complete schema definition was not clear.

I had to create a utility (not a very bright one) to create the schema on
oracle:

import java.sql.*;
import org.apache.jena.sdb.sql.*;
import org.apache.jena.sdb.layout2.hash.*;

public class OracleSchemaCreator {

  public static void main(String... args) throws Exception {
 Class.forName("oracle.jdbc.driver.OracleDriver");
 Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost
:1521:XE","dbuser","dbpassword");

       SDBConnection sdbConn = new SDBConnection(conn);
 FmtLayout2HashOracle oracleLayout = new FmtLayout2HashOracle(sdbConn);

 oracleLayout.create();

  }
}

Couple of things on which I request your help:

1) I intend to deploy Fuseki as war. How do I include the config file which
is supplied as command line argument?
2) Is there a way to supply a (pooled) datasource as a JNDI name instead of
just the connection parameters?

Thanks,
Akhilesh

On Thu, Jan 14, 2016 at 9:41 PM, Andy Seaborne <[email protected]> wrote:

> On 14/01/16 09:46, Bangalore Akhilesh wrote:
>
>> Hi,
>>
>> I would like to know the steps involved in setting up Fuseki to work with
>> SDB against Oracle database. Can one of you please help?
>>
>> Also, does Fuseki2 work as expected with SDB?
>>
>> Thanks,
>> Akhilesh
>>
>>
> Hi Akhilesh,
>
> It works (I just checked) though it is a bit tricky.  It is easily
> influenced by the external environment.
>
> 1/ Get the jars onto the Fuseki class path - it's easier to take the
> script or however you are running it and change it to put the jars and the
> fuseki server jar, use -cp and then main entry point:
>
> org.apache.jena.fuseki.cmd.FusekiCmd
>
> The "fuseki-dev" script in
>
> https://github.com/apache/jena/tree/master/jena-fuseki2/jena-fuseki-core
>
> may help. It does not use a standalone jar.
>
> (Or download source and modify the POM and rebuild - once you have that
> working you can have a completely self contained jar for the server.
> Convenient, but it takes more to set up.)
>
> 2/
> If you have a store description for an SDB store,
>
> http://jena.apache.org/documentation/sdb/
> http://jena.apache.org/documentation/sdb/fuseki_integration.html
>
> You need a fuseki configuration file including stuff in the server file
> (config.ttl). I didn't test in different "configuration/" files.
>
> ---- config.ttl
> @prefix :        <#> .
> @prefix fuseki:  <http://jena.apache.org/fuseki#> .
> @prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
>
> @prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
> @prefix sdb:     <http://jena.hpl.hp.com/2007/sdb#> .
> @prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
>
> [] rdf:type fuseki:Server ;
>     ## Initialize SDB.
>     ja:loadClass "org.apache.jena.sdb.SDB" ;
>     fuseki:services (
>       <#service1>
>     ) .
>
> # Probably unnecessary nowadays in a Fuseki description.
> # sdb:DatasetStore rdfs:subClassOf ja:RDFDataset .
>
> <#service1> rdf:type fuseki:Service ;
>     # URI of the dataset -- http://host:port/ds
>     fuseki:name                        "ds" ;
>     fuseki:serviceQuery                "sparql" ;
>     fuseki:serviceQuery                "query" ;
>     fuseki:serviceUpdate               "update" ;
>     fuseki:serviceUpload               "upload" ;
>     fuseki:serviceReadWriteGraphStore  "data" ;
>     fuseki:serviceReadGraphStore       "get" ;
>     fuseki:dataset                     <#dataset> ;
>     .
>
>     <#dataset> rdf:type sdb:DatasetStore ;
>         sdb:store <#store> .
>
>     <#store> rdf:type sdb:Store ;
>         sdb:layout     "layout2" ;
>         sdb:connection <#conn> ;
>         .
>
>     <#conn> rdf:type sdb:SDBConnection ;
>         ... your setup ...
> -----
> ja:loadClass will become unnecessary in 3.1.0
>
>
> An example (and not tested recently) Oracle setup for a Store:
>
> https://github.com/apache/jena/blob/master/jena-sdb/Store/sdb-oracle.ttl
>
>
> If you get it to work, I'll revise the documentation some more.
>
>         Andy
>
>

Reply via email to