OSLC/Lyo Questions

Hello. I try to create a POC application using OSLC to provide sysml v2 resources from our server.
I already found a sample application by @jad (GitHub - oslc-op/sysml-oslc-server: Sample code to demonstrate how to use Lyo Designer to create an OSLC server for the SysML v2 REST API.), which seems to address my needs quite well. Unfortunately, I have some problems to get the application up and running, mostly because of 404 exception to a sparql request.

Because I wanted anyway to provide a OSLC server for my own application, I decided to build one from scratch. While doing so, I run in multiple questions and problems. Maybe someone can help me to get a better understanding.

  1. Most examples, tutorials and also Lyo seem to be based on the OSLC 2.0 specification. The spec page of the website highlights only the OSLC 3.0 specification, where terms like ServiceProvider or ServiceProviderCatalaog are even not mentioned. I read on a different blog post that 3.0 is backward compatible to 2.0. Do I understand it correctly, that a ServiceProvider and a ServiceProviderCatalog is not mandatory?

  2. I opened the GitHub - oslc-op/sysml-oslc-server: Sample code to demonstrate how to use Lyo Designer to create an OSLC server for the SysML v2 REST API. project in Eclipse Lyo and noticed, that one Resource can be Linked to a Service and a Web service, where a Service defines SelectionDialog and QueryCapabilities. The WebService on the other hand read-only Get methods. From reading the specs I had the understanding that the read-only function is a must on a Service where the SelectionDialog and QueryCapabilities are optional. Why are there two different services in the Lyo palette, and why is the Get capability not part of the OSLC Service?

  3. the readme.md of GitHub - oslc-op/sysml-oslc-server: Sample code to demonstrate how to use Lyo Designer to create an OSLC server for the SysML v2 REST API. mentions that the Resources are created based on an EMF model. Is there a tool or script which I can execute to generate a sysmlDomainSpecification.xml based on an emf model?

  4. Looking at the generated java classes of OSLC Resources, I noticed, that references to other resources are defined by a Link. This makes sense, taking the core feature of RDF in consideration, to link resources with urls. Reading the OSLC 3.0 spec I got the understanding that a client can use oslc.properties to return resources with only the requested properties (this approach seems to be similar to graphql). Is there an example based on Lyo which supports oslc.properties. How does the result look like when nested properties are defined in the request?

  5. I was reading the tutorial on OSLC Primer | OSLC. It mentions that a ServiceProvider itself has a get endpoint to retrieve some metadata about it. I was looking in the Bugzilla and sysml example and noticed that neither of them seems to provide such an endpoint in their service providers. Does that mean, that they are not mandatory or that the guide is outdated?

  6. Reading the specs OSLC Core Version 3.0. Part 2: Discovery i notices in Section 5 (Resource Constraints) that there are ServiceProvider and Services defined. Based on the description, I am not sure what is the difference of them. Can you maybe help me to getter understanding?

I think these are the biggest question I have at the moment. I would appreciate any help and input. Thanks already in advance.

Hi @fritter,

What is producing the 404 exception to a sparql request?

Now I try to answer your questions

1.

yes, Lyo is still based on OSLC 2.0, and 3.0 should be backward compatible with 2.0.
And yes, in both specs ServiceProvider and a ServiceProviderCatalog are not mandatory (most things in the OSLC specs are not mandatory. But your implementation should implement them if you find the features necessary).
Note that ServiceProvider and a ServiceProviderCatalog are defined as Containers in 3.0.

2.
WebService & Service are the terms LyoDesigner uses in its interface. Only the latter - Service - is defined in the specs.
Service corresponds to that you see in the specs (See for example the figure OSLC Core Version 3.0. Part 2: Discovery), which then contains references to QueryCapability, CreationFactory, etc. The Service itself is contained within a ServiceProvider.
I believe your point 6 below relates to this question too,

Now, WebService defines the C.R.U.D. methods on resources to handle a specific resource with a given URL. Note that these C.R.U.D. methods are not part of the OSLC Service (See the figure I just referenced). and that’s why LyoDesigner lets you model them separately.

When you model a Service, you need to define the query/creation capabilities and they have a property that specify the URL of that service. (queryBase, or creation)
For a particular resource, you already know the URL of that resource, so you can then simply call GET/PUT/DELETE on it.

This older thread might be of some help too

3.
I did indeed use some java code to translate from the EMF meta-model of Sysml to define the OSLC shapes (and hence the resulting code). I have not made this code public. I am not sure what I will do with this code. Is the resulting classes insufficient?

4.
The current Sysml implementation does not make use of oslc.properties. I believe the Lyo SDK does support it, but I have not had much use of it recently. so I can’t think of examples. Hope someone else can give better tips.

5.
Both Bugzilla and Sysml support ServiceProviders. Sysml has one for each commit. For Bugzilla, you should have one for each Project.
Here’s for example a link to the Sysml ServiceProviderCatalog
http://sysml2-oslc-dev.intercax.com:8080/sysml_oslc_server/oslc/catalog/singleton.
As you can see, the link on that page is that for its - only - ServiceProvider. Do a GET on that to get more info about the ServiceProvider.

6.
Was figure 1 of any help?
I view a ServiceProvider as the context for your Services.
If you take Bugzilla (or Jira) as an example, you cannot simply create an Issue/changeRequest on a global level. You create an Issue/ChangeRequest/Bug in the context of a specific Project. Each Project hence correspond to an OSLC ServiceProvider. And for each ServiceProvider/Project, you will then get a specific URL to create an Issue/ChangeRequest/Bug within it. That’s the value of the oslc:creation value of the CreationFactory object in fgure 1. Simlarly, if you want to search within the context of a project/ServiceProvider, you use the URL defined in hte oslc:queryBase of a QueryCapability.
A Service is nothing but a container of all the capabilites of a ServiceProvider/Project.

Hope this helps to get you started, and hope you find OSLC of value to your project.

1 Like

Hello @jad ,

Thy you already helped me a lot to understand things better. I got highly confused with all the different demos and tutorials, which seem to based on different standards.

Regarding the EMF model. I think the given code should work for my needs. Bur since sysml v2 is still WIP it might be that they change some aspects of the model. It would be quite convinent to adapt to. Also, in general I think such a converter can help on any MBSE development, since a lot of models like capella are also represented in EMF. Therefore, such a tool can help to speed up a migration process.

Anyway, thx so far. I may come back with some additional question. If I find time, I can also share my experience using the oslc4j library combined with spring boot :slight_smile: