Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [lyo-dev] FW: OSLC vs Jena

Hi,

 

Yes you are right I missed the header OSLC-Core-Version = 2.0 in the Rest Client, but used it in the code.

 

The overall question remains but with a different explanation:

 

I am trying out if it is possible to replace an existing “home-made” OSLC solution by using Lyo.

So I got some questions in the code example below. Not sure if I misunderstand the Lyo API or if it is some limitations in the current implementation, perhaps in the future getResources (e.g. method that returns array of resources) will exist in the OSLCClient.

 

// sample based on the RRCFormSample

 

String catalogUrl = helper.getCatalogUrl();

                                                 

ServiceProviderCatalog catalog = client.getResource(catalogUrl,OslcMediaType.APPLICATION_RDF_XML).getEntity(ServiceProviderCatalog.class);

                                                 

ServiceProvider[] serviceProviders = catalog.getServiceProviders();

for (ServiceProvider serviceProvider : serviceProviders) {

URI about = serviceProvider.getAbout();

            // this returns the first service, but what about retrieving the next? OSLC Core Spec 2.0 ServiceProvider oslc:service states one-or-many

            Service service = client.getResource(about.toString(),OslcMediaType.APPLICATION_RDF_XML).getEntity(Service.class);

            // this returns a “random” prefixDefinition, but what about retrieving the next? OSLC Core Spec 2.0 ServiceProvider oslc:prefixDefinition states zero-or-many

            PrefixDefinition prefixDefinition = client.getResource(about.toString(),OslcMediaType.APPLICATION_RDF_XML).getEntity(PrefixDefinition.class);

}

 

BR Cecilia Lindgren

 

 

From: lyo-dev-bounces@xxxxxxxxxxx [mailto:lyo-dev-bounces@xxxxxxxxxxx] On Behalf Of Michael Fiedler
Sent: den 9 november 2012 22:58
To: Lyo project developer discussions
Subject: Re: [lyo-dev] FW: OSLC vs Jena

 

It normally does.   Cecilia, were you using the OslcClient for your request?   or just a Wink client.   If you can provide a snippet of your code (here or in a Bugzilla), that would help.

 

Regards,

Mike

 

On Fri, Nov 9, 2012 at 4:06 PM, Steve Speicher <sspeiche@xxxxxxxxx> wrote:

If it is only expecting 2.0, seems like the lib should be sending that header by default.

- Steve

On Nov 9, 2012 10:16 AM, "Samuel Padgett" <spadgett@xxxxxxxxxx> wrote:

Hi, Cecelia. This looks like an OSLC 1.0 response, whereas Lyo is expecting an OSLC 2.0 response. You should try adding the request header

OSLC-Core-Version: 2.0

to all of your HTTP requests for OSLC resources.
--
Best Regards,
Samuel Padgett | IBM Rational | spadgett@xxxxxxxxxx


Inactive hide details for ---11/09/2012 09:20:32 AM---Hi Ly-dev, I am using the OSLC4J client to fetch the Service Provider Cat---11/09/2012 09:20:32 AM---Hi Ly-dev, I am using the OSLC4J client to fetch the Service Provider Catalog (from RRC) and loop th

From:


<Cecilia.lindgren@xxxxxxxxx>

To:


<lyo-dev@xxxxxxxxxxx>,

Date:


11/09/2012 09:20 AM

Subject:


[lyo-dev] FW: OSLC vs Jena

Sent by:


lyo-dev-bounces@xxxxxxxxxxx





Hi Ly-dev,
 
I am using the OSLC4J client to fetch the Service Provider Catalog (from RRC) and loop through all referenced Service Providers.
As described in the OSLC Core specification Uri: http://open-services.net/ns/core#ServiceProvider
 
Example of the content of the OSLC artifact
·  <oslc_disc:ServiceProviderCatalog
·             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
·             xmlns:dcterms="http://purl.org/dc/terms/"
·             xmlns:oslc_disc="http://open-services.net/xmlns/discovery/1.0/"
·             xmlns:jp="http://jazz.net/xmlns/prod/jazz/process/1.0/"
·             rdf:about="https://server:9443/rm/discovery/RMCatalog">
·             <dcterms:title>RMCatalog</dcterms:title>
·             <oslc_disc:entry>
·                            <oslc_disc:ServiceProvider>
·                                           <dcterms:title>Test project (Requirements)</dcterms:title>
·                                           <oslc_disc:details rdf:resource="https://server:9443/jts/process/project-areas/_hFmb4BarEeKslKmU2g6gKg"/>
·                                           <jp:consumerRegistry rdf:resource="https://server:9443/jts/process/project-areas/_hFmb4BarEeKslKmU2g6gKg/links"/>
·                                           <oslc_disc:services rdf:resource="https://server:9443/rm/discovery/_hFmb4BarEeKslKmU2g6gKg/services.xml"/>
·                            </oslc_disc:ServiceProvider>
·             </oslc_disc:entry>
·  
 
For each Service provider I want to get the services highlighted in red. But using the Lyo java class org.eclipse.lyo.oslc4j.core.model.ServiceProvider I do get any result when calling
Service[] services = serviceProvider.getServices();  The array is empty. To find the URI I am looking for I must use get About instead
URI about = serviceProvider.getAbout();
 
This match the Jena model.
 
  <rdf:Description rdf:about="https://server:9443/rm/discovery/_hFmb4BarEeKslKmU2g6gKg/services.xml">
    <oslc:details rdf:resource="https://server:9443/jts/process/project-areas/_hFmb4BarEeKslKmU2g6gKg"/>
    <jp:consumerRegistry rdf:resource="https://server:9443/jts/process/project-areas/_hFmb4BarEeKslKmU2g6gKg/links"/>
    <dcterms:title rdf:parseType="Literal">Test project (Requirements)</dcterms:title>
    <rdf:type rdf:resource="http://open-services.net/ns/core#ServiceProvider"/>
  </rdf:Description>
 
It feels like this Lyo Java object is more reflecting the content of the Jena model than the OSLC artifact or have I misunderstood something. If it is bug I can file a bug on this issue.
 
I am a using RRC 4.0.0.1
 
 
Med vänliga hälsningar/Best regards,
 
Cecilia Lindgren
Tieto Sweden AB 
 _______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/lyo-dev


_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/lyo-dev


_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/lyo-dev

 


Back to the top