nl-utwente-groove / code

GROOVE code base
https://groove.cs.utwente.nl
4 stars 0 forks source link

failed import/export of graphs in GXL format #421

Open rensink opened 10 years ago

rensink commented 10 years ago

Hello, I constantly fail to import graph in GXL format. My initial aim was to import in groove graphs created and saved in gxl using AGG. The following error shows up :

groove.io.external.PortException: groove.io.conceptual.lang.ImportException: javax.xml.bind.UnmarshalException: unexpected element (uri:"", local:"gxl"). Expected elements are <{http://www.gupro.de/GXL/gxl-1.0.dtd}attr>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}attributedElement>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}bag>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}bool>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}compositeValue>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}edge>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}enum>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}float>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}freeType>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}graph>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}graphElement>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}gxl>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}int>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}localConnection>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}locator>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}node>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}rel>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}relend>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}seq>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}set>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}string>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}tup>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}type>,<{http://www.gupro.de/GXL/gxl-1.0.dtd}typedElement>

As a first resolution attempt, I manually added the xml namespace "http://www.gupro.de/GXL/gxl-1.0.dtd" in the gxl file. When trying to import, the config dialog box pops, but nothing happens after acceptation.

To test on an example "guaranteed to be well formed" I tried to import the example provided in http://www.gupro.de/GXL/examples/schema/gxl/simpleExample/content.html. It throws :

java.io.IOException: groove.io.external.PortException: groove.io.conceptual.lang.ImportException: javax.xml.bind.UnmarshalException

  • with linked exception: [org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.] groove.io.external.Importers.doImport(Importers.java:67) groove.gui.action.ImportAction.execute(ImportAction.java:22) groove.gui.action.SimulatorAction.actionPerformed(SimulatorAction.java:231) javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) javax.swing.AbstractButton.doClick(AbstractButton.java:357) javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809) javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850) java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272) java.awt.Component.processMouseEvent(Component.java:6288) javax.swing.JComponent.processMouseEvent(JComponent.java:3267) java.awt.Component.processEvent(Component.java:6053) java.awt.Container.processEvent(Container.java:2041) java.awt.Component.dispatchEventImpl(Component.java:4651) java.awt.Container.dispatchEventImpl(Container.java:2099) java.awt.Component.dispatchEvent(Component.java:4481) java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577) java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) java.awt.Container.dispatchEventImpl(Container.java:2085) java.awt.Window.dispatchEventImpl(Window.java:2478) java.awt.Component.dispatchEvent(Component.java:4481) java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643) java.awt.EventQueue.access$000(EventQueue.java:84) java.awt.EventQueue$1.run(EventQueue.java:602) java.awt.EventQueue$1.run(EventQueue.java:600) java.security.AccessController.doPrivileged(Native Method) java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98) java.awt.EventQueue$2.run(EventQueue.java:616) java.awt.EventQueue$2.run(EventQueue.java:614) java.security.AccessController.doPrivileged(Native Method) java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) java.awt.EventQueue.dispatchEvent(EventQueue.java:613) java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Finally, I tried to export an instance graph created in groove to GXL in order to compare the xml files. I keep getting :

groove.io.conceptual.lang.ImportException: Unable to translate graphs, some type information is missing

I'm unsure to post in the right place, but any help would be much welcomed. Is there in particular any user manual detailing the procedure to import/export (I couldn't find any details on these operations)?

Kind regards, Cédric Eichler

Reported by: ceichler

rensink commented 10 years ago

This is definitely the right place.

Unfortunately, the GXL import is not very stable, as you noticed.

If you explicitly provide the namespace in the gxl tag of your .gxl, as in

<gxl xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.gupro.de/GXL/gxl-1.0.dtd">

then you will get a little bit further. Unfortunately, I do not count myself as xml expert, I do not know how to make the unmarshaller understand that this is supposed to be the default namespace.

The only documentation I can offer is the MSc thesis in which all this is described: see http://fmt.cs.utwente.nl/files/sprojects/142.pdf

Original comment by: rensink

rensink commented 10 years ago

Thank you for the quick response and for the documentation.

Considering the initial issue, as mentioned I already tried to manually add the namespace in the gxl. When trying to import the updated xml file in groove's simulator, no more error occur and the "config dialog" pop. However, when clicking on "ok", nothing happen and the graph does not seem to be, in fact, imported.

When importing and before the appearance of the "config dialog", the following messages are printed in the terminal used to launch the simulator :

JAXFront Property URL:jar:file:"path"/groove-4_9_3/lib/jaxfront/jaxfront-core.jar!/jaxfront.xml init properties from:jar:file:"path"/groove-4_9_3/lib/jaxfront/jaxfront-core.jar!/jaxfront.xml Initialize JAXFront Property: jaxfront.language.country value: [CH] Initialize JAXFront Property: jaxfront.handleOnlySpacesAsNull value: [false] Initialize JAXFront Property: jaxfront.useEmbeddedNLS value: [false] Initialize JAXFront Property: jaxfront.ignoreNameSpace value: [false] Initialize JAXFront Property: jaxfront.date.pattern value: [dd.MM.yyyy, yyyy/MM/dd, dd.MM.yyyy, dd.MM.yyyy] Initialize JAXFront Property: jaxfront.dateTime.pattern value: [dd.MM.yyyy hh:mm:ss, yyyy/MM/dd HH:mm:ss, dd.MM.yyyy hh:mm:ss, dd.MM.yyyy hh:mm:ss] Initialize JAXFront Property: jaxfront.time.pattern value: [hh:mm:ss, HH:mm:ss, hh:mm:ss, hh:mm:ss] Initialize JAXFront Property: jaxfront.askForExit value: [true] Initialize JAXFront Property: jaxfront.bindOnlyAvailable value: [false] Initialize JAXFront Property: jaxfront.systemExit value: [true] Initialize JAXFront Property: jaxfront.serialize.xsdURLRelative value: [true] Initialize JAXFront Property: jaxfront.ui.useGlobalUIDefinitions value: [true] Initialize JAXFront Property: jaxfront.jndiMailLookup value: [] Initialize JAXFront Property: jaxfront.directory.location value: [http://localhost:8080/jaxfront-appserver/directory/] Initialize JAXFront Property: jaxfront.directory.location.offline value: [directory/] Initialize JAXFront Property: jaxfront.directory.xsd value: [directory.xsd] Initialize JAXFront Property: jaxfront.treeFolderFont value: [sansserif,bold] Initialize JAXFront Property: jaxfront.titleBorderFont value: [sansserif,bold] Initialize JAXFront Property: jaxfront.captionFont value: [sansserif,bold] Initialize JAXFront Property: xuiEditor.lookAndFeel value: [com.jgoodies.looks.plastic.PlasticXPLookAndFeel] Initialize JAXFront Property: jaxfront.defaultXMLFileEncoding value: [UTF-8] Initialize JAXFront Property: jaxfront.ui.useXUINameLookup value: [false] Initialize JAXFront Property: jaxfront.ui.useXUICache value: [true] Initialize JAXFront Property: jaxfront.ui.useXSDCache value: [true] Initialize JAXFront Property: jaxfront.useEditingTypeCache value: [true] Initialize JAXFront Property: jaxfront.defaultFileEncoding value: [UTF-8] Initialize JAXFront Property: jaxfront.useNLS value: [true] Initialize JAXFront Property: jaxfront.languages value: [de, fr, it, en] Initialize JAXFront Property: jaxfront.language value: [en] Initialize JAXFront Property: jaxfront.uiFactory value: [com.jaxfront.swing.ui.visualizers.JavaSwingFactory] Initialize JAXFront Property: xuiEditor.xui value: [xui.xui] Initialize JAXFront Property: xuieditor.sortXUIDefinitions value: [true] Initialize JAXFront Property: xuiEditor.schema value: [xui.xsd] Initialize JAXFront Property: xuiEditor.root value: [XUI] Initialize JAXFront Property: jaxfront.propertyFile value: [jaxfront-properties-$version.xml] Initialize JAXFront Property: jaxfront.html.location value: [http://localhost:8080/jaxfront/JAXFrontServlet?app=jaxfront&action=loadjaxfront] Initialize JAXFront Property: jaxfront.html.useMDI value: [false] Initialize JAXFront Property: jaxfront.html.useXSDControllerLookup value: [true] Initialize JAXFront Property: jaxfront.html.styleName value: [style/default/css/jaxfront.css] Initialize JAXFront Property: jaxfront.lastFileCounter value: [10] Initialize JAXFront Property: jaxfront.functionsFile value: [config/functions.xml] Initialize JAXFront Property: xuiEditor.expertMode value: [true] Initialize JAXFront Property: jaxfront.messageTableCellRenderer value: [com.jaxfront.swing.ui.tools.MessageTableCellRenderer] Initialize JAXFront Property: com.jaxfront.swing.ui.visualizers.PagingView value: [com.jaxfront.swing.ui.visualizers.PagingView] Initialize JAXFront Property: jaxfront.logTool value: [Log4J] Initialize JAXFront Property: jaxfront.html.controller value: [] Initialize JAXFront Property: jaxfront.html.popUpAction value: [com.jaxfront.html.action.DefaultPopUpAction] Initialize JAXFront Property: jaxfront.html.popUpAnchorAction value: [com.jaxfront.html.action.DefaultPopUpAnchorAction] Initialize JAXFront Property: jaxfront.urlbase value: [] Initialize JAXFront Property: xuiEditor.tree.showInstanceData value: [true] Initialize JAXFront Property: jaxfront.license.location value: [] Initialize JAXFront Property: jaxfront.urlResolver value: [com.jaxfront.core.util.DefaultURLResourceResolver] Initialize JAXFront Property: jaxfront.log.enabled value: [true] Initialize JAXFront Property: jaxfront.log.level value: [error] Initialize JAXFront Property: jaxfront.useOptimizedXPathEngine value: [true]

Original comment by: ceichler

rensink commented 10 years ago

Yes, I now see your initial remark that you tried this. Sorry for overlooking that.

There are two other issues that prevent this from working:

If you manually include the instance graph into the file with the type definition, and manually remove all those spaces, then in fact you will get an imported graph that looks reasonable to me.

The dialog in principle allows you to tune the way the gxl graphs are represented in GROOVE. Unfortunately it pops up all the time, and it spews out all those messages on stdout. This is actually due to the library used to create the dialog (jaxfront).

It's all far from ideal, I'm afraid; and I do not have time to improve the situation at the moment. Still, I'm curious to know if you get anything at all now, and if there are other small things I can help with, I'm ready to try.

Yours, Arend

Original comment by: rensink

rensink commented 10 years ago

My bad, quoting errors within the text dilute the message.

After removing spaces in type names, 'dummy' example files containing both type and instance graphs did successfully load.

However, when trying to import files created through AGG's export function (after taking care of spacenames and spaces), the error reported in post scriptum occurs. Even though I am not 100% sure, I reckon that AGG's export is error free, so that the issue may indeed come from groove. I'm afraid I'll have to postpone my groove's usage due to approaching deadlines. Provided that your are interested, I'll come back to you if I come up with a satisfying and clean solution regarding exchanges of graphs from AGG to groove.

Thx for your time and help, Cheers, Cédric

xception in GROOVE java.lang.NullPointerException at groove.io.conceptual.lang.gxl.GxlUtil.getElemType(GxlUtil.java:268) at groove.io.conceptual.lang.gxl.GxlToType.(GxlToType.java:117) at groove.io.external.format.GxlPorter.importTypeModel(GxlPorter.java:45) at groove.io.external.ConceptualPorter.doImport(ConceptualPorter.java:73) at groove.io.external.Importers.doChosenImport(Importers.java:78) at groove.io.external.Importers.doImport(Importers.java:65) at groove.gui.action.ImportAction.execute(ImportAction.java:22) at groove.gui.action.SimulatorAction.actionPerformed(SimulatorAction.java:231) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.AbstractButton.doClick(AbstractButton.java:357) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272) at java.awt.Component.processMouseEvent(Component.java:6288) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6053) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4651) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4481) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4481) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643) at java.awt.EventQueue.access$000(EventQueue.java:84) at java.awt.EventQueue$1.run(EventQueue.java:602) at java.awt.EventQueue$1.run(EventQueue.java:600) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98) at java.awt.EventQueue$2.run(EventQueue.java:616) at java.awt.EventQueue$2.run(EventQueue.java:614) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:613) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Original comment by: ceichler

rensink commented 10 years ago

If you attach the graph, I can look into it. Offhand I'd agree that the likelihood of errors in (this part of) GROOVE is larger than for AGG. --Arend

Original comment by: rensink

rensink commented 10 years ago

Enclosed is the concerned graph, titled "example.gxl".

By the way,to know groove's accepted syntax, I wanted to export something created in groove to gxl (see attachment, "attributedGrammar.gps"). While exporting the type graph works fine, trying to export the start graph raises the following error :

Exception in GROOVE java.lang.ClassCastException: de.gupro.gxl.gxl_1_0.NodeType cannot be cast to javax.xml.bind.JAXBElement at groove.io.conceptual.lang.gxl.InstanceToGxl.visit(InstanceToGxl.java:227) at groove.io.conceptual.value.ContainerValue.doVisit(ContainerValue.java:27) at groove.io.conceptual.lang.InstanceExporter.getElement(InstanceExporter.java:85) at groove.io.conceptual.lang.InstanceExporter.getElement(InstanceExporter.java:80) at groove.io.conceptual.lang.gxl.InstanceToGxl.visit(InstanceToGxl.java:114) at groove.io.conceptual.value.Object.doVisit(Object.java:96) at groove.io.conceptual.lang.InstanceExporter.getElement(InstanceExporter.java:85) at groove.io.conceptual.lang.InstanceExporter.getElement(InstanceExporter.java:80) at groove.io.conceptual.lang.gxl.InstanceToGxl.visit(InstanceToGxl.java:227) at groove.io.conceptual.value.ContainerValue.doVisit(ContainerValue.java:27) at groove.io.conceptual.lang.InstanceExporter.getElement(InstanceExporter.java:85) at groove.io.conceptual.lang.InstanceExporter.getElement(InstanceExporter.java:80) at groove.io.conceptual.lang.gxl.InstanceToGxl.visit(InstanceToGxl.java:114) at groove.io.conceptual.value.Object.doVisit(Object.java:96) at groove.io.conceptual.lang.InstanceExporter.getElement(InstanceExporter.java:85) at groove.io.conceptual.lang.InstanceExporter.getElement(InstanceExporter.java:80) at groove.io.conceptual.lang.gxl.InstanceToGxl.visit(InstanceToGxl.java:227) at groove.io.conceptual.value.ContainerValue.doVisit(ContainerValue.java:27) at groove.io.conceptual.lang.InstanceExporter.getElement(InstanceExporter.java:85) at groove.io.conceptual.lang.InstanceExporter.getElement(InstanceExporter.java:80) at groove.io.conceptual.lang.gxl.InstanceToGxl.visit(InstanceToGxl.java:114) at groove.io.conceptual.value.Object.doVisit(Object.java:96) at groove.io.conceptual.lang.InstanceExporter.getElement(InstanceExporter.java:85) at groove.io.conceptual.lang.InstanceExporter.getElement(InstanceExporter.java:80) at groove.io.conceptual.lang.InstanceExporter.visitInstanceModel(InstanceExporter.java:107) at groove.io.conceptual.lang.gxl.InstanceToGxl.addInstanceModel(InstanceToGxl.java:82) at groove.io.external.format.GxlPorter.getResource(GxlPorter.java:71) at groove.io.external.ConceptualPorter.doExport(ConceptualPorter.java:152) at groove.io.external.Exporters.doExport(Exporters.java:83) at groove.gui.action.ExportAction.execute(ExportAction.java:65) at groove.gui.action.SimulatorAction.actionPerformed(SimulatorAction.java:231) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.AbstractButton.doClick(AbstractButton.java:357) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272) at java.awt.Component.processMouseEvent(Component.java:6288) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6053) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4651) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Component.dispatchEvent(Component.java:4481) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4577) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168) at java.awt.Container.dispatchEventImpl(Container.java:2085) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4481) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:643) at java.awt.EventQueue.access$000(EventQueue.java:84) at java.awt.EventQueue$1.run(EventQueue.java:602) at java.awt.EventQueue$1.run(EventQueue.java:600) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98) at java.awt.EventQueue$2.run(EventQueue.java:616) at java.awt.EventQueue$2.run(EventQueue.java:614) at java.security.AccessController.doPrivileged(Native Method) at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87) at java.awt.EventQueue.dispatchEvent(EventQueue.java:613) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Original comment by: ceichler

rensink commented 10 years ago

Forgot groove's grammar that fail to export

Original comment by: ceichler