You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Peter Lawrence <pe...@inova8.com> on 2014/09/21 14:48:58 UTC

Using Olingo2 within virtual host (behind Apache2 ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?

No answers to previous request so let me try and rephrase the question:

How does Olingo2 set the xml:base in the response message, for example
 xml:base="http://localhost:8080/olingo2sparql/sparql/2.0/NW/"?

How can I control what the xml:base is set to, as I want to use Olingo2
behind a virtual host (provided by Apache2)? Therefore I need to set the
xml:base to the virtual host address *not *the address in the request
header.

Thanks




*Peter J. Lawrence*
*inova8*
*Providing answers for users' information questions*
*Mobile:* +1 330 631 3772 | *Phone:* +1 330 342 0582 | *UK Cell*:+44 795
563 2824 |*Skype:* PeterJLawrence
*Email:* peter.lawrence@inova8.com | *Web:* www.inova8.com
*LinkedIn: **http://www.linkedin.com/in/peterjohnlawrence
<http://www.linkedin.com/in/peterjohnlawrence>*

RE: Using Olingo2 within virtual host (behind Apache2 ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?

Posted by "Amend, Christian" <ch...@sap.com>.
The first step is to create a JIRA issue here: https://issues.apache.org/jira/browse/OLINGO/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel
This issue will be used to attach diff files and for further discussions on this topic.

Next would be to find a way to introduce this feature into our repository as an extension. It should be a separate maven module similar to the JPA extension which can be found in the folder odata2-jpa-processor. 

Finally you create a diff or patch file which you attach to the JIRA issue. From there on someone in the project will take the file and see how it fits into our code. If the contribution is accepted it will be inside the next release. Please note that the release and the verification if the extension fits into the code can take some time :) 
If you make multiple contributions to the project there is also the possibility of making you either a committer or after some time a project member if you like. 

Best Regards,
Christian

From: Peter Lawrence [mailto:peter.lawrence@inova8.com] 
Sent: Montag, 29. September 2014 16:04
To: user@olingo.apache.org
Subject: RE: Using Olingo2 within virtual host (behind Apache2 ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?

Yes it is an interface to any SPARQL/triple store. It converts the OData request to the corresponding SPARQL and then executes the SPARQL. I have implemented all except media and batch calls for OData2. However I look forward to Olingo4 as some features of odata > version 2 would be helpful such as properties having collection values rather than scalars.
Yes I would like to submit it as an extension ... How do I start that process?
Best regards
Peter
On Sep 29, 2014 2:27 PM, "Amend, Christian" <ch...@sap.com> wrote:
Hi Peter,
 
that sounds great ☺
 
Do I get this right that you implemented the OData Processor interface to interact with a SPARQL/RDF triple store? 
 
If you would like to make this open source and if you are interested to work with Apache you could contribute this as an Extension to Olingo. This would be like the JPA extension we already have where you can use a pre-implemented Processor to connect to a JPA data store. Give it a thought and let me know what you think ☺
 
Best Regards,
Christian
 
From: Peter Lawrence [mailto:peter.lawrence@inova8.com] 
Sent: Montag, 29. September 2014 14:50
To: user@olingo.apache.org
Subject: Re: Using Olingo2 within virtual host (behind Apache2 ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?
 
Thanks for pointing that out ... I missed one directive in the apache2 mod-proxy configuration and that solved it all!
 
BTW, I now have a SPARQL provider for Olingo2 that acts as an odata2 proxy for any SPARQL/RDF triple store.  In other words one can interact with any RDF triple-store as if it were an Odata 'source. I intend to make this available as open source.
 
 
Regards
 
Peter
 
 


Peter J. Lawrence
inova8
Providing answers for users' information questions
Mobile: +1 330 631 3772 | Phone: +1 330 342 0582 | UK Cell:+44 795 563 2824 |Skype: PeterJLawrence
Email: peter.lawrence@inova8.com | Web: www.inova8.com
LinkedIn: http://www.linkedin.com/in/peterjohnlawrence
 
On Tue, Sep 23, 2014 at 12:11 PM, Klevenz, Stephan <st...@sap.com> wrote:
Hi Lawrence,
 
Sorry for late reply. 
 
Have a look at [1]. Sample code for e.g. readEntity has this lines where the service root is set before serialization. Here you can set any url. The ProviderWriteProperties class has more options where you can influence the behavior of the serialization.
 
URI serviceRoot = getContext().getPathInfo().getServiceRoot();
ODataEntityProviderPropertiesBuilder propertiesBuilder = EntityProviderWriteProperties.serviceRoot(serviceRoot);
return EntityProvider.writeEntry(contentType, entitySet, data, propertiesBuilder.build());
 
[1] http://olingo.staging.apache.org/doc/odata2/tutorials/basicread.html
 
I am not sure if this really solves your problem. What you describe is the standard behind-a-proxy problem and usually a web server can solve this. Have also a look to the rewrite module of the Apache web server.
 
Regards,
Stephan
 
 
 
From: Peter Lawrence <pe...@inova8.com>
Reply-To: "user@olingo.apache.org" <us...@olingo.apache.org>
Date: Sonntag, 21. September 2014 14:48
To: "user@olingo.apache.org" <us...@olingo.apache.org>
Subject: Using Olingo2 within virtual host (behind Apache2 ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?
 
No answers to previous request so let me try and rephrase the question: 
 
How does Olingo2 set the xml:base in the response message, for example
 xml:base="http://localhost:8080/olingo2sparql/sparql/2.0/NW/"?
 
How can I control what the xml:base is set to, as I want to use Olingo2 behind a virtual host (provided by Apache2)? Therefore I need to set the xml:base to the virtual host address not the address in the request header.
 
Thanks 
 
 
 


Peter J. Lawrence
inova8
Providing answers for users' information questions 
Mobile: +1 330 631 3772 | Phone:+1 330 342 0582 | UK Cell:+44 795 563 2824 |Skype: PeterJLawrence
Email: peter.lawrence@inova8.com | Web:www.inova8.com
LinkedIn: http://www.linkedin.com/in/peterjohnlawrence
 

RE: Using Olingo2 within virtual host (behind Apache2 ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?

Posted by Peter Lawrence <pe...@inova8.com>.
Yes it is an interface to any SPARQL/triple store. It converts the OData
request to the corresponding SPARQL and then executes the SPARQL. I have
implemented all except media and batch calls for OData2. However I look
forward to Olingo4 as some features of odata > version 2 would be helpful
such as properties having collection values rather than scalars.

Yes I would like to submit it as an extension ... How do I start that
process?

Best regards

Peter
On Sep 29, 2014 2:27 PM, "Amend, Christian" <ch...@sap.com> wrote:

>  Hi Peter,
>
>
>
> that sounds great J
>
>
>
> Do I get this right that you implemented the OData Processor interface to
> interact with a SPARQL/RDF triple store?
>
>
>
> If you would like to make this open source and if you are interested to
> work with Apache you could contribute this as an Extension to Olingo. This
> would be like the JPA extension we already have where you can use a
> pre-implemented Processor to connect to a JPA data store. Give it a thought
> and let me know what you think J
>
>
>
> Best Regards,
>
> Christian
>
>
>
> *From:* Peter Lawrence [mailto:peter.lawrence@inova8.com]
> *Sent:* Montag, 29. September 2014 14:50
> *To:* user@olingo.apache.org
> *Subject:* Re: Using Olingo2 within virtual host (behind Apache2
> ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?
>
>
>
> Thanks for pointing that out ... I missed one directive in the apache2
> mod-proxy configuration and that solved it all!
>
>
>
> BTW, I now have a SPARQL provider for Olingo2 that acts as an odata2 proxy
> for any SPARQL/RDF triple store.  In other words one can interact with any
> RDF triple-store as if it were an Odata 'source. I intend to make this
> available as open source.
>
>
>
>
>
> Regards
>
>
>
> Peter
>
>
>
>
>
>
>   *Peter J. Lawrence*
>
> *inova**8*
>
> *Providing answers for users' information questions*
>
> *Mobile:* +1 330 631 3772 | *Phone:* +1 330 342 0582 | *UK Cell*:+44 795
> 563 2824 |*Skype:* PeterJLawrence
>
> *Email:* peter.lawrence@inova8.com | *Web:* www.inova8.com
>
> *LinkedIn: **http://www.linkedin.com/in/peterjohnlawrence
> <http://www.linkedin.com/in/peterjohnlawrence>*
>
>
>
> On Tue, Sep 23, 2014 at 12:11 PM, Klevenz, Stephan <
> stephan.klevenz@sap.com> wrote:
>
> Hi Lawrence,
>
>
>
> Sorry for late reply.
>
>
>
> Have a look at [1]. Sample code for e.g. readEntity has this lines where
> the service root is set before serialization. Here you can set any url. The
> ProviderWriteProperties class has more options where you can influence the
> behavior of the serialization.
>
>
>
> URI serviceRoot = getContext().getPathInfo().getServiceRoot();
>
> ODataEntityProviderPropertiesBuilder propertiesBuilder =
> EntityProviderWriteProperties.serviceRoot(serviceRoot);
>
> return EntityProvider.writeEntry(contentType, entitySet, data,
> propertiesBuilder.build());
>
>
>
> [1] http://olingo.staging.apache.org/doc/odata2/tutorials/basicread.html
>
>
>
> I am not sure if this really solves your problem. What you describe is the
> standard behind-a-proxy problem and usually a web server can solve this.
> Have also a look to the rewrite module of the Apache web server.
>
>
>
> Regards,
>
> Stephan
>
>
>
>
>
>
>
> *From: *Peter Lawrence <pe...@inova8.com>
> *Reply-To: *"user@olingo.apache.org" <us...@olingo.apache.org>
> *Date: *Sonntag, 21. September 2014 14:48
> *To: *"user@olingo.apache.org" <us...@olingo.apache.org>
> *Subject: *Using Olingo2 within virtual host (behind Apache2
> ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?
>
>
>
>   No answers to previous request so let me try and rephrase the question:
>
>
>
> How does Olingo2 set the xml:base in the response message, for example
>
>  xml:base="http://localhost:8080/olingo2sparql/sparql/2.0/NW/"?
>
>
>
> How can I control what the xml:base is set to, as I want to use Olingo2
> behind a virtual host (provided by Apache2)? Therefore I need to set the
> xml:base to the virtual host address *not *the address in the request
> header.
>
>
>
> Thanks
>
>
>
>
>
>
>
>
>   *Peter J. Lawrence*
>
> *inova**8*
>
> *Providing answers for users' information questions*
>
> *Mobile:* +1 330 631 3772 | *Phone:*+1 330 342 0582 | *UK Cell*:+44 795
> 563 2824 |*Skype:* PeterJLawrence
>
> *Email:* peter.lawrence@inova8.com | *Web:*www.inova8.com
>
> *LinkedIn: **http://www.linkedin.com/in/peterjohnlawrence
> <http://www.linkedin.com/in/peterjohnlawrence>*
>
>
>

RE: Using Olingo2 within virtual host (behind Apache2 ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?

Posted by "Amend, Christian" <ch...@sap.com>.
Hi Peter,

that sounds great ☺

Do I get this right that you implemented the OData Processor interface to interact with a SPARQL/RDF triple store?

If you would like to make this open source and if you are interested to work with Apache you could contribute this as an Extension to Olingo. This would be like the JPA extension we already have where you can use a pre-implemented Processor to connect to a JPA data store. Give it a thought and let me know what you think ☺

Best Regards,
Christian

From: Peter Lawrence [mailto:peter.lawrence@inova8.com]
Sent: Montag, 29. September 2014 14:50
To: user@olingo.apache.org
Subject: Re: Using Olingo2 within virtual host (behind Apache2 ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?

Thanks for pointing that out ... I missed one directive in the apache2 mod-proxy configuration and that solved it all!

BTW, I now have a SPARQL provider for Olingo2 that acts as an odata2 proxy for any SPARQL/RDF triple store.  In other words one can interact with any RDF triple-store as if it were an Odata 'source. I intend to make this available as open source.


Regards

Peter



Peter J. Lawrence
inova8
Providing answers for users' information questions
Mobile: +1 330 631 3772 | Phone: +1 330 342 0582 | UK Cell:+44 795 563 2824 |Skype: PeterJLawrence
Email: peter.lawrence@inova8.com<ma...@inova8.com> | Web: www.inova8.com<http://www.inova8.com>
LinkedIn: http://www.linkedin.com/in/peterjohnlawrence

On Tue, Sep 23, 2014 at 12:11 PM, Klevenz, Stephan <st...@sap.com>> wrote:
Hi Lawrence,

Sorry for late reply.

Have a look at [1]. Sample code for e.g. readEntity has this lines where the service root is set before serialization. Here you can set any url. The ProviderWriteProperties class has more options where you can influence the behavior of the serialization.

URI serviceRoot = getContext().getPathInfo().getServiceRoot();
ODataEntityProviderPropertiesBuilder propertiesBuilder = EntityProviderWriteProperties.serviceRoot(serviceRoot);
return EntityProvider.writeEntry(contentType, entitySet, data, propertiesBuilder.build());

[1] http://olingo.staging.apache.org/doc/odata2/tutorials/basicread.html

I am not sure if this really solves your problem. What you describe is the standard behind-a-proxy problem and usually a web server can solve this. Have also a look to the rewrite module of the Apache web server.

Regards,
Stephan



From: Peter Lawrence <pe...@inova8.com>>
Reply-To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Date: Sonntag, 21. September 2014 14:48
To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Subject: Using Olingo2 within virtual host (behind Apache2 ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?

No answers to previous request so let me try and rephrase the question:

How does Olingo2 set the xml:base in the response message, for example
 xml:base="http://localhost:8080/olingo2sparql/sparql/2.0/NW/"?

How can I control what the xml:base is set to, as I want to use Olingo2 behind a virtual host (provided by Apache2)? Therefore I need to set the xml:base to the virtual host address not the address in the request header.

Thanks




Peter J. Lawrence
inova8
Providing answers for users' information questions
Mobile: +1 330 631 3772<tel:%2B1%20330%20631%203772> | Phone:+1 330 342 0582<tel:%2B1%20330%20342%200582> | UK Cell:+44 795 563 2824<tel:%2B44%20795%20563%202824> |Skype: PeterJLawrence
Email: peter.lawrence@inova8.com<ma...@inova8.com> | Web:www.inova8.com<http://www.inova8.com>
LinkedIn: http://www.linkedin.com/in/peterjohnlawrence


Re: Using Olingo2 within virtual host (behind Apache2 ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?

Posted by Peter Lawrence <pe...@inova8.com>.
Thanks for pointing that out ... I missed one directive in the apache2
mod-proxy configuration and that solved it all!

BTW, I now have a SPARQL provider for Olingo2 that acts as an odata2 proxy
for any SPARQL/RDF triple store.  In other words one can interact with any
RDF triple-store as if it were an Odata 'source. I intend to make this
available as open source.


Regards

Peter



*Peter J. Lawrence*
*inova8*
*Providing answers for users' information questions*
*Mobile:* +1 330 631 3772 | *Phone:* +1 330 342 0582 | *UK Cell*:+44 795
563 2824 |*Skype:* PeterJLawrence
*Email:* peter.lawrence@inova8.com | *Web:* www.inova8.com
*LinkedIn: **http://www.linkedin.com/in/peterjohnlawrence
<http://www.linkedin.com/in/peterjohnlawrence>*

On Tue, Sep 23, 2014 at 12:11 PM, Klevenz, Stephan <st...@sap.com>
wrote:

>  Hi Lawrence,
>
>  Sorry for late reply.
>
>  Have a look at [1]. Sample code for e.g. readEntity has this lines where
> the service root is set before serialization. Here you can set any url. The
> ProviderWriteProperties class has more options where you can influence the
> behavior of the serialization.
>
>  URI serviceRoot = getContext().getPathInfo().getServiceRoot();
> ODataEntityProviderPropertiesBuilder propertiesBuilder =
> EntityProviderWriteProperties.serviceRoot(serviceRoot);
> return EntityProvider.writeEntry(contentType, entitySet, data,
> propertiesBuilder.build());
>
>  [1] http://olingo.staging.apache.org/doc/odata2/tutorials/basicread.html
>
>  I am not sure if this really solves your problem. What you describe is
> the standard behind-a-proxy problem and usually a web server can solve
> this. Have also a look to the rewrite module of the Apache web server.
>
>  Regards,
>  Stephan
>
>
>
>   From: Peter Lawrence <pe...@inova8.com>
> Reply-To: "user@olingo.apache.org" <us...@olingo.apache.org>
> Date: Sonntag, 21. September 2014 14:48
> To: "user@olingo.apache.org" <us...@olingo.apache.org>
> Subject: Using Olingo2 within virtual host (behind Apache2
> ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?
>
>    No answers to previous request so let me try and rephrase the
> question:
>
>  How does Olingo2 set the xml:base in the response message, for example
>  xml:base="http://localhost:8080/olingo2sparql/sparql/2.0/NW/"?
>
>  How can I control what the xml:base is set to, as I want to use Olingo2
> behind a virtual host (provided by Apache2)? Therefore I need to set the
> xml:base to the virtual host address *not *the address in the request
> header.
>
>  Thanks
>
>
>
>
>  *Peter J. Lawrence*
> *inova8*
> *Providing answers for users' information questions*
> *Mobile:* +1 330 631 3772 | *Phone:*+1 330 342 0582 | *UK Cell*:+44 795
> 563 2824 |*Skype:* PeterJLawrence
> *Email:* peter.lawrence@inova8.com | *Web:*www.inova8.com
> *LinkedIn: **http://www.linkedin.com/in/peterjohnlawrence
> <http://www.linkedin.com/in/peterjohnlawrence>*
>
>

Re: Using Olingo2 within virtual host (behind Apache2 ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?

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

Sorry for late reply.

Have a look at [1]. Sample code for e.g. readEntity has this lines where the service root is set before serialization. Here you can set any url. The ProviderWriteProperties class has more options where you can influence the behavior of the serialization.

URI serviceRoot = getContext().getPathInfo().getServiceRoot();
ODataEntityProviderPropertiesBuilder propertiesBuilder = EntityProviderWriteProperties.serviceRoot(serviceRoot);
return EntityProvider.writeEntry(contentType, entitySet, data, propertiesBuilder.build());

[1] http://olingo.staging.apache.org/doc/odata2/tutorials/basicread.html

I am not sure if this really solves your problem. What you describe is the standard behind-a-proxy problem and usually a web server can solve this. Have also a look to the rewrite module of the Apache web server.

Regards,
Stephan



From: Peter Lawrence <pe...@inova8.com>>
Reply-To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Date: Sonntag, 21. September 2014 14:48
To: "user@olingo.apache.org<ma...@olingo.apache.org>" <us...@olingo.apache.org>>
Subject: Using Olingo2 within virtual host (behind Apache2 ProxyReversePass) or How can I set the xml:base URL that Olingo2 uses?

No answers to previous request so let me try and rephrase the question:

How does Olingo2 set the xml:base in the response message, for example
 xml:base="http://localhost:8080/olingo2sparql/sparql/2.0/NW/"?

How can I control what the xml:base is set to, as I want to use Olingo2 behind a virtual host (provided by Apache2)? Therefore I need to set the xml:base to the virtual host address not the address in the request header.

Thanks




Peter J. Lawrence
inova8
Providing answers for users' information questions
Mobile: +1 330 631 3772 | Phone:+1 330 342 0582 | UK Cell:+44 795 563 2824 |Skype: PeterJLawrence
Email: peter.lawrence@inova8.com<ma...@inova8.com> | Web:www.inova8.com<http://www.inova8.com>
LinkedIn: http://www.linkedin.com/in/peterjohnlawrence