Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Modeling problem(I have a modeling problem on a SpreadSheet MetaModel)
Modeling problem [message #661118] Wed, 23 March 2011 09:19 Go to next message
Antoine  is currently offline Antoine Friend
Messages: 22
Registered: February 2011
Location: Toulouse, France
Junior Member
Hello everyone !

What I'm doing: I create a Metamodel to represent concepts use in a spreadsheet file (excel, calc or anything else...). I want to have the possibility to import a spreadsheet file as a model and the opposite : create a model and export it as an spreadsheet file.

Explanation of the MetaModel: My modeling is very simple (as you can see on the joined image) : we have a Spreadsheet which contained Sheet(s), which contained Line(s), which contained DataCell(s)...
I introduce a mechanism that I need : HeaderCell. A Sheet has HeaderCell(s) which are Cell(s) (typically the first line of the Sheet but nevermind) and a DataCell can refer to an HeaderCell. For example: a column represent Dates, the first cell contained the string "Date" so this cell is a HeaderCell and each DataCell of the column refer to this HeaderCell, like this I know from a DataCell what content I will found on it (in terms of semantics more than in syntactic).

The problem: a DataCell can refer to a HeaderCell which are not on the same Sheet. I know that I can make an OCL rule to check this but I want to know if there is a modeling solution to do this. Because for the moment, if I create a Spredsheet model with the generated EMF Editor, the text result is this (no CODE tag to have color...):
<?xml version="1.0" encoding="UTF-8"?>
<spreadsheet:Spreadsheet xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:spreadsheet="spreadsheet" name="Main">

___<containedSheets name="Sheet1">
______<containedHeaders content="Name" headerId="1"/>
______<containedLines num="1">
_________<containedCells content="FOO" relatedHeader="1"/>
______</containedLines>
___</containedSheets>
___<containedSheets name="Sheet2">
______<containedHeaders content="Identifier" headerId="1"/>
______<containedLines num="1">
_________<containedCells content="FIFOO" relatedHeader="1"/>
______</containedLines>
___</containedSheets>
</spreadsheet:Spreadsheet>

The reference on the HeaderCell is ambiguous, and in reality when I load my model, the Cell "FIFOO" refer to the HeaderCell "Name" in the first Sheet...

The MetaModel:
http://imagik.fr/uploads/389689

Thank you for answering !

Antoine

[Updated on: Wed, 23 March 2011 09:20]

Report message to a moderator

Re: Modeling problem [message #661222 is a reply to message #661118] Wed, 23 March 2011 15:37 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30544
Registered: July 2009
Senior Member
Antoine,

Comments below.

Antoine wrote:
> Hello everyone !
>
> What I'm doing: I create a Metamodel to represent concepts use in a
> spreadsheet file (excel, calc or anything else...). I want to have the
> possibility to import a spreadsheet file as a model and the opposite :
> create a model and export it as an spreadsheet file.
>
> Explanation of the MetaModel: My modeling is very simple (as you can
> see on the joined image)
No images...
> : we have a Spreadsheet which contained Sheet(s), which contained
> Line(s), which contained DataCell(s)...
> I introduce a mechanism that I need : HeaderCell. A Sheet has
> HeaderCell(s) which are Cell(s) (typically the first line of the Sheet
> but nevermind) and a DataCell can refer to an HeaderCell. For example:
> a column represent Dates, the first cell contained the string date
> "Date" so this cell is a HeaderCell and each DataCell of the column
> refer to this HeaderCell, like this I know from a DataCell what
> content I will found on it (in terms of semantics more than in
> syntactic).
>
> The problem: a DataCell can refer to a HeaderCell which are not on the
> same Sheet. I know that I can make an OCL rule to check this but I
> want to know if there is a modeling solution to do this.
No.
> Because for the moment, if I create a Spredsheet model with the
> generated EMF Editor, the text result is this (no CODE tag to have
> color...):
> <?xml version="1.0" encoding="UTF-8"?>
> <spreadsheet:Spreadsheet xmi:version="2.0"
> xmlns:xmi="http://www.omg.org/XMI" xmlns:spreadsheet="spreadsheet"
> name="Main">
> ___<containedSheets name="Sheet1">
> ______<containedHeaders content="Name" headerId="1"/>
> ______<containedLines num="1">
> _________<containedCells content="FOO" relatedHeader="1"/>
> ______</containedLines>
> ___</containedSheets>
> ___<containedSheets name="Sheet2">
> ______<containedHeaders content="Identifier" headerId="1"/>
> ______<containedLines num="1">
> _________<containedCells content="FIFOO" relatedHeader="1"/>
> ______</containedLines>
> ___</containedSheets>
> </spreadsheet:Spreadsheet>
>
> The reference on the HeaderCell is ambiguous, and in reality when I
> load my model, the Cell "FIFOO" refer to the HeaderCell "Name" in the
> first Sheet...
You can't have more than one object with the same ID in the same resource.
>
> The MetaModel:
>
>
> Thank you for answering !
>
> Antoine
Previous Topic:UML Tree View in BIRT Report
Next Topic:[EMF] ID-IDREF resolution
Goto Forum:
  


Current Time: Tue Oct 15 11:45:28 GMT 2019

Powered by FUDForum. Page generated in 0.01844 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top