You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Klevenz, Stephan" <st...@sap.com> on 2014/05/26 12:14:55 UTC

4.0: references in edm

Hi,

I have implemented a first integration test [1] using the client code to read service document and metadata from the server side implementation. It works pretty cool except one issue.

The metadata contains a reference uri and during deserialization this link is requested and results in an exception due to incomplete proxy settings. Well, I can correct my proxy settings of course but want also to ask if there is a way to configure client not to follow links in metadata?

Regards,
Stephan

<edmx:Edmx Version="4.0">
  <Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/cs02/vocabularies/Org.OData.Core.V1.xml">
    <Include Namespace="Org.OData.Core.V1" Alias="Core"/>
  </Reference>
<edmx:DataServices>

[1] https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=tree;f=fit/src/test/java/org/apache/olingo/fit/tecsvc;h=dadbedfacccbb63e0575c5112e91d21d41a6ae9e;hb=olingo-266-tecsvc


Re: 4.0: references in edm

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 26/05/2014 16:43, Klevenz, Stephan wrote:
>> Well, it's hard to me to figure out a "very large" document to include
>> via reference, anyway...
> Well, use case is the way vice versa. Large metadata can be partitioned
> into smaller documents.

I know, I was wondering about how "large" can be effectively large. 
Anyway as said it sounds like a nice improvement, as said.

> At server side we deal with same difficulty with implementation. So first
> we focus on API to keep it stable independent from concrete EDM provider
> implementation.
>
>
> I can solve the proxy issue for the integration tests. I found the
> HttpClientFactory where I can load proxy settings more flexible from the
> environment.

Nice to hear :-)

Regards.

> We can keep this in the back. I am currently working on a more flexible
> proxy detection for integration tests.
>
> On 26.05.14 16:28, "Francesco Chicchiriccò" <il...@apache.org> wrote:
>
>> On 26/05/2014 14:00, Klevenz, Stephan wrote:
>>> Hi Francesco,
>>>
>>> What do you think about to resolve references lazy? That would allow to
>>> know top level resources without following the reference. Types are
>>> qualified and and referenced documents can be resolved only if needed.
>> Lazy resolution could be a nice enhancement but not straightforward to
>> implement: EdmClientImpl would need to generate metadata requests
>> "on-demand", e.g. only when accessing an element whose namespace wasn't
>> fetched yet.
>>
>>> Otherwise documents could be very large in case of each reference is
>>> resolved directly.
>> Well, it's hard to me to figure out a "very large" document to include
>> via reference, anyway...
>>
>>> I think an option not to follow references makes no sense. You are right
>>> at the end the document will be incomplete.
>>>
>>> Regards,
>>> Stephan
>>>
>>> On 26.05.14 12:44, "Francesco Chicchiriccò" <il...@apache.org> wrote:
>>>
>>>> On 26/05/2014 12:14, Klevenz, Stephan wrote:
>>>>> Hi,
>>>>>
>>>>> I have implemented a first integration test [1] using the client code
>>>>> to read service document and metadata from the server side
>>>>> implementation. It works pretty cool except one issue.
>>>>>
>>>>> The metadata contains a reference uri and during deserialization this
>>>>> link is requested and results in an exception due to incomplete proxy
>>>>> settings. Well, I can correct my proxy settings of course but want
>>>>> also
>>>>> to ask if there is a way to configure client not to follow links in
>>>>> metadata?
>>>> Hi Stephan,
>>>> there is currently no such option, but it could be done by:
>>>>
>>>> 1. adding setFollowEdmReferences(boolean) / isFollowEmdReferences() to
>>>> V4's Configuration [2]
>>>>
>>>> 2. checking Configuration#isFollowEdmReferences() before processing
>>>> external references in XMLMetadataRequestImpl#execute [3]
>>>>
>>>> Anyway, I am actually not sure it would be correct: after all, an Edm
>>>> document that declares external reference(s) is likely to have some
>>>> unresolved elements in it, if client is not following the external
>>>> references.
>>>>
>>>> WDYT?
>>>>
>>>> Regards.
>>>>
>>>>> <edmx:Edmx Version="4.0">
>>>>>      <Reference
>>>>>
>>>>> Uri="http://docs.oasis-open.org/odata/odata/v4.0/cs02/vocabularies/Org.
>>>>> OD
>>>>> ata.Core.V1.xml">
>>>>>        <Include Namespace="Org.OData.Core.V1" Alias="Core"/>
>>>>>      </Reference>
>>>>> <edmx:DataServices>
>>>>>
>>>>> [1]
>>>>>
>>>>> https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=tree;f=fi
>>>>> t/
>>>>>
>>>>> src/test/java/org/apache/olingo/fit/tecsvc;h=dadbedfacccbb63e0575c5112e
>>>>> 91
>>>>> d21d41a6ae9e;hb=olingo-266-tecsvc
>>>> [2]
>>>>
>>>> https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=blob;f=lib
>>>> /c
>>>>
>>>> lient-api/src/main/java/org/apache/olingo/client/api/v4/Configuration.ja
>>>> va
>>>> [3]
>>>>
>>>> https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=blob;f=lib
>>>> /c
>>>>
>>>> lient-core/src/main/java/org/apache/olingo/client/core/communication/req
>>>> ue
>>>> st/retrieve/v4/XMLMetadataRequestImpl.java

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/


Re: 4.0: references in edm

Posted by "Klevenz, Stephan" <st...@sap.com>.
> Well, it's hard to me to figure out a "very large" document to include
> via reference, anyway...

Well, use case is the way vice versa. Large metadata can be partitioned
into smaller documents.


At server side we deal with same difficulty with implementation. So first
we focus on API to keep it stable independent from concrete EDM provider
implementation.


I can solve the proxy issue for the integration tests. I found the
HttpClientFactory where I can load proxy settings more flexible from the
environment.

Regards,
Stephan
  

We can keep this in the back. I am currently working on a more flexible
proxy detection for integration tests.

On 26.05.14 16:28, "Francesco Chicchiriccò" <il...@apache.org> wrote:

>On 26/05/2014 14:00, Klevenz, Stephan wrote:
>> Hi Francesco,
>>
>> What do you think about to resolve references lazy? That would allow to
>> know top level resources without following the reference. Types are
>> qualified and and referenced documents can be resolved only if needed.
>
>Lazy resolution could be a nice enhancement but not straightforward to
>implement: EdmClientImpl would need to generate metadata requests
>"on-demand", e.g. only when accessing an element whose namespace wasn't
>fetched yet.
>
>> Otherwise documents could be very large in case of each reference is
>> resolved directly.
>
>Well, it's hard to me to figure out a "very large" document to include
>via reference, anyway...
>
>> I think an option not to follow references makes no sense. You are right
>> at the end the document will be incomplete.
>>
>> Regards,
>> Stephan
>>
>> On 26.05.14 12:44, "Francesco Chicchiriccò" <il...@apache.org> wrote:
>>
>>> On 26/05/2014 12:14, Klevenz, Stephan wrote:
>>>> Hi,
>>>>
>>>> I have implemented a first integration test [1] using the client code
>>>> to read service document and metadata from the server side
>>>> implementation. It works pretty cool except one issue.
>>>>
>>>> The metadata contains a reference uri and during deserialization this
>>>> link is requested and results in an exception due to incomplete proxy
>>>> settings. Well, I can correct my proxy settings of course but want
>>>>also
>>>> to ask if there is a way to configure client not to follow links in
>>>> metadata?
>>> Hi Stephan,
>>> there is currently no such option, but it could be done by:
>>>
>>> 1. adding setFollowEdmReferences(boolean) / isFollowEmdReferences() to
>>> V4's Configuration [2]
>>>
>>> 2. checking Configuration#isFollowEdmReferences() before processing
>>> external references in XMLMetadataRequestImpl#execute [3]
>>>
>>> Anyway, I am actually not sure it would be correct: after all, an Edm
>>> document that declares external reference(s) is likely to have some
>>> unresolved elements in it, if client is not following the external
>>> references.
>>>
>>> WDYT?
>>>
>>> Regards.
>>>
>>>> <edmx:Edmx Version="4.0">
>>>>     <Reference
>>>> 
>>>>Uri="http://docs.oasis-open.org/odata/odata/v4.0/cs02/vocabularies/Org.
>>>>OD
>>>> ata.Core.V1.xml">
>>>>       <Include Namespace="Org.OData.Core.V1" Alias="Core"/>
>>>>     </Reference>
>>>> <edmx:DataServices>
>>>>
>>>> [1]
>>>> 
>>>>https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=tree;f=fi
>>>>t/
>>>> 
>>>>src/test/java/org/apache/olingo/fit/tecsvc;h=dadbedfacccbb63e0575c5112e
>>>>91
>>>> d21d41a6ae9e;hb=olingo-266-tecsvc
>>> [2]
>>> 
>>>https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=blob;f=lib
>>>/c
>>> 
>>>lient-api/src/main/java/org/apache/olingo/client/api/v4/Configuration.ja
>>>va
>>> [3]
>>> 
>>>https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=blob;f=lib
>>>/c
>>> 
>>>lient-core/src/main/java/org/apache/olingo/client/core/communication/req
>>>ue
>>> st/retrieve/v4/XMLMetadataRequestImpl.java
>
>-- 
>Francesco Chicchiriccò
>
>Tirasa - Open Source Excellence
>http://www.tirasa.net/
>
>Involved at The Apache Software Foundation:
>member, Syncope PMC chair, Cocoon PMC, Olingo PMC
>http://people.apache.org/~ilgrosso/
>


RE: 4.0: references in edm

Posted by "Handl, Ralf" <ra...@sap.com>.
We're targeting conceptual models with thousands of entity types. This is definitely beyond a single metadata document, and also beyond "read all metadata up-front".

So we will partition this conceptual model into hundreds of services, each with dozens of entity types, and dozens of references to "neighboring" services.

Thus the need for lazy loading of referenced metadata documents.

-----Original Message-----
From: Francesco Chicchiriccò [mailto:ilgrosso@apache.org] 
Sent: Monday, 26. May 2014 16:28
To: dev@olingo.apache.org
Subject: Re: 4.0: references in edm

On 26/05/2014 14:00, Klevenz, Stephan wrote:
> Hi Francesco,
>
> What do you think about to resolve references lazy? That would allow to
> know top level resources without following the reference. Types are
> qualified and and referenced documents can be resolved only if needed.

Lazy resolution could be a nice enhancement but not straightforward to 
implement: EdmClientImpl would need to generate metadata requests 
"on-demand", e.g. only when accessing an element whose namespace wasn't 
fetched yet.

> Otherwise documents could be very large in case of each reference is
> resolved directly.

Well, it's hard to me to figure out a "very large" document to include 
via reference, anyway...

> I think an option not to follow references makes no sense. You are right
> at the end the document will be incomplete.
>
> Regards,
> Stephan
>
> On 26.05.14 12:44, "Francesco Chicchiriccò" <il...@apache.org> wrote:
>
>> On 26/05/2014 12:14, Klevenz, Stephan wrote:
>>> Hi,
>>>
>>> I have implemented a first integration test [1] using the client code
>>> to read service document and metadata from the server side
>>> implementation. It works pretty cool except one issue.
>>>
>>> The metadata contains a reference uri and during deserialization this
>>> link is requested and results in an exception due to incomplete proxy
>>> settings. Well, I can correct my proxy settings of course but want also
>>> to ask if there is a way to configure client not to follow links in
>>> metadata?
>> Hi Stephan,
>> there is currently no such option, but it could be done by:
>>
>> 1. adding setFollowEdmReferences(boolean) / isFollowEmdReferences() to
>> V4's Configuration [2]
>>
>> 2. checking Configuration#isFollowEdmReferences() before processing
>> external references in XMLMetadataRequestImpl#execute [3]
>>
>> Anyway, I am actually not sure it would be correct: after all, an Edm
>> document that declares external reference(s) is likely to have some
>> unresolved elements in it, if client is not following the external
>> references.
>>
>> WDYT?
>>
>> Regards.
>>
>>> <edmx:Edmx Version="4.0">
>>>     <Reference
>>> Uri="http://docs.oasis-open.org/odata/odata/v4.0/cs02/vocabularies/Org.OD
>>> ata.Core.V1.xml">
>>>       <Include Namespace="Org.OData.Core.V1" Alias="Core"/>
>>>     </Reference>
>>> <edmx:DataServices>
>>>
>>> [1]
>>> https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=tree;f=fit/
>>> src/test/java/org/apache/olingo/fit/tecsvc;h=dadbedfacccbb63e0575c5112e91
>>> d21d41a6ae9e;hb=olingo-266-tecsvc
>> [2]
>> https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=blob;f=lib/c
>> lient-api/src/main/java/org/apache/olingo/client/api/v4/Configuration.java
>> [3]
>> https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=blob;f=lib/c
>> lient-core/src/main/java/org/apache/olingo/client/core/communication/reque
>> st/retrieve/v4/XMLMetadataRequestImpl.java

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/


Re: 4.0: references in edm

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 26/05/2014 14:00, Klevenz, Stephan wrote:
> Hi Francesco,
>
> What do you think about to resolve references lazy? That would allow to
> know top level resources without following the reference. Types are
> qualified and and referenced documents can be resolved only if needed.

Lazy resolution could be a nice enhancement but not straightforward to 
implement: EdmClientImpl would need to generate metadata requests 
"on-demand", e.g. only when accessing an element whose namespace wasn't 
fetched yet.

> Otherwise documents could be very large in case of each reference is
> resolved directly.

Well, it's hard to me to figure out a "very large" document to include 
via reference, anyway...

> I think an option not to follow references makes no sense. You are right
> at the end the document will be incomplete.
>
> Regards,
> Stephan
>
> On 26.05.14 12:44, "Francesco Chicchiriccò" <il...@apache.org> wrote:
>
>> On 26/05/2014 12:14, Klevenz, Stephan wrote:
>>> Hi,
>>>
>>> I have implemented a first integration test [1] using the client code
>>> to read service document and metadata from the server side
>>> implementation. It works pretty cool except one issue.
>>>
>>> The metadata contains a reference uri and during deserialization this
>>> link is requested and results in an exception due to incomplete proxy
>>> settings. Well, I can correct my proxy settings of course but want also
>>> to ask if there is a way to configure client not to follow links in
>>> metadata?
>> Hi Stephan,
>> there is currently no such option, but it could be done by:
>>
>> 1. adding setFollowEdmReferences(boolean) / isFollowEmdReferences() to
>> V4's Configuration [2]
>>
>> 2. checking Configuration#isFollowEdmReferences() before processing
>> external references in XMLMetadataRequestImpl#execute [3]
>>
>> Anyway, I am actually not sure it would be correct: after all, an Edm
>> document that declares external reference(s) is likely to have some
>> unresolved elements in it, if client is not following the external
>> references.
>>
>> WDYT?
>>
>> Regards.
>>
>>> <edmx:Edmx Version="4.0">
>>>     <Reference
>>> Uri="http://docs.oasis-open.org/odata/odata/v4.0/cs02/vocabularies/Org.OD
>>> ata.Core.V1.xml">
>>>       <Include Namespace="Org.OData.Core.V1" Alias="Core"/>
>>>     </Reference>
>>> <edmx:DataServices>
>>>
>>> [1]
>>> https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=tree;f=fit/
>>> src/test/java/org/apache/olingo/fit/tecsvc;h=dadbedfacccbb63e0575c5112e91
>>> d21d41a6ae9e;hb=olingo-266-tecsvc
>> [2]
>> https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=blob;f=lib/c
>> lient-api/src/main/java/org/apache/olingo/client/api/v4/Configuration.java
>> [3]
>> https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=blob;f=lib/c
>> lient-core/src/main/java/org/apache/olingo/client/core/communication/reque
>> st/retrieve/v4/XMLMetadataRequestImpl.java

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/


Re: 4.0: references in edm

Posted by "Klevenz, Stephan" <st...@sap.com>.
Hi Francesco,

What do you think about to resolve references lazy? That would allow to
know top level resources without following the reference. Types are
qualified and and referenced documents can be resolved only if needed.

Otherwise documents could be very large in case of each reference is
resolved directly.

I think an option not to follow references makes no sense. You are right
at the end the document will be incomplete.

Regards,
Stephan

On 26.05.14 12:44, "Francesco Chicchiriccò" <il...@apache.org> wrote:

>On 26/05/2014 12:14, Klevenz, Stephan wrote:
>> Hi,
>>
>> I have implemented a first integration test [1] using the client code
>>to read service document and metadata from the server side
>>implementation. It works pretty cool except one issue.
>>
>> The metadata contains a reference uri and during deserialization this
>>link is requested and results in an exception due to incomplete proxy
>>settings. Well, I can correct my proxy settings of course but want also
>>to ask if there is a way to configure client not to follow links in
>>metadata?
>
>Hi Stephan,
>there is currently no such option, but it could be done by:
>
>1. adding setFollowEdmReferences(boolean) / isFollowEmdReferences() to
>V4's Configuration [2]
>
>2. checking Configuration#isFollowEdmReferences() before processing
>external references in XMLMetadataRequestImpl#execute [3]
>
>Anyway, I am actually not sure it would be correct: after all, an Edm
>document that declares external reference(s) is likely to have some
>unresolved elements in it, if client is not following the external
>references.
>
>WDYT?
>
>Regards.
>
>> <edmx:Edmx Version="4.0">
>>    <Reference 
>>Uri="http://docs.oasis-open.org/odata/odata/v4.0/cs02/vocabularies/Org.OD
>>ata.Core.V1.xml">
>>      <Include Namespace="Org.OData.Core.V1" Alias="Core"/>
>>    </Reference>
>> <edmx:DataServices>
>>
>> [1] 
>>https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=tree;f=fit/
>>src/test/java/org/apache/olingo/fit/tecsvc;h=dadbedfacccbb63e0575c5112e91
>>d21d41a6ae9e;hb=olingo-266-tecsvc
>[2] 
>https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=blob;f=lib/c
>lient-api/src/main/java/org/apache/olingo/client/api/v4/Configuration.java
>[3] 
>https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=blob;f=lib/c
>lient-core/src/main/java/org/apache/olingo/client/core/communication/reque
>st/retrieve/v4/XMLMetadataRequestImpl.java
>
>-- 
>Francesco Chicchiriccò
>
>Tirasa - Open Source Excellence
>http://www.tirasa.net/
>
>Involved at The Apache Software Foundation:
>member, Syncope PMC chair, Cocoon PMC, Olingo PMC
>http://people.apache.org/~ilgrosso/
>


Re: 4.0: references in edm

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 26/05/2014 12:14, Klevenz, Stephan wrote:
> Hi,
>
> I have implemented a first integration test [1] using the client code to read service document and metadata from the server side implementation. It works pretty cool except one issue.
>
> The metadata contains a reference uri and during deserialization this link is requested and results in an exception due to incomplete proxy settings. Well, I can correct my proxy settings of course but want also to ask if there is a way to configure client not to follow links in metadata?

Hi Stephan,
there is currently no such option, but it could be done by:

1. adding setFollowEdmReferences(boolean) / isFollowEmdReferences() to 
V4's Configuration [2]

2. checking Configuration#isFollowEdmReferences() before processing 
external references in XMLMetadataRequestImpl#execute [3]

Anyway, I am actually not sure it would be correct: after all, an Edm 
document that declares external reference(s) is likely to have some 
unresolved elements in it, if client is not following the external 
references.

WDYT?

Regards.

> <edmx:Edmx Version="4.0">
>    <Reference Uri="http://docs.oasis-open.org/odata/odata/v4.0/cs02/vocabularies/Org.OData.Core.V1.xml">
>      <Include Namespace="Org.OData.Core.V1" Alias="Core"/>
>    </Reference>
> <edmx:DataServices>
>
> [1] https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=tree;f=fit/src/test/java/org/apache/olingo/fit/tecsvc;h=dadbedfacccbb63e0575c5112e91d21d41a6ae9e;hb=olingo-266-tecsvc
[2] 
https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=blob;f=lib/client-api/src/main/java/org/apache/olingo/client/api/v4/Configuration.java
[3] 
https://git-wip-us.apache.org/repos/asf?p=olingo-odata4.git;a=blob;f=lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/v4/XMLMetadataRequestImpl.java

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/