Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-dev] Exception when executing custom built-in with Jess

Martin O'Connor sunid at stanford.edu
Mon Mar 5 14:10:02 PST 2018


Can you put a System.out.println in the opening line of the built-in to determine if it is actually being invoked.

Martin

> On Mar 5, 2018, at 1:10 AM, maha <maha_isims at hotmail.com> wrote:
> 
> Dear Sir, 
> 
> I did the System.out.println in the catch clause  in mybuiltin method like
> this:
> 
> public boolean mymethod(List<BuiltInArgument> arguments) throws
> BuiltInException { 
> 
>  int argument1Number = 0, argument2Number = 1, numberOfArguments = 2; 
> 	
> 	checkNumberOfArgumentsEqualTo(numberOfArguments, arguments.size());
>        String s1 = getArgumentAsAString(argument1Number, arguments); 
>        String s2 = getArgumentAsAString(argument2Number, arguments); 
> 
> try{
> 
> //the instruction that I think it does the exception in the runtime
> .
> .
> .
> 
> }
> catch(Exception e){
> System.out.println("Exception due to : "+ e.getCause());
> e.printStackTrace();
> }
>  if (isUnboundArgument(argument1Number, arguments)) { 
> 
> arguments.get(argument1Number).setBuiltInResult(createDataValueArgument(var));   
> 	  }
>        return true;
>   }
> }
> 
> This is the log file of protege:
> 
> 2018.03.05 09:39:36.515 CET INFO: *** SYSTEM START *** --
> SystemUtilities.logSystemInfo()
> 2018.03.05 09:39:36.520 CET CONFIG: Protege 3.4.8 Build 629, JVM
> 1.5.0_11-b03, memory=520M, Windows Vista, encoding=UTF-8, language=fr,
> country=FR -- SystemUtilities.logSystemInfo()
> 2018.03.05 09:39:36.990 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.owl - OWL Plugin --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:37.387 CET CONFIG: Loaded plugin
> ca.uvic.cs.chisel.jambalaya - Jambalaya --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:37.419 CET CONFIG: Loaded plugin dfki.protege.ontoviz --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:37.460 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.standard_extensions - Graph Widget, Table Widget
> -- PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:37.631 CET CONFIG: Loaded plugin
> edu.stanford.bmir.protegex.bp.ref - BioPortal Reference Plugin, BioPortal
> Import Plugin -- PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:37.687 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.rdf_backend - RDF Backend --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:37.727 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.changes - Changes tab --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:37.767 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.chatPlugin - Chat --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:37.780 CET CONFIG: Loaded plugin
> edu.stanford.smi.protege.collab - Collaborative Protege --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:37.814 CET CONFIG: Loaded plugin
> edu.stanford.smi.protege.script - Script Plugin --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:37.853 CET CONFIG: Loaded plugin
> edu.stanford.smi.protege.stringsearch - String Search Tab --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:37.889 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.changeanalysis - Change Analysis Tab --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.025 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.datamaster - DataMaster Tab --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.046 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.pal_tabs - PAL Tabs --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.076 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.ezpal - EZPal Tab --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.084 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.facets_tab --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.094 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.instance_tree --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.114 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.prompt - PROMPT Tab --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.522 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.metaanalysis - MetaAnalysis Tab --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.558 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.owl.inference.pellet - Protege Pellet Reasoner --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.616 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.query.lucene - LuceneQueryTab --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.670 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.umls_tab - UMLS Tab --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.705 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.wordnet - WordNet Tab --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.731 CET CONFIG: Loaded plugin
> edu.stanford.smi.protegex.xml_tab - XML Tab --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.751 CET CONFIG: Loaded plugin org.algernon - Algernon --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.780 CET CONFIG: Loaded plugin org.protege.owl.axiome -
> Axiome Plugin -- PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.826 CET CONFIG: Loaded plugin
> org.protege.owl.mappingmaster - MappingMaster Plugin --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.854 CET CONFIG: Loaded plugin se.liu.ida.JessTab -
> JessTab Plugin -- PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.876 CET CONFIG: Loaded plugin
> uk.ac.iam.soton.akt.tgviztab - TGVizTab --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.893 CET CONFIG: Loaded plugin
> uk.ac.man.cs.mig.coode.debugger --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.906 CET CONFIG: Loaded plugin
> uk.ac.man.cs.mig.coode.manchesterowlsyntaxeditor --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.921 CET CONFIG: Loaded plugin
> uk.ac.man.cs.mig.coode.owldoc -- PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.936 CET CONFIG: Loaded plugin
> uk.ac.man.cs.mig.coode.owlindividualstab --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.956 CET CONFIG: Loaded plugin
> uk.ac.man.cs.mig.coode.owlviz -- PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:38.996 CET CONFIG: Loaded plugin
> uk.ac.man.cs.mig.coode.protege.wizard - Basic Wizards --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:39.008 CET CONFIG: Loaded plugin
> uk.ac.man.cs.mig.coode.protege.wizard.owl - OWL Wizards --
> PluginUtilities.logClassLoaderInformation()
> 2018.03.05 09:39:44.230 CET INFO: Loading triples for: file:/C:/test.owl --
> ProtegeOWLParser.loadTriples()
> 2018.03.05 09:39:44.808 CET INFO:     Completed triple loading after 573 ms
> -- ProtegeOWLParser.loadTriples()
> 2018.03.05 09:39:44.809 CET INFO: Importing
> http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl from location:
> C:\Program
> Files\Protege_3.4.8\plugins\edu.stanford.smi.protegex.owl\sqwrl.owl --
> AbstractOWLModel.loadImportedAssertions()
> 2018.03.05 09:39:44.819 CET INFO: Loading triples for:
> http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl --
> ProtegeOWLParser.loadTriples()
> 2018.03.05 09:39:44.839 CET INFO:     Completed triple loading after 17 ms
> -- ProtegeOWLParser.loadTriples()
> 2018.03.05 09:39:44.840 CET INFO:
> http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl already
> imported as triple store
> http://sqwrl.stanford.edu/ontologies/built-ins/3.4/sqwrl.owl --
> AbstractOWLModel.loadImportedAssertions()
> 2018.03.05 09:39:44.844 CET INFO: Importing
> http://swrl.stanford.edu/ontologies/3.3/swrla.owl from location: C:\Program
> Files\Protege_3.4.8\plugins\edu.stanford.smi.protegex.owl\swrla.owl --
> AbstractOWLModel.loadImportedAssertions()
> 2018.03.05 09:39:44.848 CET INFO: Loading triples for:
> http://swrl.stanford.edu/ontologies/3.3/swrla.owl --
> ProtegeOWLParser.loadTriples()
> 2018.03.05 09:39:44.875 CET INFO:     Completed triple loading after 24 ms
> -- ProtegeOWLParser.loadTriples()
> 2018.03.05 09:39:44.876 CET INFO:
> http://swrl.stanford.edu/ontologies/3.3/swrla.owl already imported as triple
> store http://swrl.stanford.edu/ontologies/3.3/swrla.owl --
> AbstractOWLModel.loadImportedAssertions()
> 2018.03.05 09:39:44.877 CET INFO: Importing
> http://www.owl-ontologies.com/Ontology1481027354.owl from location:
> C:\Program
> Files\Protege_3.4.8\plugins\edu.stanford.smi.protegex.owl\SWRLOntologie.owl
> -- AbstractOWLModel.loadImportedAssertions()
> 2018.03.05 09:39:44.881 CET INFO: Loading triples for:
> http://www.owl-ontologies.com/Ontology1481027354.owl --
> ProtegeOWLParser.loadTriples()
> 2018.03.05 09:39:44.887 CET INFO:     Completed triple loading after 5 ms --
> ProtegeOWLParser.loadTriples()
> 2018.03.05 09:39:44.888 CET INFO:
> http://www.owl-ontologies.com/Ontology1481027354.owl already imported as
> triple store http://www.owl-ontologies.com/Ontology1481027354.owl --
> AbstractOWLModel.loadImportedAssertions()
> 2018.03.05 09:39:44.890 CET INFO: Postprocess: Process entities with
> incorrect Java type (0 entities) ...  --
> TriplePostProcessor.processFramesWithWrongJavaType()
> 2018.03.05 09:39:44.890 CET INFO: 0 ms
> -- TriplePostProcessor.processFramesWithWrongJavaType()
> 2018.03.05 09:39:44.891 CET INFO: Postprocess: Process metaclasses (3
> metaclasses) ...  -- TriplePostProcessor.processMetaclasses()
> 2018.03.05 09:39:44.892 CET INFO: 0 ms
> -- TriplePostProcessor.processMetaclasses()
> 2018.03.05 09:39:44.893 CET INFO: Postprocess: Process subclasses of
> rdf:List (1 classes) ...  --
> TriplePostProcessor.processSubclassesOfRdfList()
> 2018.03.05 09:39:44.894 CET INFO: 0 ms
> -- TriplePostProcessor.processSubclassesOfRdfList()
> 2018.03.05 09:39:44.894 CET INFO: Postprocess: Instances with multiple types
> (7 instances) ...  --
> TriplePostProcessor.processInstancesWithMultipleTypes()
> 2018.03.05 09:39:44.897 CET INFO: 2 ms
> -- TriplePostProcessor.processInstancesWithMultipleTypes()
> 2018.03.05 09:39:44.897 CET INFO: Postprocess: Add inferred superclasses ... 
> -- TriplePostProcessor.processInferredSuperclasses()
> 2018.03.05 09:39:44.898 CET INFO: 0 ms
> -- TriplePostProcessor.processInferredSuperclasses()
> 2018.03.05 09:39:44.903 CET INFO: Postprocess: Process orphan classes (13
> classes) ...  -- TriplePostProcessor.processOrphanClses()
> 2018.03.05 09:39:44.906 CET INFO: 3 ms
> -- TriplePostProcessor.processOrphanClses()
> 2018.03.05 09:39:44.907 CET INFO: Postprocess: Generalized Concept Inclusion
> (0 axioms) ...  -- TriplePostProcessor.processGeneralizedConceptInclusions()
> 2018.03.05 09:39:44.908 CET INFO: 1 ms
> -- TriplePostProcessor.processGeneralizedConceptInclusions()
> 2018.03.05 09:39:44.908 CET INFO: Postprocess: Abstract classes...  --
> TriplePostProcessor.processAbstractClasses()
> 2018.03.05 09:39:44.909 CET INFO: 0 ms
> -- TriplePostProcessor.processAbstractClasses()
> 2018.03.05 09:39:44.909 CET INFO: Postprocess: Domain and range of
> properties...  -- TriplePostProcessor.processDomainAndRange()
> 2018.03.05 09:39:44.916 CET INFO: 6 ms
> -- TriplePostProcessor.processDomainAndRange()
> 2018.03.05 09:39:44.916 CET INFO: Postprocess: Possibly typed entities (0
> resources) ...  -- TriplePostProcessor.processPossiblyTypedResources()
> 2018.03.05 09:39:44.917 CET INFO: 0 ms
> -- TriplePostProcessor.processPossiblyTypedResources()
> 2018.03.05 09:39:44.919 CET INFO: Updating underlying frames model in 0 ms
> -- ProtegeOWLParser.doFinalPostProcessing()
> 2018.03.05 09:39:54.372 CET INFO: Rule engine 'SWRLJessBridge' registered
> with the SWRLTab. -- SWRLRuleEngineFactory.registerRuleEngine()
> 2018.03.05 09:39:54.385 CET INFO: Plugin 'SWRLJessBridge' registered with
> the SWRLTab plugin manager. -- BridgePluginManager.registerPlugin()
> 2018.03.05 09:39:54.392 CET INFO: Plugin 'SQWRLQueryTab' registered with the
> SWRLTab plugin manager. -- BridgePluginManager.registerPlugin()
> 
> and this is the display of Jess tab when executing the rule:
> 
> SWRL rule and relevant OWL knowledge successfully converted to rule engine
> knowledge.
> Number of SWRL rules exported to rule engine: 1
> Number of OWL class declarations exported to rule engine: 6
> Number of OWL individual declarations exported to rule engine: 35
> Number of other OWL axioms exported to rule engine: 46
> The transfer took 423 millisecond(s).
> Press the "Run Jess" button to run the rule engine.
> Exception running rule engine: error running Jess rule engine: Jess reported
> an error in routine invokeSWRLBuiltIn
> 	while executing (invokeSWRLBuiltIn "Rule-1"
> "http://www.owl-ontologies.com/Ontology1481027354.owl#mymethod" 0 true ?xx
> ?yy)
> 	while executing defrule MAIN::Rule-1.
>  Message: exception thrown by built-in mybuiltin:mymethod in rule Rule-1:
> edu.stanford.smi.protegex.owl.swrl.bridge.exceptions.BuiltInException:
> unknown exception thrown by built-in mybuiltin:mymethod in rule Rule-1:
> java.lang.reflect.InvocationTargetException.
> 
> How to fix it?
> 
> Thank you in advance.
> 
> Best Regards.
> 
> 
> 
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-Developer-f4659816.html
> _______________________________________________
> protege-dev mailing list
> protege-dev at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-dev




More information about the protege-dev mailing list