Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Fragment-based URIs
Fragment-based URIs [message #426657] Fri, 16 January 2009 14:00 Go to next message
Eclipse UserFriend
Originally posted by: ali.akar.geensys.com

Hi all,

As I understand, the format of an EMF URI is
SCHEME://AUTHORITY/SEGMENT/SEGMENT...#FRAGMENT?QUERY, so I'm asking if
URIs without segments(and authority), like SCHEME:#FRAGMENT?QUERY, still
valid from an EMF point of view ?? and if
org.eclipse.emf.common.util.URI.parseIntoURI(String) method supports the
proposed URI format ??

Thanks in advance,
Ali
Re: Fragment-based URIs [message #426660 is a reply to message #426657] Fri, 16 January 2009 14:17 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33141
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------010507070702040402020504
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Ali,

URIs are structured as follows. Note the placement of the query.

..A URI typically consists of /-separated components
--[scheme:][//authority][/path][?query][#fragment]
--E.g.,
.. http://www.eclipse.org/modeling/emf/?project=emf#related
.. file://c:/workspace/project/file.extension#id
.. platform:/resource/project/file.extension#id

The parts are accessible like this:

public final class URI

{

public boolean isHierarchical();

public String scheme();

public String authority();

public String[] segments();

public String path();

public String query();

public String fragment();

// ...

}

If you're going to have more than one resource, you really are going to
need something more than just a scheme before the #.



Ali Akar wrote:
> Hi all,
>
> As I understand, the format of an EMF URI is
> SCHEME://AUTHORITY/SEGMENT/SEGMENT...#FRAGMENT?QUERY, so I'm asking if
> URIs without segments(and authority), like SCHEME:#FRAGMENT?QUERY,
> still valid from an EMF point of view ?? and if
> org.eclipse.emf.common.util.URI.parseIntoURI(String) method supports the
> proposed URI format ??
>
> Thanks in advance,
> Ali

--------------010507070702040402020504
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Ali,<br>
<br>
URIs are structured as follows.&nbsp; Note the placement of the query.<br>
<br>
<div
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 0.38in; text-indent: -0.38in;"><span
style="font-size: 28pt;"><span style="">&#8226;</span></span><span
style="font-size: 28pt; font-family: Corbel;">A URI typically consists
of /-separated components</span></div>
<div class="O1"
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 0.81in; text-indent: -0.31in;"><span
style="font-size: 24pt;"><span style="">&#8211;</span></span><span
style="font-size: 24pt; font-family: Corbel;">[</span><span
style="font-size: 24pt; font-family: Corbel; color: rgb(192, 80, 77);">scheme:</span><span
style="font-size: 24pt; font-family: Corbel;">][</span><span
style="font-size: 24pt; font-family: Corbel; color: rgb(128, 100, 162);">//authority</span><span
style="font-size: 24pt; font-family: Corbel;">][</span><span
style="font-size: 24pt; font-family: Corbel; color: rgb(31, 73, 125);">/path</span><span
style="font-size: 24pt; font-family: Corbel;">][</span><span
style="font-size: 24pt; font-family: Corbel; color: rgb(228, 108, 10);">?query</span><span
style="font-size: 24pt; font-family: Corbel;">][</span><span
style="font-size: 24pt; font-family: Corbel; color: rgb(119, 147, 60);">#fragment</span><span
style="font-size: 24pt; font-family: Corbel;">]</span></div>
<div class="O1"
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 0.81in; text-indent: -0.31in;"><span
style="font-size: 24pt;"><span style="">&#8211;</span></span><span
style="font-size: 24pt; font-family: Corbel;">E.g.,</span></div>
<div class="O2"
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 1.25in; text-indent: -0.25in;"><span
style="font-size: 20pt;"><span style="">&#8226;</span></span><span
style="font-size: 20pt; font-family: Corbel; color: black;"> </span><span
style="font-size: 20pt; font-family: Corbel; color: rgb(192, 80, 77);">http:</span><span
style="font-size: 20pt; font-family: Corbel; color: rgb(128, 100, 162);">//www.eclipse.org</span><span
style="font-size: 20pt; font-family: Corbel; color: rgb(31, 73, 125);">/modeling/emf/</span><span
style="font-size: 20pt; font-family: Corbel; color: rgb(228, 108, 10);">?project=emf</span><span
style="font-size: 20pt; font-family: Corbel; color: rgb(119, 147, 60);">#related</span></div>
<div class="O2"
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 1.25in; text-indent: -0.25in;"><span
style="font-size: 20pt;"><span style="">&#8226;</span></span><span
style="font-size: 20pt; font-family: Corbel; color: black;"> </span><span
style="font-size: 20pt; font-family: Corbel; color: rgb(192, 80, 77);">file:</span><span
style="font-size: 20pt; font-family: Corbel; color: rgb(128, 100, 162);">//c</span><span
style="font-size: 20pt; font-family: Corbel; color: rgb(31, 73, 125);">:/workspace/project/file.extension</span><span
style="font-size: 20pt; font-family: Corbel; color: rgb(119, 147, 60);">#id</span></div>
<div class="O2"
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 1.25in; text-indent: -0.25in;"><span
style="font-size: 20pt;"><span style="">&#8226;</span></span><span
style="font-size: 20pt; font-family: Corbel; color: black;"> </span><span
style="font-size: 20pt; font-family: Corbel; color: rgb(192, 80, 77);">platform:</span><span
style="font-size: 20pt; font-family: Corbel; color: rgb(31, 73, 125);">/resource/project/</span><span
style="font-size: 20pt; font-family: Corbel; color: rgb(31, 73, 125);">file.extension</span><span
style="font-size: 20pt; font-family: Corbel; color: rgb(119, 147, 60);">#id</span><span
style="font-size: 20pt; font-family: Corbel; color: black;">
</span></div>
<br>
The parts are accessible like this:<span
style="font-size: 14pt; font-family: Consolas; color: black;"><br>
</span>
<blockquote><span
style="font-size: 14pt; font-family: Consolas; color: black;">public
final class URI</span>
<p
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-align: left; direction: ltr; unicode-bidi: embed;"><span
style="font-size: 10.5pt; font-family: Consolas; color: black;">{</span></p>
<p
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-align: left; direction: ltr; unicode-bidi: embed;"><span
style="font-size: 14pt; font-family: Consolas; color: black;"><span
style="">&nbsp; </span>public </span><span
style="font-size: 14pt; font-family: Consolas; color: black;">boolean</span><span
style="font-size: 14pt; font-family: Consolas; color: black;"> </span><span
style="font-size: 14pt; font-family: Consolas; color: black; font-weight: bold;">isHierarchical</span><span
style="font-size: 14pt; font-family: Consolas; color: black;">();</span></p>
<p
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-align: left; direction: ltr; unicode-bidi: embed;"><span
style="font-size: 14pt; font-family: Consolas; color: black;"><span
style="">&nbsp; </span>public String </span><span
style="font-size: 14pt; font-family: Consolas; color: rgb(192, 80, 77); font-weight: bold;">scheme</span><span
style="font-size: 14pt; font-family: Consolas; color: black;">();</span></p>
<p
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-align: left; direction: ltr; unicode-bidi: embed;"><span
style="font-size: 14pt; font-family: Consolas; color: black;"><span
style="">&nbsp; </span>public String </span><span
style="font-size: 14pt; font-family: Consolas; color: rgb(128, 100, 162); font-weight: bold;">authority</span><span
style="font-size: 14pt; font-family: Consolas; color: black;">();</span></p>
<p
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-align: left; direction: ltr; unicode-bidi: embed;"><span
style="font-size: 14pt; font-family: Consolas; color: black;"><span
style="">&nbsp; </span>public String[] </span><span
style="font-size: 14pt; font-family: Consolas; color: rgb(31, 73, 125); font-weight: bold;">segments</span><span
style="font-size: 14pt; font-family: Consolas; color: black;">();</span></p>
<p
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-align: left; direction: ltr; unicode-bidi: embed;"><span
style="font-size: 14pt; font-family: Consolas; color: black;"><span
style="">&nbsp; </span>public String </span><span
style="font-size: 14pt; font-family: Consolas; color: rgb(31, 73, 125); font-weight: bold;">path</span><span
style="font-size: 14pt; font-family: Consolas; color: black;">();</span></p>
<p
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-align: left; direction: ltr; unicode-bidi: embed;"><span
style="font-size: 14pt; font-family: Consolas; color: black;"><span
style="">&nbsp; </span>public String </span><span
style="font-size: 14pt; font-family: Consolas; color: rgb(228, 108, 10); font-weight: bold;">query</span><span
style="font-size: 14pt; font-family: Consolas; color: black;">();</span></p>
<p
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-align: left; direction: ltr; unicode-bidi: embed;"><span
style="font-size: 14pt; font-family: Consolas; color: black;"><span
style="">&nbsp; </span>public String </span><span
style="font-size: 14pt; font-family: Consolas; color: rgb(119, 147, 60); font-weight: bold;">fragment</span><span
style="font-size: 14pt; font-family: Consolas; color: black;">();</span></p>
<p
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-align: left; direction: ltr; unicode-bidi: embed;"><span
style="font-size: 10.5pt; font-family: Consolas; color: black;"><span
style="">&nbsp; </span>// ...</span></p>
<p
style="margin-top: 0pt; margin-bottom: 0pt; margin-left: 0in; text-align: left; direction: ltr; unicode-bidi: embed;"><span
style="font-size: 10.5pt; font-family: Consolas; color: black;">}</span><span
style="font-size: 10.5pt; font-family: Consolas; color: black;">
</span></p>
</blockquote>
If you're going to have more than one resource, you really are going to
need something&nbsp; more than just a scheme before the #.<br>
<br>
<br>
<br>
Ali Akar wrote:
<blockquote cite="mid:gkq3uj$3mt$1@build.eclipse.org" type="cite">Hi
all,
<br>
<br>
As I understand, the format of an EMF URI is
SCHEME://AUTHORITY/SEGMENT/SEGMENT...#FRAGMENT?QUERY, so I'm asking if
URIs without segments(and authority), like SCHEME:#FRAGMENT?QUERY,
still valid from an EMF point of view ?? and if
org.eclipse.emf.common.util.URI.parseIntoURI(String) method supports
the
<br>
proposed URI format ??
<br>
<br>
Thanks in advance,
<br>
Ali
<br>
</blockquote>
</body>
</html>

--------------010507070702040402020504--


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[Edit] Fail to create image for a URL thru EMFPlugin.java
Next Topic:[Teneo] ObjectDeletedException even though no deletion?
Goto Forum:
  


Current Time: Thu Apr 25 23:00:49 GMT 2024

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

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

Back to the top