- From: Aleksander Bartnikiewicz <aleksander@bartnikiewi.cz>
- Date: Sat, 8 Jun 2013 01:10:23 +0200
- To: public-rif-dev@w3.org
- Message-ID: <CAGGpewyyhYJVqmt4FdOO3kHrFzam_E1Ea=-2FyCb+1NTVkq9YA@mail.gmail.com>
Hi,
I'm not sure if this is the right list to write my issue. But as long as it
associates with developing I thought public-rif-dev would be appropriate.
Have anyone tried to generate java classes from RIF-PRD xml schema [1]?
When I try to do it I fail with the unique particle attribution rule [2]
violated. Here is what xjc (the JAXB binding compiler) says to me:
-----
> \>xjc .\PRD.xsd -d .
> parsing a schema...
> [ERROR] cos-nonambig: "http://www.w3.org/2007/rif#":Const and "
> http://www.w3.org/2007/rif#":Const (or elements from their substitution
> group) violate "Unique Particle Attribution". During validation against
> this schema, ambiguity would be created for those two particles.
> line 567 of file:/D:/(...)/PRD.xsd
> Failed to parse a schema.
----
My solution to that is changing Retract element definition.
In original schema we have (lines 567-578):
<xs:complexType>
<xs:choice>
<xs:element ref="Atom"/>
<xs:element ref="Frame"/>
<xs:group ref="TERM"/>
<xs:sequence>
<xs:group ref="TERM"/>
<xs:group ref="TERM"/>
</xs:sequence>
</xs:choice>
<xs:attribute name="ordered" type="xs:string"
fixed="yes"/>
</xs:complexType>
My proposition of changing schema:
<xs:complexType>
<xs:choice>
<xs:element ref="Atom"/>
<xs:element ref="Frame"/>
<xs:group ref="TERM" minOccurs="1" maxOccurs="2"/>
</xs:choice>
<xs:attribute name="ordered" type="xs:string"
fixed="yes"/>
</xs:complexType>
Second version works fine and I think means the same.
What do you think? Does the fix look good for you?
Cheers,
Aleksander Bartnikiewicz
----
[1] - http://www.w3.org/2010/rif-schema/prd/PRD.xsd
[2] - http://en.wikipedia.org/wiki/Unique_Particle_Attribution
Received on Saturday, 8 June 2013 01:26:48 UTC