|
|
Re: Fixing a Dangling Reference [message #421971 is a reply to message #421968] |
Tue, 19 August 2008 19:17 |
Geoffry Roberts Messages: 71 Registered: July 2009 |
Member |
|
|
Ed Merks wrote:
> Geoffry,
> Comments below.
> Geoffry Roberts wrote:
>> All,
>> All,
>>
>> I'm getting a dangling reference error when I attempt to save my
>> model. I know how to address this problem by recording, discarding,
>> etc.--no good. I need a fix so I can save everything.
>> The question is how do I write my xsd so the dangling is eliminated.
> It's not typically a problem with the model itself...
>>
>> I've included a fragment from my schema. In this, a given
>> DiseaseStage may occur in any number of Diseases hence the use of
>> xs:anyURI coupled with ecore:reference. I'm not using ecore:opposite
>> because I don't need bi-directionality. I do need to save the
>> DiseaseStages so discard and its ilk is not an option.
>>
>> Thanks in advance.
>>
>> <xs:complexType name="Disease">
>> <xs:sequence>
>> <xs:element name="title" type="xs:string"/>
>> <xs:element name="stages" type="xs:anyURI" maxOccurs="unbounded"
>> ecore:reference="DiseaseStage"/>
So, the above element as it is doesn't suffice as a container? If I were
to make it a global element would it suffice then? Disease, after all, is
a complexType. If i were to make the stages element of type DiseaseStage,
then I would not be able to have the same stages in multi Diseases. Are
we talking some kind of container within a container?
Thanks in advance.
>> <xs:element name="R0" type="xs:double"/>
>> </xs:sequence>
>> </xs:complexType>
>>
>> <xs:complexType name="DiseaseStage">
>> <xs:sequence>
>> <xs:element name="title" type="xs:string"/>
>> <xs:element name="population" type="xs:double"/>
>> </xs:complexType>
> Where is DiseaseStage itself contained? There will need to be some
> complex type with an element of this type, or a global element of this
> type, that will act as a container for the instances that the different
> Diseases all share.
|
|
|
Re: Fixing a Dangling Reference [message #421972 is a reply to message #421971] |
Tue, 19 August 2008 19:34 |
Ed Merks Messages: 33142 Registered: July 2009 |
Senior Member |
|
|
Geoffry,
Comments below.
Geoffry Roberts wrote:
> Ed Merks wrote:
>
>> Geoffry,
>
>> Comments below.
>
>> Geoffry Roberts wrote:
>>> All,
>>> All,
>>>
>>> I'm getting a dangling reference error when I attempt to save my
>>> model. I know how to address this problem by recording, discarding,
>>> etc.--no good. I need a fix so I can save everything. The question
>>> is how do I write my xsd so the dangling is eliminated.
>> It's not typically a problem with the model itself...
>>>
>>> I've included a fragment from my schema. In this, a given
>>> DiseaseStage may occur in any number of Diseases hence the use of
>>> xs:anyURI coupled with ecore:reference. I'm not using
>>> ecore:opposite because I don't need bi-directionality. I do need to
>>> save the DiseaseStages so discard and its ilk is not an option.
>>>
>>> Thanks in advance.
>>>
>>> <xs:complexType name="Disease">
>>> <xs:sequence>
>>> <xs:element name="title" type="xs:string"/>
>>> <xs:element name="stages" type="xs:anyURI"
>>> maxOccurs="unbounded" ecore:reference="DiseaseStage"/>
>
> So, the above element as it is doesn't suffice as a container?
You've explicitly made it not be a containment reference and if it were
a containment reference, you'd not be able to share DiseaseStage
instances across Diseases. So you can't have your cake and eat it to.
> If I were to make it a global element would it suffice then?
You need an element of type DiseaseStage, either a global one or one in
some other complex type so that a DiseaseStage can either be in the root
of some other resource or be contained by some other object in already
in resource.
> Disease, after all, is a complexType.
Yes, but it doesn't have a containment reference to allow it to act as a
container.
> If i were to make the stages element of type DiseaseStage, then I
> would not be able to have the same stages in multi Diseases. Are we
> talking some kind of container within a container?
Perhaps the thing that contains the Diseases out to also have an element
to contains the DiseaseStages. Just think of how similar what you want
to do is to the Library model where the Library contains the Books and
the Writers....
>
> Thanks in advance.
>
>>> <xs:element name="R0" type="xs:double"/>
>>> </xs:sequence>
>>> </xs:complexType>
>>>
>>> <xs:complexType name="DiseaseStage">
>>> <xs:sequence>
>>> <xs:element name="title" type="xs:string"/>
>>> <xs:element name="population" type="xs:double"/>
>>> </xs:complexType>
>> Where is DiseaseStage itself contained? There will need to be some
>> complex type with an element of this type, or a global element of
>> this type, that will act as a container for the instances that the
>> different Diseases all share.
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03412 seconds