Inference-rule not working


#1

i am loading basic-ontology and try to test inference rules but i got some exceptions.

at first i am loading ontology :

/path/to/grakn-dist-0.15.0/bin/graql.sh -n -k “basic” -f /path/to/grakn-dist-0.15.0/examples/basic-genealogy.gql

then :

match $x isa grandparentship;

.the result is this

java.lang.NoClassDefFoundError: javafx/util/Pair
at ai.grakn.graql.internal.reasoner.atom.binary.RelationAtom.lambda$inferRoleTypes$20(RelationAtom.java:499)
at java.lang.Iterable.forEach(Iterable.java:75)
at ai.grakn.graql.internal.reasoner.atom.binary.RelationAtom.inferRoleTypes(RelationAtom.java:495)
at ai.grakn.graql.internal.reasoner.atom.binary.RelationAtom.inferTypes(RelationAtom.java:412)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1548)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at ai.grakn.graql.internal.reasoner.query.ReasonerQueryImpl.inferTypes(ReasonerQueryImpl.java:170)
at ai.grakn.graql.internal.reasoner.query.ReasonerQueryImpl.(ReasonerQueryImpl.java:93)
at ai.grakn.graql.internal.reasoner.query.ReasonerQueries.create(ReasonerQueries.java:39)
at ai.grakn.graql.internal.reasoner.rule.InferenceRule.(InferenceRule.java:69)
at ai.grakn.graql.internal.reasoner.atom.Atom.lambda$getApplicableRules$5(Atom.java:154)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.HashMap$KeySpliterator.forEachRemaining(HashMap.java:1548)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
at ai.grakn.graql.internal.reasoner.atom.Atom.getApplicableRules(Atom.java:156)
at ai.grakn.graql.internal.reasoner.atom.Atom.isRuleResolvable(Atom.java:163)
at ai.grakn.graql.internal.reasoner.query.ReasonerQueryImpl.isRuleResolvable(ReasonerQueryImpl.java:194)
at ai.grakn.graql.internal.query.match.MatchQueryInfer.stream(MatchQueryInfer.java:57)
at ai.grakn.graql.internal.query.match.MatchQueryGraph.stream(MatchQueryGraph.java:48)
at ai.grakn.graql.internal.query.match.AbstractMatchQuery.stream(AbstractMatchQuery.java:86)
at ai.grakn.graql.internal.query.match.AbstractMatchQuery.resultsString(AbstractMatchQuery.java:59)
at ai.grakn.engine.session.GraqlSession.lambda$null$3(GraqlSession.java:224)
at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1374)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
at ai.grakn.engine.session.GraqlSession.lambda$executeQuery$4(GraqlSession.java:224)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)


#2

Hi @emad.kha,

Do you happen to be using OpenJDK? Currently Grakn only works with Oracle JDK and when that one is not used this is the error you are likely to get.

Regards,

Filipe


#3

Alternatively, you can try installing the JavaFX package using apt-get (on Linux):

sudo apt-get install openjfx

or its OSX equivalent.