Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [EMF Compare] URI Similarity?
[EMF Compare] URI Similarity? [message #491491] Wed, 14 October 2009 18:51 Go to next message
Stephen McCants is currently offline Stephen McCantsFriend
Messages: 92
Registered: July 2009
Member
Hello,
I'm running into a problem where the diff engine is thinking that two of my references are the same
because they have similar (but different URIs). I'm working on overriding that behavior by creating
my own diff engine, so how to "fix" the problem is not my question.
Instead, I'm wondering why similar, but different URIs would ever be considered the same? It seems
to me that if the path in the URI is different, than the URI is different. The only place I can
think of that you could have differences that don't matter is in the server name (authority?)
portion. But I spend most of my time thinking about URIs that are HTTP URLs.
Are there some case I'm not considering here?
Thanks.

--Stephen
Re: [EMF Compare] URI Similarity? [message #491586 is a reply to message #491491] Thu, 15 October 2009 07:45 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1892
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010102090708060100060307
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi Stephen,

There are two places where we compare URIs within EMF Compare, and in
both two different URIs does not always mean different Objects.

The first of these two places is when we try to match resources together
within a given resource set. These URIs can take a number of shapes :
platform scheme URIs, file scheme URIs, ... http urls are in fact the
rarest. We consider two such URIs "similar" even when they are "not
equal" as the very same model could have been moved from one directory
to the other between the two versions. AFAIU, HTTP scheme URIs can have
a segment differing for the same cause : changed directory on the server.

The second place where we compare URIs is when trying to match two nodes
contained in two distinct models... and the very same as above : the
node could have changed parent ... and be the same anyway.

Let's take a class diagram as an example, named "model1.ecore". We have
a package "p1" in it containing a class "ClassA". The URI of this class
would be either :
file:/<path>/model1.ecore#//p1/ClassA
platform:/resource/<path>/model1.ecore#//p1.ClassA
platform:/plugin/<path>/model1.ecore#//p1.ClassA
http://server/<path>/model1.ecore#//p1.ClassA
.... you catch the drift.

now what if we change the name of our package to "package"? And at the
same time let's say we moved the model to the directory "models". URIs
are now :
file:/<path>/models/model1.ecore#//package/ClassA
....

So when comparing the URIs, we simply cannot assume that distinct URIs
_always_ point to objects that don't match, whether we're comparing the
URI itself or the fragment.

If I didn't understand the question, feel free to correct me; but I
can't think of another place we compare URIs within EMF Compare ;).

Laurent Goubet
Obeo

Stephen McCants a
Re: [EMF Compare] URI Similarity? [message #491807 is a reply to message #491586] Thu, 15 October 2009 22:24 Go to previous messageGo to next message
Stephen McCants is currently offline Stephen McCantsFriend
Messages: 92
Registered: July 2009
Member
Hi Laurent,
Thanks for the explanation. That makes sense. If it becomes a problem in my specific cases, then
I can always override/extend the DiffEngine. It was giving me trouble because my unit tests have
artificially simple URIs that usually differ by one character (for example
file:///tmp/testobject1.xml). By making my URIs more distinct, I can work around it and continue to
test against the GenericDiffEngine.
Also, on a different note, thank you for getting those three fixes committed to HEAD yesterday!

--Stephen

laurent Goubet wrote:
> Hi Stephen,
>
> There are two places where we compare URIs within EMF Compare, and in
> both two different URIs does not always mean different Objects.
>
> The first of these two places is when we try to match resources together
> within a given resource set. These URIs can take a number of shapes :
> platform scheme URIs, file scheme URIs, ... http urls are in fact the
> rarest. We consider two such URIs "similar" even when they are "not
> equal" as the very same model could have been moved from one directory
> to the other between the two versions. AFAIU, HTTP scheme URIs can have
> a segment differing for the same cause : changed directory on the server.
>
> The second place where we compare URIs is when trying to match two nodes
> contained in two distinct models... and the very same as above : the
> node could have changed parent ... and be the same anyway.
>
> Let's take a class diagram as an example, named "model1.ecore". We have
> a package "p1" in it containing a class "ClassA". The URI of this class
> would be either :
> file:/<path>/model1.ecore#//p1/ClassA
> platform:/resource/<path>/model1.ecore#//p1.ClassA
> platform:/plugin/<path>/model1.ecore#//p1.ClassA
> http://server/<path>/model1.ecore#//p1.ClassA
> ... you catch the drift.
>
> now what if we change the name of our package to "package"? And at the
> same time let's say we moved the model to the directory "models". URIs
> are now :
> file:/<path>/models/model1.ecore#//package/ClassA
> ...
>
> So when comparing the URIs, we simply cannot assume that distinct URIs
> _always_ point to objects that don't match, whether we're comparing the
> URI itself or the fragment.
>
> If I didn't understand the question, feel free to correct me; but I
> can't think of another place we compare URIs within EMF Compare ;).
>
> Laurent Goubet
> Obeo
>
> Stephen McCants a écrit :
>> Hello,
>> I'm running into a problem where the diff engine is thinking that
>> two of my references are the same because they have similar (but
>> different URIs). I'm working on overriding that behavior by creating
>> my own diff engine, so how to "fix" the problem is not my question.
>> Instead, I'm wondering why similar, but different URIs would ever
>> be considered the same? It seems to me that if the path in the URI is
>> different, than the URI is different. The only place I can think of
>> that you could have differences that don't matter is in the server
>> name (authority?) portion. But I spend most of my time thinking about
>> URIs that are HTTP URLs.
>> Are there some case I'm not considering here?
>> Thanks.
>>
>> --Stephen
>
Re: [EMF Compare] URI Similarity? [message #491843 is a reply to message #491807] Fri, 16 October 2009 07:14 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1892
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000401080207070206070407
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi Stephen,

Comments inlined.

Laurent Goubet
Obeo

Stephen McCants a
Re: [EMF Compare] URI Similarity? [message #621477 is a reply to message #491491] Thu, 15 October 2009 07:45 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1892
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010102090708060100060307
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi Stephen,

There are two places where we compare URIs within EMF Compare, and in
both two different URIs does not always mean different Objects.

The first of these two places is when we try to match resources together
within a given resource set. These URIs can take a number of shapes :
platform scheme URIs, file scheme URIs, ... http urls are in fact the
rarest. We consider two such URIs "similar" even when they are "not
equal" as the very same model could have been moved from one directory
to the other between the two versions. AFAIU, HTTP scheme URIs can have
a segment differing for the same cause : changed directory on the server.

The second place where we compare URIs is when trying to match two nodes
contained in two distinct models... and the very same as above : the
node could have changed parent ... and be the same anyway.

Let's take a class diagram as an example, named "model1.ecore". We have
a package "p1" in it containing a class "ClassA". The URI of this class
would be either :
file:/<path>/model1.ecore#//p1/ClassA
platform:/resource/<path>/model1.ecore#//p1.ClassA
platform:/plugin/<path>/model1.ecore#//p1.ClassA
http://server/<path>/model1.ecore#//p1.ClassA
.... you catch the drift.

now what if we change the name of our package to "package"? And at the
same time let's say we moved the model to the directory "models". URIs
are now :
file:/<path>/models/model1.ecore#//package/ClassA
....

So when comparing the URIs, we simply cannot assume that distinct URIs
_always_ point to objects that don't match, whether we're comparing the
URI itself or the fragment.

If I didn't understand the question, feel free to correct me; but I
can't think of another place we compare URIs within EMF Compare ;).

Laurent Goubet
Obeo

Stephen McCants a
Re: [EMF Compare] URI Similarity? [message #621485 is a reply to message #491586] Thu, 15 October 2009 22:25 Go to previous message
Stephen McCants is currently offline Stephen McCantsFriend
Messages: 92
Registered: July 2009
Member
Hi Laurent,
Thanks for the explanation. That makes sense. If it becomes a problem in my specific cases, then
I can always override/extend the DiffEngine. It was giving me trouble because my unit tests have
artificially simple URIs that usually differ by one character (for example
file:///tmp/testobject1.xml). By making my URIs more distinct, I can work around it and continue to
test against the GenericDiffEngine.
Also, on a different note, thank you for getting those three fixes committed to HEAD yesterday!

--Stephen

laurent Goubet wrote:
> Hi Stephen,
>
> There are two places where we compare URIs within EMF Compare, and in
> both two different URIs does not always mean different Objects.
>
> The first of these two places is when we try to match resources together
> within a given resource set. These URIs can take a number of shapes :
> platform scheme URIs, file scheme URIs, ... http urls are in fact the
> rarest. We consider two such URIs "similar" even when they are "not
> equal" as the very same model could have been moved from one directory
> to the other between the two versions. AFAIU, HTTP scheme URIs can have
> a segment differing for the same cause : changed directory on the server.
>
> The second place where we compare URIs is when trying to match two nodes
> contained in two distinct models... and the very same as above : the
> node could have changed parent ... and be the same anyway.
>
> Let's take a class diagram as an example, named "model1.ecore". We have
> a package "p1" in it containing a class "ClassA". The URI of this class
> would be either :
> file:/<path>/model1.ecore#//p1/ClassA
> platform:/resource/<path>/model1.ecore#//p1.ClassA
> platform:/plugin/<path>/model1.ecore#//p1.ClassA
> http://server/<path>/model1.ecore#//p1.ClassA
> ... you catch the drift.
>
> now what if we change the name of our package to "package"? And at the
> same time let's say we moved the model to the directory "models". URIs
> are now :
> file:/<path>/models/model1.ecore#//package/ClassA
> ...
>
> So when comparing the URIs, we simply cannot assume that distinct URIs
> _always_ point to objects that don't match, whether we're comparing the
> URI itself or the fragment.
>
> If I didn't understand the question, feel free to correct me; but I
> can't think of another place we compare URIs within EMF Compare ;).
>
> Laurent Goubet
> Obeo
>
> Stephen McCants a écrit :
>> Hello,
>> I'm running into a problem where the diff engine is thinking that
>> two of my references are the same because they have similar (but
>> different URIs). I'm working on overriding that behavior by creating
>> my own diff engine, so how to "fix" the problem is not my question.
>> Instead, I'm wondering why similar, but different URIs would ever
>> be considered the same? It seems to me that if the path in the URI is
>> different, than the URI is different. The only place I can think of
>> that you could have differences that don't matter is in the server
>> name (authority?) portion. But I spend most of my time thinking about
>> URIs that are HTTP URLs.
>> Are there some case I'm not considering here?
>> Thanks.
>>
>> --Stephen
>
Re: [EMF Compare] URI Similarity? [message #621488 is a reply to message #621485] Fri, 16 October 2009 07:14 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1892
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------000401080207070206070407
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Hi Stephen,

Comments inlined.

Laurent Goubet
Obeo

Stephen McCants a
Previous Topic:[EcoreTools] Multiple packages
Next Topic:[EMF Compare] Getting started
Goto Forum:
  


Current Time: Sun Jun 13 11:00:37 GMT 2021

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

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

Back to the top