Discovering OSLC services

OSLC Services are declared in a way that their URLs should always be discovered and not the result of string concatenations.
The only fixed URL is for the Root Services document and is https://SERVER:PORT/rest/oslc/1.0/rootservices.

Discovering the Root Services document

The Root Services document is the entry point for recursively discovering OSLC services.
This entry point does not require user authentication.

<rdf:Description rdf:about="https://SERVER:PORT/rest/oslc/1.0/rootservices"
  ...
  <oslc_cm:cmServiceProviders rdf:resource="https://SERVER:PORT/rest/oslc/1.0/cm/catalog"/>
  ...
</rdf:Description>

Discovering the Service Provider Catalog

The Service Provider Catalog is the list of Jira projects for a given OSLC domain.

<rdf:RDF>
  <oslc:ServiceProviderCatalog rdf:about="https://SERVER:PORT/rest/oslc/1.0/cm/catalog">
    <oslc:serviceProvider>
      <oslc:ServiceProvider rdf:about="https://SERVER:PORT/rest/oslc/1.0/cm/project/JIRA-PROJECT-ID>
        <dcterms:title rdf:parseType="Literal">My Project</dcterms:title>
      </oslc:ServiceProvider>
      ...
    </oslc:serviceProvider>
    ...
  </oslc:ServiceProviderCatalog>
</rdf:RDF>

Discovering Service Providers

A Service Provider is an OSLC representation of a Jira project for a given OSLC domain.
A service provider declares OSLC services, that are capabilities exposed for a Jira project. It notably enables querying Jira issues using OSLC vocabulary.

<rdf:RDF 
  ...
  <oslc:ServiceProvider rdf:about="https://SERVER:PORT/rest/oslc/1.0/cm/project/PROJECT-ID">
    ...
    <oslc:service>
      <oslc:Service>
        <oslc:domain rdf:resource="http://open-services.net/ns/cm#"/>
        <oslc:queryCapability>
          <oslc:QueryCapability>
            <oslc:queryBase rdf:resource="https://SERVER:PORT/rest/oslc/1.0/cm/issue/query/PROJECT-ID"/>
            <oslc:resourceType rdf:resource="http://open-services.net/ns/cm#ChangeRequest"/>
          </oslc:QueryCapability>
        </oslc:queryCapability>
        ...
      </oslc:Service>
    </oslc:service>
  </rdf:Description>
</rdf:RDF>