You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Jayanath Amaranayake <ja...@gmail.com> on 2012/08/14 21:39:05 UTC

SDB version to use with Jena 2.7.2

Hi all,
I'm trying to store my RDF models in an Oracle DB. I know that I have to
use SDB with Jena. However the latest Jena download bundle does not have
SDB at the moment. Has anyone used Jena 2.7.2 with SDB 1.3.4. It seems like
the SDB 1.3.4 had been released with the older Jena 2.6.4.

Thanks in advance for any help.

Jay

Re: SDB version to use with Jena 2.7.2

Posted by Damian Steer <d....@bristol.ac.uk>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 17/08/12 18:47, Jayanath Amaranayake wrote:
> Damian,
> 
> It worked!! Thank you for all the help.

No problem. Thank the internet for explaining the intricacies /
eccentricities of Oracle :-)

> BTW, is there a plan to include SDB into the Jena download bundle
> in the near future?

I think a plan is emerging. We will need users to check the release
candidates for us, so feedback like yours is essential.

Damain

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAyPnYACgkQAyLCB+mTtymTJgCgz8eySzneeHzFglrIh8yL9Xf/
PUQAoOyvb3PgD8qPQ31vlogro+GlhYQ9
=CiLx
-----END PGP SIGNATURE-----

Re: SDB version to use with Jena 2.7.2

Posted by Jayanath Amaranayake <ja...@blueslate.net>.
Damian,

It worked!! Thank you for all the help.

BTW, is there a plan to include SDB into the Jena download bundle in the
near future?

Jay

On Thu, Aug 16, 2012 at 6:52 PM, Damian Steer <d....@bristol.ac.uk> wrote:

>
> On 16 Aug 2012, at 22:43, Damian Steer wrote:
>
> > I've just committed a change which wraps the insert in a BEGIN ... END
> which seems to parse, but I don't know whether it works. The snapshot will
> be updated at some point soon, iirc, so try again then.
>
> Try again. Managed to hit backspace in editor before committing.
>
> Damian




-- 
Thank you,
Jayanath

Re: SDB version to use with Jena 2.7.2

Posted by Damian Steer <d....@bristol.ac.uk>.
On 16 Aug 2012, at 22:43, Damian Steer wrote:

> I've just committed a change which wraps the insert in a BEGIN ... END which seems to parse, but I don't know whether it works. The snapshot will be updated at some point soon, iirc, so try again then.

Try again. Managed to hit backspace in editor before committing.

Damian

Re: SDB version to use with Jena 2.7.2

Posted by Damian Steer <d....@bristol.ac.uk>.
On 16 Aug 2012, at 15:30, Jayanath Amaranayake wrote:

> Damian,
> Attached is the sample ontology file that I used. I changed the extension from "turtle" to txt. It seems like the mailing list does not like attachments with "turtle" extension.
> Hope it helps you to recreate this issue.

Thanks for the file, although it was pretty trivial to reproduce directly in the end (e.g. "select 1 from X; select 1 from X" will do it via code).

I've just committed a change which wraps the insert in a BEGIN ... END which seems to parse, but I don't know whether it works. The snapshot will be updated at some point soon, iirc, so try again then.

[In the mean time I might ask for a database of my own at work to try SDB on]

Damian

Re: SDB version to use with Jena 2.7.2

Posted by Jayanath Amaranayake <ja...@blueslate.net>.
Damian,
Attached is the sample ontology file that I used. I changed the extension
from "turtle" to txt. It seems like the mailing list does not like
attachments with "turtle" extension.
Hope it helps you to recreate this issue.

Thanks!
Jay

On Thu, Aug 16, 2012 at 10:16 AM, Damian Steer <d....@bristol.ac.uk>wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 16/08/12 14:39, Jayanath Amaranayake wrote:
> > Thanks Damian. I tried both statements, with space around the
> > semicolon and without. Both works fine in Oracle SQL Developer
> > 3.1.07. My oracle version is : Oracle Database 11g Express Edition
> > Release 11.2.0.2.0 - Production
>
> Curses. But you're on the same version as I am at work, so I ought to
> be able to reproduce it.
>
> Will investigate...
>
> Damian
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAlAtALAACgkQAyLCB+mTtymaoACfZknrKvCikpnSP7ZgJPlV4fdQ
> e9gAn11VCHWne1HZsWt1AnqDskU5mBYn
> =kUFC
> -----END PGP SIGNATURE-----
>



-- 
Thank you,
Jayanath

Re: SDB version to use with Jena 2.7.2

Posted by Damian Steer <d....@bristol.ac.uk>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 16/08/12 14:39, Jayanath Amaranayake wrote:
> Thanks Damian. I tried both statements, with space around the
> semicolon and without. Both works fine in Oracle SQL Developer
> 3.1.07. My oracle version is : Oracle Database 11g Express Edition
> Release 11.2.0.2.0 - Production

Curses. But you're on the same version as I am at work, so I ought to
be able to reproduce it.

Will investigate...

Damian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAtALAACgkQAyLCB+mTtymaoACfZknrKvCikpnSP7ZgJPlV4fdQ
e9gAn11VCHWne1HZsWt1AnqDskU5mBYn
=kUFC
-----END PGP SIGNATURE-----

Re: SDB version to use with Jena 2.7.2

Posted by Jayanath Amaranayake <ja...@blueslate.net>.
Thanks Damian.
I tried both statements, with space around the semicolon and without. Both
works fine in Oracle SQL Developer 3.1.07.
My oracle version is : Oracle Database 11g Express Edition Release
11.2.0.2.0 - Production

Jay

On Thu, Aug 16, 2012 at 5:31 AM, Damian Steer <d....@bristol.ac.uk> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 15/08/12 21:52, Jayanath Amaranayake wrote:
> > Thanks Andy. I tried to use the snap shot but getting the following
> > error with Oracle XE 11g. The same code works just fine with MySQL.
> >
> So you're getting:
>
> 11:44:17.154 [Thread-1] WARN  c.hp.hpl.jena.sdb.sql.SDBConnection -
> execUpdate: SQLException
> ORA-00911: invalid character
>
> LOCK TABLE Nodes IN EXCLUSIVE MODE; INSERT INTO Nodes (hash, lex,
> lang, datatype, type)
> SELECT NNodeTriples.n0 , NNodeTriples.n1 , NNodeTriples.n2 ,
> NNodeTriples.n3 , NNodeTriples.n4
> FROM NNodeTriples LEFT JOIN Nodes ON (NNodeTriples.n0=Nodes.hash)
> WHERE Nodes.hash IS NULL
>
> Looking at the explanation of ORA-00911 this isn't obvious at all, but
> I reckon it's the semicolon.
>
> Could you try executing the original then the following statement in
> toad or sqldeveloper?
>
> LOCK TABLE Nodes IN EXCLUSIVE MODE ; INSERT INTO Nodes (hash, lex,
> lang, datatype, type)
> SELECT NNodeTriples.n0 , NNodeTriples.n1 , NNodeTriples.n2 ,
> NNodeTriples.n3 , NNodeTriples.n4
> FROM NNodeTriples LEFT JOIN Nodes ON (NNodeTriples.n0=Nodes.hash)
> WHERE Nodes.hash IS NULL
>
> (Just adding a space between 'MODE' and ';')
>
> The original parses fine on my work database, but that may be a
> version issue. We're on 11g.
>
> select * from v$version where banner like 'Oracle%';
>
> If both are fine then we'll have to find another way to reproduce the
> issue.
>
> Damian
>
>
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.11 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAlAsvgoACgkQAyLCB+mTtymaHQCfQvUlDLc8GrXXs5fU0eq4hNvW
> +PsAoKgkSj2ri3nr1WV1YTmoU34R0+Lp
> =TUIN
> -----END PGP SIGNATURE-----
>



-- 
Thank you,
Jayanath

Re: SDB version to use with Jena 2.7.2

Posted by Damian Steer <d....@bristol.ac.uk>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 15/08/12 21:52, Jayanath Amaranayake wrote:
> Thanks Andy. I tried to use the snap shot but getting the following
> error with Oracle XE 11g. The same code works just fine with MySQL.
> 
So you're getting:

11:44:17.154 [Thread-1] WARN  c.hp.hpl.jena.sdb.sql.SDBConnection -
execUpdate: SQLException
ORA-00911: invalid character

LOCK TABLE Nodes IN EXCLUSIVE MODE; INSERT INTO Nodes (hash, lex,
lang, datatype, type)
SELECT NNodeTriples.n0 , NNodeTriples.n1 , NNodeTriples.n2 ,
NNodeTriples.n3 , NNodeTriples.n4
FROM NNodeTriples LEFT JOIN Nodes ON (NNodeTriples.n0=Nodes.hash)
WHERE Nodes.hash IS NULL

Looking at the explanation of ORA-00911 this isn't obvious at all, but
I reckon it's the semicolon.

Could you try executing the original then the following statement in
toad or sqldeveloper?

LOCK TABLE Nodes IN EXCLUSIVE MODE ; INSERT INTO Nodes (hash, lex,
lang, datatype, type)
SELECT NNodeTriples.n0 , NNodeTriples.n1 , NNodeTriples.n2 ,
NNodeTriples.n3 , NNodeTriples.n4
FROM NNodeTriples LEFT JOIN Nodes ON (NNodeTriples.n0=Nodes.hash)
WHERE Nodes.hash IS NULL

(Just adding a space between 'MODE' and ';')

The original parses fine on my work database, but that may be a
version issue. We're on 11g.

select * from v$version where banner like 'Oracle%';

If both are fine then we'll have to find another way to reproduce the
issue.

Damian



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlAsvgoACgkQAyLCB+mTtymaHQCfQvUlDLc8GrXXs5fU0eq4hNvW
+PsAoKgkSj2ri3nr1WV1YTmoU34R0+Lp
=TUIN
-----END PGP SIGNATURE-----

Re: SDB version to use with Jena 2.7.2

Posted by Jayanath Amaranayake <ja...@gmail.com>.
Thanks Andy.
I tried to use the snap shot but getting the following error with Oracle XE
11g.
The same code works just fine with MySQL.

My code:

Store store = StoreFactory.create("sdb-oracle.ttl");
store.getTableFormatter().create();
Model model = SDBFactory.connectDefaultModel(store);
InputStream is =
FileManager.get().open("ontologies/SampleOntology.turtle");

*model.read(is,null,"TURTLE"); // this is where it fails*

String queryString = "SELECT * { ?s ?p ?o }" ;
Query query = QueryFactory.create(queryString) ;
Dataset ds = DatasetStore.create(store) ;
QueryExecution qe = QueryExecutionFactory.create(query, ds) ;
    try { ResultSet rs = qe.execSelect() ;
    ResultSetFormatter.out(rs) ;
    } finally {
        qe.close() ;
    }
store.getConnection().close() ;
store.close() ;

The error:

java.sql.SQLSyntaxErrorException: ORA-00911: invalid character


I attached the stack trace and the sample ontology file that I use, hoping
that it could be helpful.
Is there any database specific configuration that I missed?. Any thoughts?

Thanks in advance for any help on this.

Jay


On Tue, Aug 14, 2012 at 5:36 PM, Andy Seaborne <an...@apache.org> wrote:

> On 14/08/12 20:39, Jayanath Amaranayake wrote:
>
>> Hi all,
>> I'm trying to store my RDF models in an Oracle DB. I know that I have to
>> use SDB with Jena. However the latest Jena download bundle does not have
>> SDB at the moment. Has anyone used Jena 2.7.2 with SDB 1.3.4. It seems
>> like
>> the SDB 1.3.4 had been released with the older Jena 2.6.4.
>>
>> Thanks in advance for any help.
>>
>> Jay
>>
>
> It may work but there was quite a gap between jena versions 2.6.4 and
> 2.7.2.  I'd be interesting in hearing if it works.
>
> I have just updated SDB and there is a development build with current
> dependencies:
>
> http://s.apache.org/jena-sdb-**1.3.5-SNAPSHOT<http://s.apache.org/jena-sdb-1.3.5-SNAPSHOT>
>
> Dependencies:
>
> jena-sdb     1.3.5-SNAPSHOT
> jena-parent: 3
> jena-core:   2.7.3
> jena-arq:    2.9.3
>
>         Andy
>
>

Re: SDB version to use with Jena 2.7.2

Posted by Andy Seaborne <an...@apache.org>.
On 14/08/12 20:39, Jayanath Amaranayake wrote:
> Hi all,
> I'm trying to store my RDF models in an Oracle DB. I know that I have to
> use SDB with Jena. However the latest Jena download bundle does not have
> SDB at the moment. Has anyone used Jena 2.7.2 with SDB 1.3.4. It seems like
> the SDB 1.3.4 had been released with the older Jena 2.6.4.
>
> Thanks in advance for any help.
>
> Jay

It may work but there was quite a gap between jena versions 2.6.4 and 
2.7.2.  I'd be interesting in hearing if it works.

I have just updated SDB and there is a development build with current 
dependencies:

http://s.apache.org/jena-sdb-1.3.5-SNAPSHOT

Dependencies:

jena-sdb     1.3.5-SNAPSHOT
jena-parent: 3
jena-core:   2.7.3
jena-arq:    2.9.3

	Andy