Skip to main content



      Home
Home » Modeling » TMF (Xtext) » URI serialization
URI serialization [message #758672] Thu, 24 November 2011 03:01 Go to next message
Eclipse UserFriend
Hi

Is there an elegant way to serialize a URI reference from one semantic
object to another?

The problem is that a compact serialization should deresolve a monstrous
absolute URI such as
'file:/C:/GIT/org.eclipse.ocl/tests/org.eclipse.ocl.examples.xtext.tests/bin/org/eclipse/ocl/examples/test/xtext/models/Fruit.uml#_kFEgAJaZEdunUqiNpqprXQ'
with respect to the prevailing semantic context, but the semantic
context is not available in the ValueConverter.

Resolving the problem in a derived CrossReferenceSerializer can work,
but breaks the modularity of the new serializer whereby all
rule-specific serialization is in the corresponding ValueConverter.

Perhaps the ValueConverter API needs revisiting to support invocation
context and decorated qualified names (Bug 361577).

Regards

Ed Willink
Re: URI serialization [message #758706 is a reply to message #758672] Thu, 24 November 2011 05:39 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ed,

did you try to do this via scoping?

When the ScopeProvider is invoked it gets handed in the proper context.
The returned scope would have to create an EObjectDescription for the
referenced object in IScope.getSingleElement(EObject). The
EObjectDescription's QualifiedName could be the referenced Object's
shortened (relative) file name. You could create QualifiedNames with
just one segment or treat each segment of the path as a segment of the
QualifiedName.

regards,
Moritz

On 24.11.11 09:01, Ed Willink wrote:
> Hi
>
> Is there an elegant way to serialize a URI reference from one semantic
> object to another?
>
> The problem is that a compact serialization should deresolve a monstrous
> absolute URI such as
> 'file:/C:/GIT/org.eclipse.ocl/tests/org.eclipse.ocl.examples.xtext.tests/bin/org/eclipse/ocl/examples/test/xtext/models/Fruit.uml#_kFEgAJaZEdunUqiNpqprXQ'
> with respect to the prevailing semantic context, but the semantic
> context is not available in the ValueConverter.
>
> Resolving the problem in a derived CrossReferenceSerializer can work,
> but breaks the modularity of the new serializer whereby all
> rule-specific serialization is in the corresponding ValueConverter.
>
> Perhaps the ValueConverter API needs revisiting to support invocation
> context and decorated qualified names (Bug 361577).
>
> Regards
>
> Ed Willink
Re: URI serialization [message #758841 is a reply to message #758706] Thu, 24 November 2011 11:57 Go to previous message
Eclipse UserFriend
Hi Moritz

Yes, I thought of that just after posting the message, but I'm not sure
that it's valid.

The Scope services provide results for a variety of clients, so the full
description is appropriate. It doesn't seem right to optimize the return
for a particular client. I'll look again, maybe the client can be passed
through the scope calls to induce client-specific descriptions.

Regards

Ed Willink


On 24/11/2011 10:39, Moritz Eysholdt wrote:
> Hi Ed,
>
> did you try to do this via scoping?
>
> When the ScopeProvider is invoked it gets handed in the proper
> context. The returned scope would have to create an EObjectDescription
> for the referenced object in IScope.getSingleElement(EObject). The
> EObjectDescription's QualifiedName could be the referenced Object's
> shortened (relative) file name. You could create QualifiedNames with
> just one segment or treat each segment of the path as a segment of the
> QualifiedName.
>
> regards,
> Moritz
>
> On 24.11.11 09:01, Ed Willink wrote:
>> Hi
>>
>> Is there an elegant way to serialize a URI reference from one semantic
>> object to another?
>>
>> The problem is that a compact serialization should deresolve a monstrous
>> absolute URI such as
>> 'file:/C:/GIT/org.eclipse.ocl/tests/org.eclipse.ocl.examples.xtext.tests/bin/org/eclipse/ocl/examples/test/xtext/models/Fruit.uml#_kFEgAJaZEdunUqiNpqprXQ'
>>
>> with respect to the prevailing semantic context, but the semantic
>> context is not available in the ValueConverter.
>>
>> Resolving the problem in a derived CrossReferenceSerializer can work,
>> but breaks the modularity of the new serializer whereby all
>> rule-specific serialization is in the corresponding ValueConverter.
>>
>> Perhaps the ValueConverter API needs revisiting to support invocation
>> context and decorated qualified names (Bug 361577).
>>
>> Regards
>>
>> Ed Willink
>
Previous Topic:Complete example Custom Validator Test?
Next Topic:Use/migrate grammar of ANTLR3 in xtext, is possible?
Goto Forum:
  


Current Time: Wed Jul 23 19:34:39 EDT 2025

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

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

Back to the top