6 Replies Latest reply: Sep 21, 2011 1:30 PM by 880207 RSS

    Jena - performInference

    880207
      Hi,

      Referring to the solution in thread :
      Using Bag in Jena

      What will happen if i dont use graph.performInference(), i.e. if i dont create entailment, can i use inverseOf property in my query?

      I mean can anyone explain what features i will not be able to use in my sparql query if i dont run graph.performInference().

      Thanks and Regards,
      Manish Hardasmalani

      Edited by: alwu on Sep 19, 2011 9:52 AM
        • 1. Re: Jena - performInference
          alwu-Oracle
          Hi,

          If you don't run inference, then you can only query/find the assertions you made explicitly.

          BTW, I have fixed the typo "Jean" (should be Jena")

          Thanks,

          Zhe
          • 2. Re: Jena - performInference
            880207
            Hi Zhe,

            Thanks for the answer and sorry for the typo mistake.
            Ok so when we call graph.performInference(), it creates index on the models we have included. So the index is created on the modles containing complete triple(subject,predicate,object).
            I have added a new thread related to index creation on only subject or object, is it possible? :
            Index on Triple datatype in SPARQL

            Thanks and Regards,
            Manish Hardasmalani
            • 3. Re: Jena - performInference
              alwu-Oracle
              Hi,

              When you run performInference, Oracle will create an entailment partition (or rules index) using forward chaining inference. This partition will include new, implicit relationships (triples) that can be derived from your asserted knowledge base.

              Note that this entailment (rules index) is not the same as the regular B-Tree index you are talking about.

              Thanks,

              Zhe Wu
              • 4. Re: Jena - performInference
                880207
                Hi Zhe,

                Thanks for the answer. I was thinking that when performInference() is running, status status of rulebase index should be INCOMPLETE,
                if there is any problem status of rulebase index should be INVALID, if it runs fine status of rulebase index value should be VALID.
                So when we run our Jena code which is not having performInference() method call and status of rulebase index is either INCOMPLETE or INVALID, it gives an error saying ORA-20000: We do not have a rules index for this Model-Rulebase combination
                Is there a way by which we can still run our sparql query using Jena when rulebase index status is Invalid or incomplete?

                Edited by: MH on Sep 20, 2011 2:27 AM
                • 5. Re: Jena - performInference
                  alwu-Oracle
                  Hi,

                  You can set QueryOptions.ALLOW_QUERY_INVALID (or ALLOW_QUERY_INCOMPLETE) when constructing Attachment.

                  e.g.

                  Attachment attachment = Attachment.createInstance(
                  model2, "OWLPRIME",
                  InferenceMaintenanceMode.UPDATE_WHEN_COMMIT,
                  QueryOptions.ALLOW_QUERY_INVALID);

                  GraphOracleSem graph = new GraphOracleSem(
                  oracle, modelName, attachment);

                  Thanks,

                  Zhe Wu
                  • 6. Re: Jena - performInference
                    880207
                    Thanks Zhe.