You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Bangalore Akhilesh <ba...@gmail.com> on 2016/01/14 10:46:33 UTC
Fuseki + SDB + Oracle
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
Re: Fuseki + SDB + Oracle
Posted by Bangalore Akhilesh <ba...@gmail.com>.
Hi Haavard,
Yes. I am aware of the Spatial & Graph support from Oracle. I have it
working as well. But it does not support the full sparql specification and
needs to be deployed against a Fuseki adapter (a modified component from
Oracle) to make up for the shortcomings.
Thanks,
Akhilesh
On Thu, Jan 14, 2016 at 5:30 PM, Håvard Mikkelsen Ottestad <
haavard.ottestad@acando.no> wrote:
> If you have Oracle, you can also use their Spatial and Graph support as a
> graph database with Jena (without SDB).
>
> As for the steps for setting up regular Oracle with Jena SDB, I don’t know.
>
> Håvard
>
>
>
>
> On 14/01/16 10:46, "Bangalore Akhilesh" <ba...@gmail.com>
> 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
>
Re: Fuseki + SDB + Oracle
Posted by Håvard Mikkelsen Ottestad <ha...@acando.no>.
If you have Oracle, you can also use their Spatial and Graph support as a graph database with Jena (without SDB).
As for the steps for setting up regular Oracle with Jena SDB, I don’t know.
Håvard
On 14/01/16 10:46, "Bangalore Akhilesh" <ba...@gmail.com> 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
Re: Fuseki + SDB + Oracle
Posted by "A. Soroka" <aj...@virginia.edu>.
On Jan 15, 2016, at 8:35 AM, Bangalore Akhilesh <ba...@gmail.com> wrote:
>
> I do not know what is VIVO? Can you please point me in the right direction?
I believe Andy may have been thinking of:
http://vivoweb.org/
which by default uses SDB:
https://wiki.duraspace.org/display/VIVODOC18x/Using+a+different+data+store
---
A. Soroka
The University of Virginia Library
Re: Fuseki + SDB + Oracle
Posted by Bangalore Akhilesh <ba...@gmail.com>.
Hi Andy,
Also, I intend to setup a load balancer on multiple instances of Fuseki2
> deployed on same server.
>
I don't follow - why LB multiple instances on the same machine? What can't
Tomcat do? (Fuseki internally can handle multiple requests simultaneously)
My apologies. I wasn't clear enough.
This is to ensure high availability. In a PROD environment they are likely
to be on different machines but in our lower environments this may have to
be implemented on the same machine. I can see what you mean. Deploying
multiple instances on Tomcat might suffice.
Thanks,
Akhilesh
On Sat, Jan 16, 2016 at 2:24 AM, Andy Seaborne <an...@apache.org> wrote:
> On 15/01/16 13:35, Bangalore Akhilesh wrote:
>
>> Hi Andy,
>>
>> Thanks for your response.
>>
>> 1) I intend to deploy Fuseki as war. How do I include the config file
>> which
>>
>>> is supplied as command line argument?
>>>
>>>
>> Run Fuseki2 once, and it will create it's necessary files : /etc/fuseki
>>
>> There should be a config.ttl there.
>>
>> I am currently running Fuseki2 on a windows machine. Any idea where the
>> files get created?
>>
>
> Safest to search the machine filesystem for a file called "config.ttl".
>
> Also, I intend to setup a load balancer on multiple instances of Fuseki2
>> deployed on same server.
>>
>
> I don't follow - why LB multiple instances on the same machine? What
> can't Tomcat do? (Fuseki internally can handle multiple requests
> simultaneously)
>
> In which case, where will the files be created?
>> Can both the instances access the same config file?
>>
>
> Probably - they both end up with JDBC connections to the same SQL instance
> so I'm that clear what is gained here.
>
> If it is performance, TDB is faster and scales better than SDB.
>
> TDB is the database engine - to share a TDB database use Fuseki to handle
> multiple clients.
>
> Andy
>
>
>
>> 2) Is there a way to supply a (pooled) datasource as a JNDI name instead
>> of
>>
>>> just the connection parameters?
>>>
>>>
>> Personally, I don't know. I haven't run it that way; I used the
>> jetty-based server version. Maybe someone else here can give you the
>> recipe. Maybe someone connected with VIVO?
>>
>> I do not know what is VIVO? Can you please point me in the right
>> direction?
>>
>> Cheers,
>> Akhilesh
>>
>> On Fri, Jan 15, 2016 at 4:10 PM, Andy Seaborne <an...@apache.org> wrote:
>>
>> On 15/01/16 04:00, Bangalore Akhilesh wrote:
>>>
>>> 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();
>>>>
>>>> }
>>>> }
>>>>
>>>>
>>> The tools do this.
>>>
>>> if no where else, scripts are in:
>>>
>>> https://github.com/apache/jena/tree/master/jena-sdb/bin
>>>
>>> or call "sdb.sdbconfig.main" from Java.
>>>
>>>
>>> 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?
>>>>
>>>>
>>> Run Fuseki2 once, and it will create it's necessary files : /etc/fuseki
>>>
>>> There should be a config.ttl there.
>>>
>>>
>>> 2) Is there a way to supply a (pooled) datasource as a JNDI name instead
>>> of
>>>
>>>> just the connection parameters?
>>>>
>>>>
>>> Personally, I don't know. I haven't run it that way; I used the
>>> jetty-based server version. Maybe someone else here can give you the
>>> recipe. Maybe someone connected with VIVO?
>>>
>>> Andy
>>>
>>>
>>> Thanks,
>>>
>>>> Akhilesh
>>>>
>>>> On Thu, Jan 14, 2016 at 9:41 PM, Andy Seaborne <an...@apache.org> 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
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
Re: Fuseki + SDB + Oracle
Posted by Andy Seaborne <an...@apache.org>.
On 15/01/16 13:35, Bangalore Akhilesh wrote:
> Hi Andy,
>
> Thanks for your response.
>
> 1) I intend to deploy Fuseki as war. How do I include the config file which
>> is supplied as command line argument?
>>
>
> Run Fuseki2 once, and it will create it's necessary files : /etc/fuseki
>
> There should be a config.ttl there.
>
> I am currently running Fuseki2 on a windows machine. Any idea where the
> files get created?
Safest to search the machine filesystem for a file called "config.ttl".
> Also, I intend to setup a load balancer on multiple instances of Fuseki2
> deployed on same server.
I don't follow - why LB multiple instances on the same machine? What
can't Tomcat do? (Fuseki internally can handle multiple requests
simultaneously)
> In which case, where will the files be created?
> Can both the instances access the same config file?
Probably - they both end up with JDBC connections to the same SQL
instance so I'm that clear what is gained here.
If it is performance, TDB is faster and scales better than SDB.
TDB is the database engine - to share a TDB database use Fuseki to
handle multiple clients.
Andy
>
> 2) Is there a way to supply a (pooled) datasource as a JNDI name instead of
>> just the connection parameters?
>>
>
> Personally, I don't know. I haven't run it that way; I used the
> jetty-based server version. Maybe someone else here can give you the
> recipe. Maybe someone connected with VIVO?
>
> I do not know what is VIVO? Can you please point me in the right direction?
>
> Cheers,
> Akhilesh
>
> On Fri, Jan 15, 2016 at 4:10 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> On 15/01/16 04:00, Bangalore Akhilesh wrote:
>>
>>> 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();
>>>
>>> }
>>> }
>>>
>>
>> The tools do this.
>>
>> if no where else, scripts are in:
>>
>> https://github.com/apache/jena/tree/master/jena-sdb/bin
>>
>> or call "sdb.sdbconfig.main" from Java.
>>
>>
>> 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?
>>>
>>
>> Run Fuseki2 once, and it will create it's necessary files : /etc/fuseki
>>
>> There should be a config.ttl there.
>>
>>
>> 2) Is there a way to supply a (pooled) datasource as a JNDI name instead of
>>> just the connection parameters?
>>>
>>
>> Personally, I don't know. I haven't run it that way; I used the
>> jetty-based server version. Maybe someone else here can give you the
>> recipe. Maybe someone connected with VIVO?
>>
>> Andy
>>
>>
>> Thanks,
>>> Akhilesh
>>>
>>> On Thu, Jan 14, 2016 at 9:41 PM, Andy Seaborne <an...@apache.org> 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
>>>>
>>>>
>>>>
>>>
>>
>
Re: Fuseki + SDB + Oracle
Posted by Bangalore Akhilesh <ba...@gmail.com>.
Hi Andy,
Thanks for your response.
1) I intend to deploy Fuseki as war. How do I include the config file which
> is supplied as command line argument?
>
Run Fuseki2 once, and it will create it's necessary files : /etc/fuseki
There should be a config.ttl there.
I am currently running Fuseki2 on a windows machine. Any idea where the
files get created?
Also, I intend to setup a load balancer on multiple instances of Fuseki2
deployed on same server. In which case, where will the files be created?
Can both the instances access the same config file?
2) Is there a way to supply a (pooled) datasource as a JNDI name instead of
> just the connection parameters?
>
Personally, I don't know. I haven't run it that way; I used the
jetty-based server version. Maybe someone else here can give you the
recipe. Maybe someone connected with VIVO?
I do not know what is VIVO? Can you please point me in the right direction?
Cheers,
Akhilesh
On Fri, Jan 15, 2016 at 4:10 PM, Andy Seaborne <an...@apache.org> wrote:
> On 15/01/16 04:00, Bangalore Akhilesh wrote:
>
>> 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();
>>
>> }
>> }
>>
>
> The tools do this.
>
> if no where else, scripts are in:
>
> https://github.com/apache/jena/tree/master/jena-sdb/bin
>
> or call "sdb.sdbconfig.main" from Java.
>
>
> 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?
>>
>
> Run Fuseki2 once, and it will create it's necessary files : /etc/fuseki
>
> There should be a config.ttl there.
>
>
> 2) Is there a way to supply a (pooled) datasource as a JNDI name instead of
>> just the connection parameters?
>>
>
> Personally, I don't know. I haven't run it that way; I used the
> jetty-based server version. Maybe someone else here can give you the
> recipe. Maybe someone connected with VIVO?
>
> Andy
>
>
> Thanks,
>> Akhilesh
>>
>> On Thu, Jan 14, 2016 at 9:41 PM, Andy Seaborne <an...@apache.org> 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
>>>
>>>
>>>
>>
>
Re: Fuseki + SDB + Oracle
Posted by Andy Seaborne <an...@apache.org>.
On 15/01/16 04:00, Bangalore Akhilesh wrote:
> 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();
>
> }
> }
The tools do this.
if no where else, scripts are in:
https://github.com/apache/jena/tree/master/jena-sdb/bin
or call "sdb.sdbconfig.main" from Java.
> 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?
Run Fuseki2 once, and it will create it's necessary files : /etc/fuseki
There should be a config.ttl there.
> 2) Is there a way to supply a (pooled) datasource as a JNDI name instead of
> just the connection parameters?
Personally, I don't know. I haven't run it that way; I used the
jetty-based server version. Maybe someone else here can give you the
recipe. Maybe someone connected with VIVO?
Andy
> Thanks,
> Akhilesh
>
> On Thu, Jan 14, 2016 at 9:41 PM, Andy Seaborne <an...@apache.org> 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
>>
>>
>
Re: Fuseki + SDB + Oracle
Posted by Bangalore Akhilesh <ba...@gmail.com>.
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 <an...@apache.org> 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
>
>
Re: Fuseki + SDB + Oracle
Posted by Andy Seaborne <an...@apache.org>.
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