[Mulgara-general] Unable to load a Krule file into Mulgara
Ghazzaoui, Ramez (NIH/NLM/LHC) [C]
ghazzaouir at mail.nih.gov
Fri Mar 21 10:38:31 PDT 2008
Hi,
I am having trouble loading a rather simple Krule into Mulgara. Below
are the details about what I am doing and what the error is. I wonder if
anyone here knows how to work around this problem.
Thanks!
-Ramez
I created my model and loaded the triples successfully with this:
-----------------------------------------------------------------
create <rmi://localhost/server1#nida_1>;
load <file:/export/home/moradmin/mulgara/raw_triples/nida_triples.nt>
into <rmi://localhost/server1#nida_1>;
Now I am trying to create an entailed Krule model with these Commands
(which worked in the past on other models, other rules):
---------------------------------------------------------------------
create <rmi://localhost/server1#krm_nida_sameAs>;
create <rmi://localhost/server1#nida_1_ent_sameAs>;
load <file:/export/home/moradmin/mulgara/rules/krm_nida_sameAs.rdf>
into <rmi://localhost/server1#krm_nida_sameAs>;
apply <rmi://localhost/server1#krm_nida_sameAs>
to <rmi://localhost/server1#nida_1>
<rmi://localhost/server1#nida_1_ent_sameAs>;
I get this error:
-----------------
2008-03-21 11:00:04,233 ERROR KruleLoader -
Unexpected error during loading: null
java.lang.NullPointerException
at
org.mulgara.krule.KruleLoader.getConstraints(KruleLoader.java:1003)
at
org.mulgara.krule.KruleLoader.getConstraints(KruleLoader.java:1014)
at org.mulgara.krule.KruleLoader.loadJoinConstraints
(KruleLoader.java:863)
at org.mulgara.krule.KruleLoader.loadRdfObjects(KruleLoader.java:317)
at org.mulgara.krule.KruleLoader.readRules(KruleLoader.java:254)
at org.mulgara.resolver.DatabaseSession.buildRules
(DatabaseSession.java:508)
at org.mulgara.server.rmi.SessionWrapperRemoteSession.buildRules
(SessionWrapperRemoteSession.java:461)
at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
at sun.rmi.transport.Transport$1.run(Transport.java:153)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
at sun.rmi.transport.tcp.TCPTransport.handleMessages
(TCPTransport.java:460)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run
(TCPTransport.java:701)
at java.lang.Thread.run(Thread.java:595)
Syntax error (line 16): org.mulgara.rules.InitializerException:
Unexpected error loading rules
The Krule file (krm_nida_sameAs.rdf) is as follows:
---------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#">
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
<!ENTITY mulgara "http://mulgara.org/mulgara#">
<!ENTITY krule "http://mulgara.org/owl/krule/#">
<!ENTITY bp "http://www.biopax.org/release/biopax-level2.owl#">
]>
<rdf:RDF xmlns:rdf="&rdf;"
xmlns:rdfs="&rdfs;"
xmlns:owl="&owl;"
xmlns:xsd="&xsd;"
xmlns="&krule;"
xmlns:krule="&krule;"
xmlns:bp="&bp;"
xml:base="http://mulgara.org/owl/krule/">
<krule:URIReference rdf:about="#bp_short_name">
<rdf:value rdf:resource="bp:SHORT-NAME"/>
</krule:URIReference>
<krule:URIReference rdf:about="#owl_sameAs">
<rdf:value rdf:resource="owl:sameAs"/>
</krule:URIReference>
<Variable rdf:about="#name1">
<name>name1</name>
</Variable>
<Variable rdf:about="#name2">
<name>name2</name>
</Variable>
<Variable rdf:about="#value">
<name>value</name>
</Variable>
<!-- * plain sameAs -->
<krule:Rule rdf:about="#same_as">
<hasQuery>
<Query>
<selectionVariables>
<rdf:Seq>
<rdf:li rdf:resource="#name1"/>
<rdf:li rdf:resource="owl_sameAs"/>
<rdf:li rdf:resource="#name2"/>
</rdf:Seq>
</selectionVariables>
<hasWhereClause>
<ConstraintConjunction>
<argument>
<SimpleConstraint>
<hasSubject>
<Variable rdf:about="#name1"/>
</hasSubject>
<hasPredicate>
<URIReference rdf:about="#bp_short_name"/>
</hasPredicate>
<hasObject>
<Variable rdf:about="#value"/>
</hasObject>
</SimpleConstraint>
</argument>
<argument>
<SimpleConstraint>
<hasSubject>
<Variable rdf:about="#name2"/>
</hasSubject>
<hasPredicate>
<URIReference rdf:about="#bp_short_name"/>
</hasPredicate>
<hasObject>
<Variable rdf:about="#value"/>
</hasObject>
</SimpleConstraint>
</argument>
<argument>
</argument>
</ConstraintConjunction>
</hasWhereClause>
</Query>
</hasQuery>
</krule:Rule>
</rdf:RDF>
More information about the Mulgara-general
mailing list