store rdf triples in db2

20 views
Skip to first unread message

leonhard...@googlemail.com

unread,
Mar 10, 2009, 4:56:12 AM3/10/09
to OpenAnzo
Hello Everybody!

I want to find out, how openanzo stores rdf triples in my local db2
database. Can anybody shortly explain?

I do the tutorial on http://www.openanzo.org/projects/openanzo/wiki/CommandLineInterface
and convert from arthur.trig to arthur.rf for example. I also use the
create statement like "create - adds named graphs to the repository"
and all the other statements, but i cant find the rdf triples in my
local database. The database config is well done...

What does "repository" in this context mean?

Best Regards

Leo

Jordi Albornoz Mulligan

unread,
Mar 10, 2009, 11:36:55 AM3/10/09
to open...@googlegroups.com

Hello Leo,

I'm glad to hear you've got the command line interface working.
Repository in the context you mention does mean that the statements are
written to the database. "anzo create" adds graphs will add the graph to
the database and "anzo get" is one way to retrieve a graph from the
database. So you should see information added to the database after an
"anzo create".

Just as a sanity check. Try doing an "anzo get" to retrieve the graph
you added just to make sure it's in the repository.

You can look in the database tables but you won't see the statements in
a format that's easy to read by eye. RDF statements are stored in the
STATEMENTS table. But notice that the table uses integers for the
subject, predicate, object, and namedgraphid columns. Those are
references to rows in other tables such as the ANZO_U table. It's a
mechanism for improved efficiency in storage and query.
You can read more about the basics of the Anzo database schema design at:
http://www.openanzo.org/projects/openanzo/wiki/DBLayout

I hope that helps.

--
Jordi Albornoz Mulligan
Founding Engineer - Cambridge Semantics
jo...@cambridgesemantics.com
(617) 401-7321

leonhard...@googlemail.com

unread,
Mar 10, 2009, 11:55:22 AM3/10/09
to OpenAnzo
Hello Jordi,

thanks for your answer. i test something:

I edited the
"org.openanzo.datasource.nodecentric.defaultDatasource.properties" db2
config so that the config is wrong. I restart openanzo and do some
create etc. statements.

But it also works with wrong db2 config. How can that be? I thought it
uses my db2 database?

Best Regards

Leo

Matthew Roy

unread,
Mar 10, 2009, 12:07:15 PM3/10/09
to open...@googlegroups.com
This part of the wiki should explain what you're asking:
http://www.openanzo.org/projects/openanzo/wiki/OpenAnzoInstallation31#Configuration

On Tue, 2009-03-10 at 08:55 -0700, leonhard...@googlemail.com
wrote:

leonhard...@googlemail.com

unread,
Mar 10, 2009, 12:31:05 PM3/10/09
to OpenAnzo
Sorry for aksing again:

I do a lot of create and other statements with my trig and rdf files.
It works fine. But i found no tables in my anzo db2 database(no
STATEMENTS table). I use the dbvisualizer to connect to my db2
database.

I follow your link Ben. But i think there is no answer for my question
concerning the Topic:

" I edit the
"org.openanzo.datasource.nodecentric.defaultDatasource.properties" db2
config so that the config is wrong. I restart openanzo and do some
create etc. statements.
But it also works with wrong db2 config. How can that be? I thought it
uses my db2 database? "

May be you have antoher tip for me :-)

Best Regards
Leo

Ben Szekely

unread,
Mar 10, 2009, 12:35:46 PM3/10/09
to open...@googlegroups.com
Hi Leo,
Thanks for your patience, I'm confident we can solve this. The
problem is that your config file isn't being read at all which explains
why you can enter the wrong config and it still works. It also explains
why you are able to create graphs and statements but not see any
statements in the tables. If your DB2 config isn't being read, then it
will use the default in-memory H2 database. The link Matt sent in the
previous email explains how to make sure the db2 configuration is used.
We can work with you try to get DB2 config working, but in the meantime,
you can experiment with the default setup.

- Ben

leonhard...@googlemail.com

unread,
Mar 10, 2009, 12:47:59 PM3/10/09
to OpenAnzo
Hi Ben,

thanks for your answer.
I follow the instructions from the db2 configuration tutorial.I only
get execptions when i run the makeDb2Bundle.bat. But i explained that
2 weeks ago in another post and you said that doesnt matter. I dont
know what to do. The rest of the db2 configuration tutorial works
fine.


Best Regards

Leo

Ben Szekely

unread,
Mar 10, 2009, 12:51:28 PM3/10/09
to open...@googlegroups.com
Did you follow this step:

If you want to flush the old configuration completely, you need to
delete the

openanzo-3.1.0-SNAPSHOT\configuration\org.eclipse.* directories

- Ben

leonhard...@googlemail.com

unread,
Mar 11, 2009, 3:44:49 AM3/11/09
to OpenAnzo
Hello Ben,

thanks for answer. I try some things, and now my db2 databse have the
anzo tables. Fine!

But now, i get the following Class not Found Exception when i start
the startAnzo.Bat:

C:\openanzo-3.1.0-SNAPSHOT>startAnzo.bat

osgi> 2009-03-11 08:22:56,203 0 [ERROR]
[ManagedServiceFactory Update Q
ueue] [OpName=] [OpId=] [OpUser=] [RunAs=] [UserDesc=]
org.openanzo.datasource.n
odecentric.internal.NodeCentricDatasourceFactory - Exception follows:
org.openanzo.exceptions.AnzoException: ErrorCode[576:262146]
[DATASOURCE_ERROR]
[INTERNAL_ERROR] There was an error loading the database driver
class:com.ibm.db
2.jcc.DB2Driver. Root Cause: java.lang.ClassNotFoundException
com.ibm.db2.jcc.DB
2Driver
at
org.openanzo.datasource.nodecentric.internal.NodeCentricDatasource.in
itializeConnectionFactory(NodeCentricDatasource.java:572)
at
org.openanzo.datasource.nodecentric.internal.NodeCentricDatasource.<i
nit>(NodeCentricDatasource.java:262)
at
org.openanzo.datasource.nodecentric.internal.NodeCentricDatasourceFac
tory.updated(NodeCentricDatasourceFactory.java:233)
at org.eclipse.equinox.internal.cm.ManagedServiceFactoryTracker
$2.run(Ma
nagedServiceFactoryTracker.java:177)
at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run
(SerializedT
askQueue.java:36)
Caused by: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClassIntern
al(BundleLoader.java:481)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(Bundl
eLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(Bundl
eLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(De
faultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
org.openanzo.datasource.nodecentric.internal.NodeCentricDatasource.in
itializeConnectionFactory(NodeCentricDatasource.java:570)
... 4 more
2009-03-11 08:22:56,203 0 [ERROR] [ManagedServiceFactory
Update Queue]
[OpName=] [OpId=] [OpUser=] [RunAs=] [UserDesc=]
org.eclipse.equinox.cm - Error
Code[576:262146] [DATASOURCE_ERROR] [INTERNAL_ERROR] There was an
error loading
the database driver class:com.ibm.db2.jcc.DB2Driver. Root Cause:
java.lang.Class
NotFoundException com.ibm.db2.jcc.DB2Driver
org.openanzo.exceptions.AnzoRuntimeException: ErrorCode[576:262146]
[DATASOURCE_
ERROR] [INTERNAL_ERROR] There was an error loading the database driver
class:com
.ibm.db2.jcc.DB2Driver. Root Cause: java.lang.ClassNotFoundException
com.ibm.db2
.jcc.DB2Driver
at
org.openanzo.datasource.nodecentric.internal.NodeCentricDatasourceFac
tory.updated(NodeCentricDatasourceFactory.java:248)
at org.eclipse.equinox.internal.cm.ManagedServiceFactoryTracker
$2.run(Ma
nagedServiceFactoryTracker.java:177)
at org.eclipse.equinox.internal.cm.SerializedTaskQueue$1.run
(SerializedT
askQueue.java:36)
Caused by: org.openanzo.exceptions.AnzoException: ErrorCode
[576:262146] [DATASOU
RCE_ERROR] [INTERNAL_ERROR] There was an error loading the database
driver class
:com.ibm.db2.jcc.DB2Driver. Root Cause:
java.lang.ClassNotFoundException com.ibm
.db2.jcc.DB2Driver
at
org.openanzo.datasource.nodecentric.internal.NodeCentricDatasource.in
itializeConnectionFactory(NodeCentricDatasource.java:572)
at
org.openanzo.datasource.nodecentric.internal.NodeCentricDatasource.<i
nit>(NodeCentricDatasource.java:262)
at
org.openanzo.datasource.nodecentric.internal.NodeCentricDatasourceFac
tory.updated(NodeCentricDatasourceFactory.java:233)
... 2 more
Caused by: java.lang.ClassNotFoundException: com.ibm.db2.jcc.DB2Driver
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClassIntern
al(BundleLoader.java:481)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(Bundl
eLoader.java:397)
at
org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(Bundl
eLoader.java:385)
at
org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(De
faultClassLoader.java:87)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at
org.openanzo.datasource.nodecentric.internal.NodeCentricDatasource.in
itializeConnectionFactory(NodeCentricDatasource.java:570)
... 4 more
All Currently Registered OpenAnzo services started.




Anzo do not update the db2 tables with triples. I think cause of this
Exception. Do i have to copy the db2jcc.jar in any folder of anzo?

Best Regards
Leo
Reply all
Reply to author
Forward
0 new messages