[Mulgara-general] Unable to load a Krule file into Mulgara
Paul Gearon
gearon at ieee.org
Sat Mar 22 05:13:47 UTC 2008
I think I've found it, though I still need to confirm. I made the
presumption that all rules will trigger at least one other rule, and
obviously that isn't the case here. I think the list of triggers is
the empty (null) reference.
I may not get to this until Monday, but I should find it relatively
quickly.
Paul
On Mar 21, 2008, at 3:19 PM, Ghazzaoui, Ramez (NIH/NLM/LHC) [C] wrote:
> Thank you for pointing out the empty argument at the end of the
> constrain conjunction. I removed it and the problem persists. Same
> error
> message from Java.
>
> -Ramez
>
> _______________________________
> Ramez Ghazzaoui
> Contractor
> NIH/NLM/LHC/CgSB/MOR
> +1 (301) 435-3161
>
>
>
> -----Original Message-----
> From: Paul Gearon [mailto:gearon at ieee.org]
> Sent: Friday, March 21, 2008 4:14 PM
> To: Mulgara General
> Subject: Re: [Mulgara-general] Unable to load a Krule file into
> Mulgara
>
> I think it got upset with your empty argument at the end of the
> constraint. Remove that and let me know.
>
> I've added a new ticket for it:
> http://mulgara.org/files/v1.1.1/mulgara-1.1.1-src.tar.gz
>
> It will be some time before I can get back to it, but we expect to
> automatically write these krule files in future, building them from a
> more logic-like syntax. I've already built the parser, but I don't
> have time to integrate it at the moment. When it's finally done,
> you'd write your query like this:
>
> owl:sameAs(name1, name2) :- bp:SHORT-NAME(name1, value),
> bp:SHORT-NAME(name2, value).
>
>
> Actually, I already have the OWL rule for that, which looks like:
> owl:sameAs(x,y) :- a(x,z), a(y,z), owl:InverseFunctionalProperty(a).
>
> In which case, you'll get your effect by declaring:
> owl:InverseFunctionalProperty(bp:SHORT-NAME).
>
>
> This can all be said in Krule, but the translation is verbose (as I'm
> sure you've already seen), which is why I wrote the new logic-style
> parser in the first place.
>
> Paul
>
> On Fri, Mar 21, 2008 at 12:38 PM, Ghazzaoui, Ramez (NIH/NLM/LHC) [C]
> <ghazzaouir at mail.nih.gov> wrote:
>> 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>
>>
>>
>>
>> _______________________________________________
>> Mulgara-general mailing list
>> Mulgara-general at mulgara.org
>> http://mulgara.org/mailman/listinfo/mulgara-general
>>
> _______________________________________________
> Mulgara-general mailing list
> Mulgara-general at mulgara.org
> http://mulgara.org/mailman/listinfo/mulgara-general
> _______________________________________________
> Mulgara-general mailing list
> Mulgara-general at mulgara.org
> http://mulgara.org/mailman/listinfo/mulgara-general
More information about the Mulgara-general
mailing list