[Jfresnel-devel] Probable error in FresnelSesameParser

Emmanuel Pietriga emmanuel.pietriga at inria.fr
Fri May 29 07:47:22 CEST 2009


Hi,

Fixed in SVN.

Emmanuel

On 28 mai 09, at 00:01, Miroslav Warchil wrote:

> Hello,
>
> I'm sorry for late answer. The problem is exactly the same as in
> previous case (with this ClassCastException in valueFormat). It occurs
> also at further 3 places of FresnelSesameParser (labelFormat,
> propertyFormat, resourceFormat). Here are 3 relevant stack traces:
>
> 1) labelFormat:
>
> Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:
> org.openrdf.sail.memory.model.MemURI cannot be cast to
> org.openrdf.model.Literal
> 	at  
> fr 
> .inria 
> .jfresnel 
> .sesame.FresnelSesameParser.buildFormat(FresnelSesameParser.java:668)
> 	at  
> fr 
> .inria 
> .jfresnel 
> .sesame.FresnelSesameParser.buildFormats(FresnelSesameParser.java:306)
> 	at  
> fr 
> .inria 
> .jfresnel 
> .sesame 
> .FresnelSesameParser.parseSesameModel(FresnelSesameParser.java:268)
> 	at  
> fr 
> .inria 
> .jfresnel.sesame.FresnelSesameParser.parse(FresnelSesameParser.java: 
> 251)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .model.FresnelRepositoryDao.getFormat(FresnelRepositoryDao.java:151)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .gui.mod.format.FormatsJPanel.<init>(FormatsJPanel.java:121)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .gui 
> .mod 
> .format.treemodel.FormatItemNode.createComponent(FormatItemNode.java: 
> 32)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .common.guisupport.projecttree.ATabNode.getComponent(ATabNode.java: 
> 157)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .gui 
> .mod.format.treemodel.FormatItemNode.toString(FormatItemNode.java:27)
> 	at javax.swing.JTree.convertValueToText(Unknown Source)
>
> 2) propertyFormat:
>
> Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:
> org.openrdf.sail.memory.model.MemURI cannot be cast to
> org.openrdf.model.Literal
> 	at  
> fr 
> .inria 
> .jfresnel 
> .sesame.FresnelSesameParser.buildFormat(FresnelSesameParser.java:632)
> 	at  
> fr 
> .inria 
> .jfresnel 
> .sesame.FresnelSesameParser.buildFormats(FresnelSesameParser.java:306)
> 	at  
> fr 
> .inria 
> .jfresnel 
> .sesame 
> .FresnelSesameParser.parseSesameModel(FresnelSesameParser.java:268)
> 	at  
> fr 
> .inria 
> .jfresnel.sesame.FresnelSesameParser.parse(FresnelSesameParser.java: 
> 251)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .model.FresnelRepositoryDao.getFormat(FresnelRepositoryDao.java:151)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .gui.mod.format.FormatsJPanel.<init>(FormatsJPanel.java:121)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .gui 
> .mod 
> .format.treemodel.FormatItemNode.createComponent(FormatItemNode.java: 
> 32)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .common.guisupport.projecttree.ATabNode.getComponent(ATabNode.java: 
> 157)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .gui 
> .mod.format.treemodel.FormatItemNode.toString(FormatItemNode.java:27)
> 	at javax.swing.JTree.convertValueToText(Unknown Source)
>
> 3) resourceFormat:
>
> Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException:
> org.openrdf.sail.memory.model.MemURI cannot be cast to
> org.openrdf.model.Literal
> 	at  
> fr 
> .inria 
> .jfresnel 
> .sesame.FresnelSesameParser.buildFormat(FresnelSesameParser.java:596)
> 	at  
> fr 
> .inria 
> .jfresnel 
> .sesame.FresnelSesameParser.buildFormats(FresnelSesameParser.java:306)
> 	at  
> fr 
> .inria 
> .jfresnel 
> .sesame 
> .FresnelSesameParser.parseSesameModel(FresnelSesameParser.java:268)
> 	at  
> fr 
> .inria 
> .jfresnel.sesame.FresnelSesameParser.parse(FresnelSesameParser.java: 
> 251)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .model.FresnelRepositoryDao.getFormat(FresnelRepositoryDao.java:151)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .gui.mod.format.FormatsJPanel.<init>(FormatsJPanel.java:121)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .gui 
> .mod 
> .format.treemodel.FormatItemNode.createComponent(FormatItemNode.java: 
> 32)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .common.guisupport.projecttree.ATabNode.getComponent(ATabNode.java: 
> 157)
> 	at  
> cz 
> .muni 
> .fi 
> .fresneleditor 
> .gui 
> .mod.format.treemodel.FormatItemNode.toString(FormatItemNode.java:27)
> 	at javax.swing.JTree.convertValueToText(Unknown Source)
>
> Thank you very much for your effort. Have a nice day.
>
> Best regards
>
> Miroslav Warchil
> Masaryk University, Brno
>
>
> On Mon, May 25, 2009 at 7:02 AM, Emmanuel Pietriga
> <emmanuel.pietriga at inria.fr> wrote:
>> Can you send me stack traces for each of the problems?
>>
>> It will making my locating them much easier.
>>
>> thanks,
>> Emmanuel
>>
>>
>> On 25 mai 09, at 00:26, Miroslav Warchil wrote:
>>
>>> Hello,
>>>
>>> thank you very much for this change - it was very helpful. In  
>>> further
>>> testing I've discovered that similar problem occurs at 3 another
>>> places in FresnelSesameParser (in buildFormat() method): when  
>>> parsing
>>> "fresnel:resourceFormat", "fresnel:propertyFormat" and
>>> "fresnel:labelFormat" (problem in "fresnel:valueFormat" was already
>>> fixed). At these places before mentioned ClassCastException can  
>>> occur
>>> too.
>>>
>>> I'm very sorry to bother you but could you please arrange change of
>>> these pieces of code too? Thank you very much for your time. Have a
>>> nice day.
>>>
>>> Best regards
>>>
>>> Miroslav Warchil
>>> Masaryk University, Brno
>>>
>>>
>>> On Wed, May 20, 2009 at 8:04 AM, Emmanuel Pietriga
>>> <emmanuel.pietriga at inria.fr> wrote:
>>>>
>>>> The problem should be fixed now. You'll need to use v0.3.2- 
>>>> SNAPSHOT. I've
>>>> deployed a new build in the Maven repository. Alternatively you can
>>>> checkout
>>>> the code from SVN and build it yourself. Instructions for all
>>>> possibilities
>>>> available at [1].
>>>>
>>>> [1] http://jfresnel.gforge.inria.fr/download.html
>>>>
>>>> thanks for the report,
>>>> Emmanuel
>>>>
>>>>
>>>>
>>>> On 19 mai 09, at 23:14, Miroslav Warchil wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> I'm sorry that I haven't attached detail information immediately.
>>>>> Here's the stack-trace of exception when I try to parse Sesame
>>>>> respository with Fresnel Format definition which was mentioned  
>>>>> before:
>>>>>
>>>>> Exception in thread "AWT-EventQueue-0"  
>>>>> java.lang.ClassCastException:
>>>>> org.openrdf.sail.memory.model.MemURI cannot be cast to
>>>>> org.openrdf.model.Literal
>>>>>       at
>>>>>
>>>>> fr 
>>>>> .inria 
>>>>> .jfresnel 
>>>>> .sesame.FresnelSesameParser.buildFormat(FresnelSesameParser.java: 
>>>>> 704)
>>>>>       at
>>>>>
>>>>> fr 
>>>>> .inria 
>>>>> .jfresnel 
>>>>> .sesame 
>>>>> .FresnelSesameParser.buildFormats(FresnelSesameParser.java:306)
>>>>>       at
>>>>>
>>>>> fr 
>>>>> .inria 
>>>>> .jfresnel 
>>>>> .sesame 
>>>>> .FresnelSesameParser.parseSesameModel(FresnelSesameParser.java: 
>>>>> 268)
>>>>>       at
>>>>>
>>>>> fr 
>>>>> .inria 
>>>>> .jfresnel 
>>>>> .sesame.FresnelSesameParser.parse(FresnelSesameParser.java:251)
>>>>>       at
>>>>>
>>>>> cz 
>>>>> .muni 
>>>>> .fi 
>>>>> .fresneleditor 
>>>>> .model.FresnelRepositoryDao.getFormat(FresnelRepositoryDao.java: 
>>>>> 152)
>>>>>       at
>>>>>
>>>>> cz 
>>>>> .muni 
>>>>> .fi 
>>>>> .fresneleditor 
>>>>> .gui.mod.format.FormatsJPanel.<init>(FormatsJPanel.java:121)
>>>>>       at
>>>>>
>>>>> cz 
>>>>> .muni 
>>>>> .fi 
>>>>> .fresneleditor 
>>>>> .gui 
>>>>> .mod 
>>>>> .format 
>>>>> .treemodel.FormatItemNode.createComponent(FormatItemNode.java:32)
>>>>>       at
>>>>>
>>>>> cz 
>>>>> .muni 
>>>>> .fi 
>>>>> .fresneleditor 
>>>>> .common 
>>>>> .guisupport.projecttree.ATabNode.getComponent(ATabNode.java:157)
>>>>>       at
>>>>>
>>>>> cz 
>>>>> .muni 
>>>>> .fi 
>>>>> .fresneleditor 
>>>>> .gui 
>>>>> .mod 
>>>>> .format.treemodel.FormatItemNode.toString(FormatItemNode.java:27)
>>>>>       at javax.swing.JTree.convertValueToText(Unknown Source)
>>>>>       at
>>>>>
>>>>> javax 
>>>>> .swing 
>>>>> .tree.DefaultTreeCellRenderer.getTreeCellRendererComponent(Unknown
>>>>> Source)
>>>>>       at
>>>>>
>>>>> com.sun.java.swing.plaf.windows.WindowsTreeUI 
>>>>> $WindowsTreeCellRenderer.getTreeCellRendererComponent(Unknown
>>>>> Source)
>>>>>       at
>>>>>
>>>>> javax.swing.plaf.basic.BasicTreeUI 
>>>>> $NodeDimensionsHandler.getNodeDimensions(Unknown
>>>>> Source)
>>>>>       at  
>>>>> javax.swing.tree.AbstractLayoutCache.getNodeDimensions(Unknown
>>>>> Source)
>>>>>       at
>>>>>
>>>>> javax.swing.tree.VariableHeightLayoutCache 
>>>>> $TreeStateNode.updatePreferredSize(Unknown
>>>>> Source)
>>>>>       at
>>>>> javax.swing.tree.VariableHeightLayoutCache 
>>>>> $TreeStateNode.expand(Unknown
>>>>> Source)
>>>>>       at
>>>>> javax.swing.tree.VariableHeightLayoutCache 
>>>>> $TreeStateNode.expand(Unknown
>>>>> Source)
>>>>>       at
>>>>> javax 
>>>>> .swing.tree.VariableHeightLayoutCache.ensurePathIsExpanded(Unknown
>>>>> Source)
>>>>>       at
>>>>> javax 
>>>>> .swing.tree.VariableHeightLayoutCache.setExpandedState(Unknown
>>>>> Source)
>>>>>       at
>>>>> javax 
>>>>> .swing.plaf.basic.BasicTreeUI.updateExpandedDescendants(Unknown
>>>>> Source)
>>>>>       at javax.swing.plaf.basic.BasicTreeUI 
>>>>> $Handler.treeExpanded(Unknown
>>>>> Source)
>>>>>       at javax.swing.JTree.fireTreeExpanded(Unknown Source)
>>>>>       at javax.swing.JTree.setExpandedState(Unknown Source)
>>>>>       at javax.swing.JTree.expandPath(Unknown Source)
>>>>>       at  
>>>>> javax.swing.plaf.basic.BasicTreeUI.toggleExpandState(Unknown
>>>>> Source)
>>>>>       at
>>>>> javax 
>>>>> .swing.plaf.basic.BasicTreeUI.handleExpandControlClick(Unknown
>>>>> Source)
>>>>>       at
>>>>> javax 
>>>>> .swing.plaf.basic.BasicTreeUI.checkForClickInExpandControl(Unknown
>>>>> Source)
>>>>>       at
>>>>> javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(Unknown
>>>>> Source)
>>>>>       at javax.swing.plaf.basic.BasicTreeUI 
>>>>> $Handler.mousePressed(Unknown
>>>>> Source)
>>>>>       at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
>>>>>       at java.awt.Component.processMouseEvent(Unknown Source)
>>>>>       at javax.swing.JComponent.processMouseEvent(Unknown Source)
>>>>>       at java.awt.Component.processEvent(Unknown Source)
>>>>>       at java.awt.Container.processEvent(Unknown Source)
>>>>>       at java.awt.Component.dispatchEventImpl(Unknown Source)
>>>>>       at java.awt.Container.dispatchEventImpl(Unknown Source)
>>>>>       at java.awt.Component.dispatchEvent(Unknown Source)
>>>>>       at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
>>>>> Source)
>>>>>       at java.awt.LightweightDispatcher.processMouseEvent(Unknown
>>>>> Source)
>>>>>       at java.awt.LightweightDispatcher.dispatchEvent(Unknown  
>>>>> Source)
>>>>>       at java.awt.Container.dispatchEventImpl(Unknown Source)
>>>>>       at java.awt.Window.dispatchEventImpl(Unknown Source)
>>>>>       at java.awt.Component.dispatchEvent(Unknown Source)
>>>>>       at java.awt.EventQueue.dispatchEvent(Unknown Source)
>>>>>       at  
>>>>> java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
>>>>> Source)
>>>>>       at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown
>>>>> Source)
>>>>>       at  
>>>>> java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
>>>>> Source)
>>>>>       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>>>>>       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>>>>>       at java.awt.EventDispatchThread.run(Unknown Source)
>>>>>
>>>>> Problematic rows of source code are following  
>>>>> (FresnelSesameParser,
>>>>> 701-707):
>>>>>
>>>>> while (ssi.hasNext()){
>>>>>  Statement s = ssi.next();
>>>>>  String pred = s.getPredicate().toString();
>>>>>  String content = ((Literal)s.getObject()).getLabel(); // this
>>>>> casting seems to be not allowed
>>>>>  if (pred.equals(Constants._contentAfter)){
>>>>>      cf.setContentAfter(content); //content must be literal
>>>>>  }
>>>>>  ....
>>>>>
>>>>> Thank for your time and help. Have a nice day.
>>>>>
>>>>> Best regards
>>>>>
>>>>>
>>>>> Miroslav Warchil
>>>>> Masaryk University, Brno
>>>>>
>>>>>
>>>>> On Tue, May 19, 2009 at 3:55 PM, Emmanuel Pietriga
>>>>> <emmanuel.pietriga at inria.fr> wrote:
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> Can you point the place in src code where this is happening in  
>>>>>> the
>>>>>> Sesame
>>>>>> module (give a stack trace)?
>>>>>>
>>>>>> thanks,
>>>>>> Emmanuel
>>>>>>
>>>>>> On 16 mai 09, at 19:37, Miroslav Warchil wrote:
>>>>>>
>>>>>>> Hello,
>>>>>>>
>>>>>>> I just want to mention one problem I've experienced. I'm using
>>>>>>> JFresnel
>>>>>>> 0.3.1 as a basis for editor application. It seems to me that  
>>>>>>> given
>>>>>>> version
>>>>>>> of JFresnel library doesn't handle Fresnel Format additional  
>>>>>>> contents
>>>>>>> (fresnel:contentBefore, fresnel:contentAfter, ...).
>>>>>>>
>>>>>>> I have imported following Fresnel Format definition to Sesame
>>>>>>> repository:
>>>>>>>
>>>>>>> :formatHomepage rdf:type fresnel:Format ;
>>>>>>>             fresnel:propertyFormatDomain foaf:homepage ;
>>>>>>>             fresnel:valueFormat [ fresnel:contentAfter ",
>>>>>>> "^^xsd:string
>>>>>>> ;
>>>>>>>                                   fresnel:contentLast  
>>>>>>> "."^^xsd:string
>>>>>>> ]
>>>>>>> ;
>>>>>>>             fresnel:valueStyle  
>>>>>>> "basicLabel"^^fresnel:styleClass .
>>>>>>>
>>>>>>>
>>>>>>> Then I've tried to build parse repository content using JFresnel
>>>>>>> library
>>>>>>> to build-up FresnelDocument (which should include Format object
>>>>>>> representing
>>>>>>> :foafHomepage format).
>>>>>>>
>>>>>>> The problem is that FresnelSesameParser implementation  
>>>>>>> probably parses
>>>>>>> incorrectly the BNode which holds information about additional
>>>>>>> contents.
>>>>>>> It
>>>>>>> presumes that all statements having this BNode as a subject  
>>>>>>> have ONLY
>>>>>>> Literal as the object. This not correct because in Sesame  
>>>>>>> repository
>>>>>>> BNodes
>>>>>>> have also property specifying that BNode is Resource. Example  
>>>>>>> is below
>>>>>>> (_:node14556h0uvx4 is the BNode).
>>>>>>>
>>>>>>> _:node14556h0uvx4 a rdfs:Resource .
>>>>>>>
>>>>>>> This results in ClassCastException on relevant rows in
>>>>>>> FresnelSesameParser. Could you please have a look it at if I am
>>>>>>> interpreting
>>>>>>> this issue in the right way? Thank you very much for any help.
>>>>>>>
>>>>>>> Best regards
>>>>>>>
>>>>>>> Miroslav Warchil
>>>>>>> Masaryk University, Brno
>>>>>>> _______________________________________________
>>>>>>> Jfresnel-devel mailing list
>>>>>>> Jfresnel-devel at lists.gforge.inria.fr
>>>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/jfresnel-devel
>>>>>>
>>>>>> --
>>>>>> Emmanuel Pietriga
>>>>>> INRIA Saclay - Projet In Situ    tel : +33 1 69 15 34 66
>>>>>> Bat 490, Université Paris-Sud    fax : +33 1 69 15 65 86
>>>>>> 91405 ORSAY Cedex FRANCE     http://www.lri.fr/~pietriga
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Jfresnel-devel mailing list
>>>>> Jfresnel-devel at lists.gforge.inria.fr
>>>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/jfresnel-devel
>>>>
>>>> --
>>>> Emmanuel Pietriga
>>>> INRIA Saclay - Projet In Situ    tel : +33 1 69 15 34 66
>>>> Bat 490, Université Paris-Sud    fax : +33 1 69 15 65 86
>>>> 91405 ORSAY Cedex FRANCE     http://www.lri.fr/~pietriga
>>>>
>>>>
>>>>
>>>>
>>
>> --
>> Emmanuel Pietriga
>> INRIA Saclay - Projet In Situ    tel : +33 1 69 15 34 66
>> Bat 490, Université Paris-Sud    fax : +33 1 69 15 65 86
>> 91405 ORSAY Cedex FRANCE     http://www.lri.fr/~pietriga
>>
>>
>>
>>

--
Emmanuel Pietriga
INRIA Saclay - Projet In Situ    tel : +33 1 69 15 34 66
Bat 490, Université Paris-Sud    fax : +33 1 69 15 65 86
91405 ORSAY Cedex FRANCE     http://www.lri.fr/~pietriga






More information about the Jfresnel-devel mailing list