Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Is nsURI for Pivot Package elements mandatory?
Is nsURI for Pivot Package elements mandatory? [message #1268402] Mon, 10 March 2014 13:05 Go to next message
Felix Dorner is currently offline Felix Dorner
Messages: 261
Registered: March 2012
Senior Member
Hi,

As opposed to UML/Ecore, our concept of 'Package' doesn't have an nsURI
attribute. I transform our Package elements into Pivot Package elements,
but don't set the nsURI attribute. Now I have assertion errors in the
packageserver.assertSamePackage.

Just to test, I generate a random uri for each pivot package and the
errors go away. I still need to look deeper at the code to try finding
out what the manager is all about...

Is nsURI a mandatory attribute? If so, are there any assumptions on how
these uris look like? (E.g. hierarchical, with package names as segments).



Thanks,
Felix
Re: Is nsURI for Pivot Package elements mandatory? [message #1268411 is a reply to message #1268402] Mon, 10 March 2014 13:18 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4115
Registered: July 2009
Senior Member
HI

UML used to have no URIs which required Tag fudges. UML does now have URIs.

Ecore has always had URIs that you could omit until you get an NPE in
genmodel.

OCL (the pivot prototype for OCL 2.5) uses URIs as the mechanism to
determine when Complete OCL packages are merged or not; same URI, same
logical Package. The URI is just an identifier so any character sequence
should do. Conventionally, as with java packages you should avoid
clashes with other users by following a hierarchical scope such as

http://www.soyatec.com/...

in the hope that non-soyatec.com applications will not use soyatec.com
prefixes. How you allocate names within the soyatec.com namespace is for
you and your IT to decide.

Regards

Ed Willink





On 10/03/2014 13:05, Felix Dorner wrote:
> Hi,
>
> As opposed to UML/Ecore, our concept of 'Package' doesn't have an
> nsURI attribute. I transform our Package elements into Pivot Package
> elements, but don't set the nsURI attribute. Now I have assertion
> errors in the packageserver.assertSamePackage.
>
> Just to test, I generate a random uri for each pivot package and the
> errors go away. I still need to look deeper at the code to try finding
> out what the manager is all about...
>
> Is nsURI a mandatory attribute? If so, are there any assumptions on
> how these uris look like? (E.g. hierarchical, with package names as
> segments).
>
>
>
> Thanks,
> Felix
Re: Is nsURI for Pivot Package elements mandatory? [message #1268420 is a reply to message #1268411] Mon, 10 March 2014 13:28 Go to previous messageGo to next message
Felix Dorner is currently offline Felix Dorner
Messages: 261
Registered: March 2012
Senior Member
I just tested with UML and null URIs. I found no assertion errors until
I make a Package that contains another Package with the same name.
Select the package in the console and the assertion error pops.
Re: Is nsURI for Pivot Package elements mandatory? [message #1269238 is a reply to message #1268402] Tue, 11 March 2014 15:20 Go to previous messageGo to next message
Felix Dorner is currently offline Felix Dorner
Messages: 261
Registered: March 2012
Senior Member
Hi,

On 10/03/2014 14:05, Felix Dorner wrote:

> As opposed to UML/Ecore, our concept of 'Package' doesn't have an nsURI
> attribute. I transform our Package elements into Pivot Package elements,
> but don't set the nsURI attribute. Now I have assertion errors in the
> packageserver.assertSamePackage.

I now generate an URI string for all packages in the model, but I think
I found something fishy:

In CompleteOCLCSContainmentVisitor.refreshContextPackage(), the name of
the Pivot package is taken literally from the name of the CSPackage,
lines 274:276. If the CSPackage name is an escaped id (_'package'), the
parent PackageServer doesn't find it in the packageServers map (since
that uses the _unescaped_ name as the key), and tries to register a new
NestedPackageServer for the same package (same as in 'same URI'), which
triggers the AssertionError.

Is there a helper to unescape the package name? Should I report a bug?

Felix
Re: Is nsURI for Pivot Package elements mandatory? [message #1269250 is a reply to message #1269238] Tue, 11 March 2014 15:38 Go to previous messageGo to next message
Ed Willink is currently offline Ed Willink
Messages: 4115
Registered: July 2009
Senior Member
Hi

The name escaping should occur between the Complete OCL source text and
the CS model, where arbitrary character sequences are permitted as
names. The only exception is legacy support for simple underscore
prefixes where double lookups are sometimes performed.

See
org.eclipse.ocl.examples.xtext.essentialocl.services.EssentialOCLValueConverterService$AbstractIDConverter.

If you have a bug please raise a Bugzilla with a repro.

Regards

Ed Willink

On 11/03/2014 15:20, Felix Dorner wrote:
> Hi,
>
> On 10/03/2014 14:05, Felix Dorner wrote:
>
>> As opposed to UML/Ecore, our concept of 'Package' doesn't have an nsURI
>> attribute. I transform our Package elements into Pivot Package elements,
>> but don't set the nsURI attribute. Now I have assertion errors in the
>> packageserver.assertSamePackage.
>
> I now generate an URI string for all packages in the model, but I
> think I found something fishy:
>
> In CompleteOCLCSContainmentVisitor.refreshContextPackage(), the name
> of the Pivot package is taken literally from the name of the
> CSPackage, lines 274:276. If the CSPackage name is an escaped id
> (_'package'), the parent PackageServer doesn't find it in the
> packageServers map (since that uses the _unescaped_ name as the key),
> and tries to register a new NestedPackageServer for the same package
> (same as in 'same URI'), which triggers the AssertionError.
>
> Is there a helper to unescape the package name? Should I report a bug?
>
> Felix
>
Re: Is nsURI for Pivot Package elements mandatory? [message #1269295 is a reply to message #1269250] Tue, 11 March 2014 17:05 Go to previous message
Felix Dorner is currently offline Felix Dorner
Messages: 261
Registered: March 2012
Senior Member
https://bugs.eclipse.org/bugs/show_bug.cgi?id=430122
Previous Topic:Complete OCL file used for GMF validation
Next Topic:qualified association returns object instead of collection
Goto Forum:
  


Current Time: Fri Oct 31 21:35:47 GMT 2014

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

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