gephi / gexf

GEXF Format Specifications
https://gexf.net/
Creative Commons Attribution 4.0 International
31 stars 6 forks source link

`xmllint` failed to compile XSD schema 1.3 #19

Closed ck3d closed 1 year ago

ck3d commented 1 year ago

I tried to validate a gexf file version 1.3 with xmllint version 21003 as described in the documentation, but I got following error:

$ touch test.gexf
$ xmllint -debugent -noout -schema http://gexf.net/1.3/gexf.xsd test.gexf
new input from file: http://gexf.net/1.3/gexf.xsd
new input from file: http://gexf.net/1.3/dynamics.xsd
new input from file: http://gexf.net/1.3/viz.xsd
http://gexf.net/1.3/gexf.xsd:22: element element: Schemas parser error : element decl. '{http://gexf.net/1.3}graph', attribute 'type': The QName value '{http://gexf.net/1.3}graph-content' does not resolve to a(n) type definition.
http://gexf.net/1.3/gexf.xsd:43: element element: Schemas parser error : element decl. '{http://gexf.net/1.3}node', attribute 'type': The QName value '{http://gexf.net/1.3}node-content' does not resolve to a(n) type definition.
http://gexf.net/1.3/gexf.xsd:51: element element: Schemas parser error : element decl. '{http://gexf.net/1.3}edge', attribute 'type': The QName value '{http://gexf.net/1.3}edge-content' does not resolve to a(n) type definition.
WXS schema http://gexf.net/1.3/gexf.xsd failed to compile
new input from file: test.gexf
test.gexf:1: parser error : Document is empty
sabroe commented 1 year ago

I have tried to compile the GEXF XML Schema with something else -- a newer JAXB 4 and have found errors which I all believe to be valid errors.

For GEXF 1.3, I get the very same errors in L22, L43, L51. From what I can read, the three elements refer to something not being a type (simpleType, complexType) and which can be seen directly by looking at the XML Schema. From what I can tell, the 1.3 format is not valid schema.

[ERROR] src-resolve: Cannot resolve the name 'ns1:graph-content' to a(n) 'type definition' component.
  line 22 of file:/C:/Project/Topp-Work/Topp-Xenomorph/Example/src/main/resources/xsd/Graph-Exchange-XML/1.3/XSD/gexf.xsd

[ERROR] src-resolve: Cannot resolve the name 'ns1:node-content' to a(n) 'type definition' component.
  line 43 of file:/C:/Project/Topp-Work/Topp-Xenomorph/Example/src/main/resources/xsd/Graph-Exchange-XML/1.3/XSD/gexf.xsd

[ERROR] src-resolve: Cannot resolve the name 'ns1:edge-content' to a(n) 'type definition' component.
  line 51 of file:/C:/Project/Topp-Work/Topp-Xenomorph/Example/src/main/resources/xsd/Graph-Exchange-XML/1.3/XSD/gexf.xsd

I have tried the same thing for the two previous versions:

[ERROR] undefined attribute group 'node-shape-content'
  line 39 of file:/C:/Project/Topp-Work/Topp-Xenomorph/Example/src/main/resources/xsd/Graph-Exchange-XML/1.1/XSD/data.xsd

[ERROR] undefined attribute group 'color-content'
  line 55 of file:/C:/Project/Topp-Work/Topp-Xenomorph/Example/src/main/resources/xsd/Graph-Exchange-XML/1.1/XSD/data.xsd

[ERROR] undefined attribute group 'position-content'
  line 60 of file:/C:/Project/Topp-Work/Topp-Xenomorph/Example/src/main/resources/xsd/Graph-Exchange-XML/1.1/XSD/data.xsd

[ERROR] undefined attribute group 'size-content'
  line 65 of file:/C:/Project/Topp-Work/Topp-Xenomorph/Example/src/main/resources/xsd/Graph-Exchange-XML/1.1/XSD/data.xsd

[ERROR] undefined attribute group 'edge-shape-content'
  line 78 of file:/C:/Project/Topp-Work/Topp-Xenomorph/Example/src/main/resources/xsd/Graph-Exchange-XML/1.1/XSD/data.xsd

[ERROR] undefined attribute group 'thickness-content'
  line 94 of file:/C:/Project/Topp-Work/Topp-Xenomorph/Example/src/main/resources/xsd/Graph-Exchange-XML/1.1/XSD/data.xsd

Sorry for not providing a complete context to reproduce this. For the 1.3 format, the errors seem to be quite obvious.

mbastian commented 1 year ago

Thanks for the report! I was able to reproduce it and fix it. The root cause was in my build.sh script that was calling trang for each RNC file. The correct way was to only call it for the gexf.rnc as it creates the other dynamics.xsd and viz.xsd automatically. By calling it for subsequent file it overwrites them but incorrectly.

Let me know if you still have issues validating.