Semantic Oracle database - rule index problem

126 views
Skip to first unread message

Daniele Caso

unread,
Feb 7, 2011, 11:26:30 AM2/7/11
to TopBraid Suite Users
Dear all,
I use TopBraid ME with Oracle Semantic Technology.
In Oracle conncection wizard I set up the correct parameters for the
connection.
In the Server-side rule base field I specify a new name for my rule
base (not already existing in the oracle db) that I want to fill with
my own rules.
Then, I check with SQL developer and I see that rule base and
entailment are correctly created.
When I try to import my own owl file into project (--> Import triples
from this file into current model), TopBraid shows this error:

reason:
com.hp.hpl.jena.shared.JenaException: java.sql.SQLException:
ORA-20000: We do not have a valid rules index for this Model-Rulebase
combination
ORA-06512: a "MDSYS.RDF_MATCH_IMPL_T", line 850
ORA-06512: a "MDSYS.RDF_MATCH_IMPL_T", line 235
ORA-06512: a line 1


and status column of the RDF_RULES_INDEX_INFO became INCOMPLETE.

How can I resolve this problem?

Thank you for the answers

Daniele Caso

Holger Knublauch

unread,
Feb 7, 2011, 8:39:25 PM2/7/11
to topbrai...@googlegroups.com
Hi Daniele,

thanks for this report. It looks like a general defect with our current Oracle RDF rules support. We will investigate and let you know.

Meanwhile I would recommend you do all editing in another Oracle connection that does not use rules. You could set up two different .oracle files pointing to the same named model. The Oracle inferencing happens server side, so that editing this data from TBC does not really make sense anyway. I verified that inferencing works in principle, so that you could run the inferences (on that separate .oracle connection) after all edits have happened.

Regards,
Holger

> --
> You received this message because you are subscribed to the Google
> Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
> TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
> To post to this group, send email to
> topbrai...@googlegroups.com
> To unsubscribe from this group, send email to
> topbraid-user...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/topbraid-users?hl=en

Daniele Caso

unread,
Feb 8, 2011, 3:25:52 AM2/8/11
to topbrai...@googlegroups.com
Dear Holger,
first of all thank you very much for your latter response.
I've tryed your proposed solution but it doesnt' work very well.
With first oracle connection, without rules, I've successfully
imported my own owl file then with the second one I've tryed to create
a rule base.
The rule base table and rule index view were correctly created and
then I inserted first rule. After this I performed the inference and
TopBraid returned
the same error:

ERROR REPORT---------------------------
An unexpected error has occured.

If you believe this is due to a bug in TopBraid Composer, then please
consider to report the problem to compose...@topquadrant.com and
ideally include an export of the Error Log View (Window > Show View >
Error Log).

On: 8-feb-2011 9.22.18

Reason:


com.hp.hpl.jena.shared.JenaException: java.sql.SQLException:
ORA-20000: We do not have a valid rules index for this Model-Rulebase
combination
ORA-06512: a "MDSYS.RDF_MATCH_IMPL_T", line 850
ORA-06512: a "MDSYS.RDF_MATCH_IMPL_T", line 235
ORA-06512: a line 1


at oracle.spatial.rdf.client.jena.GraphOracleSem.graphBaseFind(GraphOracleSem.java:3080)

at oracle.spatial.rdf.client.jena.GraphOracleSem.graphBaseFind(GraphOracleSem.java:2511)

at oracle.spatial.rdf.client.jena.GraphOracleSem.graphBaseFind(GraphOracleSem.java:2378)

at com.hp.hpl.jena.graph.impl.GraphBase.find(GraphBase.java:240)

at org.topbraid.core.graph.DelegatingGraph.delegateFind(DelegatingGraph.java:235)

at org.topbraid.core.graph.CachingGraph.addToCache(CachingGraph.java:138)

at org.topbraid.core.graph.AbstractCachingGraph.find(AbstractCachingGraph.java:180)

at org.topbraid.core.graph.AbstractCachingGraph.find(AbstractCachingGraph.java:170)

at org.topbraid.core.graph.DelegatingGraph.find(DelegatingGraph.java:111)

at org.topbraid.core.graph.BufferingGraph.find(BufferingGraph.java:273)

at org.topbraid.core.graph.BufferingGraph.find(BufferingGraph.java:320)

at com.hp.hpl.jena.graph.compose.MultiUnion.multiGraphFind(MultiUnion.java:187)

at com.hp.hpl.jena.graph.compose.MultiUnion.graphBaseFind(MultiUnion.java:166)

at com.hp.hpl.jena.graph.impl.GraphBase.find(GraphBase.java:240)

at com.hp.hpl.jena.graph.impl.GraphBase.graphBaseFind(GraphBase.java:260)

at com.hp.hpl.jena.graph.impl.GraphBase.find(GraphBase.java:257)

at com.hp.hpl.jena.graph.query.SimpleQueryHandler.subjectsFor(SimpleQueryHandler.java:60)

at com.hp.hpl.jena.graph.query.SimpleQueryHandler.subjectsFor(SimpleQueryHandler.java:44)

at com.hp.hpl.jena.rdf.model.impl.ModelCom.listSubjectsFor(ModelCom.java:1019)

at com.hp.hpl.jena.rdf.model.impl.ModelCom.listResourcesWithProperty(ModelCom.java:1033)

at com.hp.hpl.jena.rdf.model.impl.ModelCom.listSubjectsWithProperty(ModelCom.java:433)

at org.topbraid.core.model.Classes.getMetaClasses(Classes.java:529)

at org.topbraid.core.model.Classes.computeMetaClasses(Classes.java:44)

at org.topbraidcomposer.core.session.AbstractSessionWithCache.getCachedMetaClasses(AbstractSessionWithCache.java:53)

at org.topbraid.core.model.Classes.getMetaClasses(Classes.java:165)

at org.topbraid.core.model.Classes.isClass(Classes.java:330)

at org.topbraidcomposer.navigation.domain.DomainView.resourceSelected(DomainView.java:199)

at org.topbraidcomposer.core.session.TBCSession.notifyResourceSelectionListeners(TBCSession.java:307)

at org.topbraidcomposer.core.session.TBCSession.setSelectedResource(TBCSession.java:421)

at org.topbraidcomposer.ui.views.ShowSelectedResourceAction.run(ShowSelectedResourceAction.java:38)

at org.topbraidcomposer.ui.views.AbstractStructuredViewerView$3.doubleClick(AbstractStructuredViewerView.java:246)

at org.eclipse.jface.viewers.StructuredViewer$1.run(StructuredViewer.java:824)

at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)

at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)

at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)

at org.eclipse.jface.viewers.StructuredViewer.fireDoubleClick(StructuredViewer.java:822)

at org.eclipse.jface.viewers.StructuredViewer.handleDoubleSelect(StructuredViewer.java:1113)

at org.eclipse.jface.viewers.StructuredViewer$4.widgetDefaultSelected(StructuredViewer.java:1225)

at org.eclipse.jface.util.OpenStrategy.fireDefaultSelectionEvent(OpenStrategy.java:238)

at org.eclipse.jface.util.OpenStrategy.access$0(OpenStrategy.java:235)

at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:296)

at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)

at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)

at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4066)

at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3657)

at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2629)

at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2593)

at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2427)

at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:670)

at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)

at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:663)

at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)

at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)

at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)

at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)

at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)

at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)

at org.eclipse.equinox.launcher.Main.run(Main.java:1407)

at org.eclipse.equinox.launcher.Main.main(Main.java:1383)

Caused by: java.sql.SQLException: ORA-20000: We do not have a valid


rules index for this Model-Rulebase combination
ORA-06512: a "MDSYS.RDF_MATCH_IMPL_T", line 850
ORA-06512: a "MDSYS.RDF_MATCH_IMPL_T", line 235
ORA-06512: a line 1


at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)

at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)

at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)

at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)

at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)

at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:205)

at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:861)

at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1145)

at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1267)

at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449)

at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3493)

at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)

at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:420)

at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:364)

at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:356)

at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:344)

at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:329)

at oracle.spatial.rdf.client.jena.Oracle.executeQuery(Oracle.java:304)

at oracle.spatial.rdf.client.jena.GraphOracleSem.executeFindQuery(GraphOracleSem.java:4043)

at oracle.spatial.rdf.client.jena.GraphOracleSem.graphBaseFind(GraphOracleSem.java:3076)

... 65 more
--------------------------------------------------

This time the rule index status column became INVALID instead of INCOMPLETE.

Thank you for helping, I'm waiting for your response,

Best Regards

Daniele

Scott Henninger

unread,
Feb 9, 2011, 6:41:17 PM2/9/11
to TopBraid Suite Users
Daniele; I believe Holger meant that you would need to use rules
defined in some other editor, as the TBC editor for Oracle rules
currently does not work. We will fix this in a future version of
Composer.

In the meanwhile, you can edit these rules directly in Oracle. An
alternative, which again has the advantage of being a vendor-neutral
W3C standard, is SPARQL. Open your .oracle model in Composer and
click on the SPARQL View in the middle-bottom tab. There will be a
default query displayed there that can be executed immediately. The
query is executed on data in your Oracle server and the results (first
1000 by default) are displayed in the view.

Use the CONSTRUCT form of SPARQL to apply rules as performed in Oracle
Rules. For example, the following query (shown in Composer's Jena
rules format) will compute the :sister relationship:

(?person :parent ?parent)
(?parent :child ?sister)
(?sister :gender :female)
(?person != ?sister)
-> (?person :sister ?sister)

This can be written in SPARQL with a nearly equivalent syntax:

CONSTRUCT {?person :sister ?sister}
WHERE {
?person :parent ?parent .
?parent :child ?sister .
?sister :gender :female .
FILTER (?person != ?sister)
}

If you have questions on formulating SPARQL queries, we'd be happy to
help out on this forum. We will let you know when the Oracle rule
editor is fixed.

-- Scott

On Feb 8, 2:25 am, Daniele Caso <daniele.c...@gmail.com> wrote:
> Dear Holger,
> first of all thank you very much for your latter response.
> I've tryed your proposed solution but it doesnt' work very well.
> With first oracle connection, without rules, I've successfully
> imported my own owl file then with the second one I've tryed to create
> a rule base.
> The rule base table and rule index view were correctly created and
> then I inserted first rule. After this I performed the inference and
> TopBraid returned
> the same error:
>
[...]

Daniele Caso

unread,
Feb 10, 2011, 3:54:17 AM2/10/11
to topbrai...@googlegroups.com
Dear Scott,
Thank you very much for you response, I'll wait for the next release
fixing bug :D.
In the meanwhile, I've tryed to edit rules directly (and only) from
SQLDeveloper in Oracle, but I've the same problem (column became
invalid or incomplete after the frist change in the model). Now I'll
try SPARQL CONSTRUCT but I've need to assert the inferred triples in
my model.
Is it possible with Sparql construct?
Thank you very much,

Daniele


2011/2/10 Scott Henninger <shenn...@topquadrant.com>:

Scott Henninger

unread,
Feb 10, 2011, 1:33:50 PM2/10/11
to TopBraid Suite Users
<<Now I'll
try SPARQL CONSTRUCT but I've need to assert the inferred triples in
my model.
Is it possible with Sparql construct?>>

Daniele; There are many options for inferring and asserting triples
created by SPARQL CONSTRUCT queries. The introductory step is to
place the query in the SPARQL view, run it, then choose the triples
you want to assert or infer. Use the context menu (the triangle in
the upper-right of the view) to select how to process the triples
returned by CONSTRUCT. If you choose to infer the triples, then each
inferred triple will be displayed in Composer's form with a purple
background and the inferences will not be saved. If you assert the
triples, they become part of your asserted graph and will be saved in
your model.

Queries can be saved in your model, attached to any resource in the
model, by selecting the "Attach current query to the selected
resource" icon in the top-right of the SPARQL View. These queries
will be displayed in the Query library.

If you need to run a series of queries, you can use the SPIN engine.
You can define SPARQL Rules on a class and the inference engine will
apply the query to all members of that class. The results are placed
in the inferred graph as inferences. In addition to CONSTRUCT for
creating inferences, SPIN also supports constraint violation warnings
that utilizes SPARQL queries to warn of data problems. There are many
sources of information about SPIN, including the tutorial at
http://www.topquadrant.com/products/SPIN.html.

It should also be noted that RDFS, RDFS+ and OWL are supported through
SPARQL Rules.

Another mechanism to organize and apply rules is SPARQLMotion, which
allows one to automate a series of processing steps using SPARQL with
a visual pipeline interface. For example, if you need to import some
data in a spreadsheet, run a few queries to align the data with an
existing model, merge the data sets, then run inferences, this series
of steps can be automated in a SPARQLMotion script. More about
SPARQLMotion can be found at http://www.topquadrant.com/products/SPARQLMotion.html

Any SPARQL query in any of the aforementioned techniques can be
applied to data from an Oracle back end. Other means of storing data,
including standard RDF text serializations, triple-store back-ends,
and RDF-to-relational mappings, are supported by TopBraid Suite.

Hopefully, this will help you get started, and you should feel free to
ask questions as you go. I should also point out that a list of
general tutorials and user guides are found at
http://www.topquadrant.com/products/support.html.

-- Scott

On Feb 10, 2:54 am, Daniele Caso <daniele.c...@gmail.com> wrote:
> Dear Scott,
> Thank you very much for you response,  I'll wait for the next release
> fixing bug :D.
> In the meanwhile, I've tryed to edit rules directly (and only) from
> SQLDeveloper in Oracle, but I've the same problem (column became
> invalid or incomplete after the frist change in the model). Now I'll
> try SPARQL CONSTRUCT but I've need to assert the inferred triples in
> my model.
> Is it possible with Sparql construct?
> Thank you very much,
>
> Daniele
>
> 2011/2/10 Scott Henninger <shennin...@topquadrant.com>:

Holger Knublauch

unread,
Feb 10, 2011, 7:24:40 PM2/10/11
to topbrai...@googlegroups.com
Hi Daniele,

I have been reading the help page on Oracle (that I wrote myself years ago) to remind myself how this is supposed to work. It told me that such errors are in fact expected, and that the solution is to go to the Oracle menu > Perform Server Side inferences. This apparently establishes and updates the corresponding rule indexes. Then go to Model > Refresh all caches and views. In the tests that I made, this procedure was working fine, so I don't believe that anything is seriously wrong with how TBC behaves. The error message is not very enlightening, admittedly.

FYI if you want to get to the same state in your own application, and use the Jena adapter, here is the code that the menu item invokes:

oracleGraph.deleteInference();
oracleGraph.performInference();

Regards,
Holger

Daniele Caso

unread,
Feb 14, 2011, 4:09:17 AM2/14/11
to topbrai...@googlegroups.com
Dear Holger,
I dont' know but this is the TME's behavior.
I think that It doesn't delete the entailment as soon as I insert a new rules.
With JENA ADAPTER,

> oracleGraph.deleteInference();
and
> oracleGraph.performInference();

work fine.

Daniele


2011/2/11 Holger Knublauch <hol...@topquadrant.com>:

Daniele Caso

unread,
Feb 14, 2011, 4:11:54 AM2/14/11
to topbrai...@googlegroups.com
Thank you Scott,
the SPARQL procedure to get infererred triples it's very interesting procedure.
I'll try it.

Daniele


2011/2/10 Scott Henninger <shenn...@topquadrant.com>:

Reply all
Reply to author
Forward
0 new messages