OSLC RequirementCollection output

Hello guys!,

As part of our solution, we are exposing both requirementcollection and requirement resource URIs. However, somehow we are not able identify correct attribute to link requirement in requirement collection. Unfortunately, I could not find elaborated information on this topic.

Can someone please help me to understand correct requirementcollection structure and requirement structure as per OSLC specs ? Which attribute should I use to link between requirement with requirementcollection ?

It will be better if someone provide a sample output of both requirementcollection and requirement resource.

Thanks!

Welcome to the forum, @dkedarptc!

You may find a table describing the shapes of Requirement and RequirementCollection resources here: OSLC Requirements Management Version 2.1. Part 2: Vocabulary

For example, oslc_rm:decomposedBy on the Requirement resource shape says in the description (emphasis mine):

The subject is decomposed by the object. For example, a […] requirement is decomposed into a collection of […] requirements.

Hope this helps. Please note: oslc_rm:decomposedBy is NOT the only property you should use. I just used it as an example of a valid property to use in a typical case. @jad is the spec editor, perhaps he could help you more with this if you have more specific questions.

Thanks for the suggestion.

We are planning to go ahead with oslc_rm:uses.

We are still not sure how to represent RequirementCollection resource. As our use case is to provide all Requirements under RequirementCollection along with their own details.

For e.g.

<?xml version="1.0" encoding="utf-8"?>

<rdf:RDF xmlns:rdfs=β€œhttp://www.w3.org/2000/01/rdf-schema#”
xmlns:xsd=β€œhttp://www.w3.org/2001/XMLSchema#”
xmlns:oslc=β€œhttp://open-services.net/ns/core#”
xmlns:dcterms=β€œhttp://purl.org/dc/terms/”
xmlns:oslc_rm=β€œhttp://open-services.net/ns/rm#”
xmlns:rdf=β€œhttp://www.w3.org/1999/02/22-rdf-syntax-ns#”>
<oslc_rm:RequirementCollection rdf:about=β€œhttps://hostname:port/oslc/r/requirementcollection?id=146”>
<rdf:type rdf:resource=β€œhttp://open-services.net/ns/rm#RequirementCollection” />
<dcterms:identifier rdf:datatype=β€œhttp://www.w3.org/2001/XMLSchema#string”>146</dcterms:identifier>
<dcterms:title rdf:parseType=β€œLiteral”>XXXXXX</dcterms:title>
<oslc:shortTitle rdf:parseType=β€œLiteral”>XXXXXX</oslc:shortTitle>
<dcterms:description rdf:parseType=β€œLiteral”>XXXXXX</dcterms:description>
<dcterms:modified rdf:datatype=β€œhttp://www.w3.org/2001/XMLSchema#dateTime”>2006-10-24T17:14:00.0000000Z</dcterms:modified>
<oslc_rm:uses rdf:resource=β€œhttps://hostname:port/oslc/r/requirements?id=125” rdf:ID=β€œ125”/>
<oslc_rm:uses rdf:resource=β€œhttps://hostname:port/oslc/r/requirements?id=126” rdf:ID=β€œ126”/>
</oslc_rm:RequirementCollection>
<rdf:Description rdf:about="#125">
oslc:shortTitleXXXXXX</oslc:shortTitle>
dcterms:created2018-11-23T08:56:28Z</dcterms:created>
dcterms:descriptionXXXXXX</dcterms:description>
dcterms:identifierXXXXXX</dcterms:identifier>
dcterms:modified2019-08-05T08:55:17Z</dcterms:modified>
dcterms:subjectRequirement</dcterms:subject>
<dcterms:title rdf:datatype=β€œhttp://www.w3.org/2001/XMLSchema#integer”>XXXXXX</dcterms:title>
<rdf:type rdf:resource=β€œhttp://open-services.net/ns/rm#Requirement”/>
</rdf:Description>
<rdf:Description rdf:about="#126">
oslc:shortTitleXXXXXX</oslc:shortTitle>
dcterms:created2018-11-23T08:56:28Z</dcterms:created>
dcterms:descriptionXXXXXX</dcterms:description>
dcterms:identifier126</dcterms:identifier>
dcterms:modified2019-08-05T08:55:17Z</dcterms:modified>
dcterms:subjectRequirement</dcterms:subject>
<dcterms:title rdf:datatype=β€œhttp://www.w3.org/2001/XMLSchema#integer”>XXXXXX</dcterms:title>
<rdf:type rdf:resource=β€œhttp://open-services.net/ns/rm#Requirement”/>
</rdf:Description>
</rdf:RDF>

Can you please confirm above structure is as per OSLC specs ?

1 Like

All right, let’s see. first, I convert your XML into valid RDF/XML:

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:oslc="http://open-services.net/ns/core#"
    xmlns:oslc_rm="http://open-services.net/ns/rm#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
  <oslc_rm:RequirementCollection rdf:about="https://hostname:8080/oslc/r/requirementcollection?id=146">
    <oslc_rm:uses>
      <oslc_rm:Requirement rdf:about="https://hostname:8080/oslc/r/requirements?id=126">
        <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#integer"
        >126</dcterms:title>
        <dcterms:subject>Requirement</dcterms:subject>
        <dcterms:modified>2019-08-05T08:55:17Z</dcterms:modified>
        <dcterms:identifier>126</dcterms:identifier>
        <dcterms:description>XXXXXX</dcterms:description>
        <dcterms:created>2018-11-23T08:56:28Z</dcterms:created>
        <oslc:shortTitle>XXXXXX</oslc:shortTitle>
      </oslc_rm:Requirement>
    </oslc_rm:uses>
    <oslc_rm:uses>
      <oslc_rm:Requirement rdf:about="https://hostname:8080/oslc/r/requirements?id=125">
        <dcterms:title rdf:datatype="http://www.w3.org/2001/XMLSchema#integer"
        >125</dcterms:title>
        <dcterms:subject>Requirement</dcterms:subject>
        <dcterms:modified>2019-08-05T08:55:17Z</dcterms:modified>
        <dcterms:identifier>XXXXXX</dcterms:identifier>
        <dcterms:description>XXXXXX</dcterms:description>
        <dcterms:created>2018-11-23T08:56:28Z</dcterms:created>
        <oslc:shortTitle>XXXXXX</oslc:shortTitle>
      </oslc_rm:Requirement>
    </oslc_rm:uses>
    <dcterms:modified rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime"
    >2006-10-24T17:14:00.0000000Z</dcterms:modified>
    <dcterms:description rdf:parseType="Literal">XXXXXX</dcterms:description>
    <oslc:shortTitle rdf:parseType="Literal">XXXXXX</oslc:shortTitle>
    <dcterms:title rdf:parseType="Literal">XXXXXX</dcterms:title>
    <dcterms:identifier>146</dcterms:identifier>
  </oslc_rm:RequirementCollection>
</rdf:RDF>

Now I convert it into Turtle to make it easier to read:

@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix oslc_rm: <http://open-services.net/ns/rm#> .
@prefix oslc:  <http://open-services.net/ns/core#> .

<https://hostname:8080/oslc/r/requirements?id=126>
        a                    oslc_rm:Requirement ;
        oslc:shortTitle      "XXXXXX" ;
        dcterms:created      "2018-11-23T08:56:28Z" ;
        dcterms:description  "XXXXXX" ;
        dcterms:identifier   "126" ;
        dcterms:modified     "2019-08-05T08:55:17Z" ;
        dcterms:subject      "Requirement" ;
        dcterms:title        126 .

<https://hostname:8080/oslc/r/requirementcollection?id=146>
        a                    oslc_rm:RequirementCollection ;
        oslc:shortTitle      "XXXXXX"^^rdf:XMLLiteral ;
        oslc_rm:uses         <https://hostname:8080/oslc/r/requirements?id=126> , <https://hostname:8080/oslc/r/requirements?id=125> ;
        dcterms:description  "XXXXXX"^^rdf:XMLLiteral ;
        dcterms:identifier   "146" ;
        dcterms:modified     "2006-10-24T17:14:00.0000000Z"^^xsd:dateTime ;
        dcterms:title        "XXXXXX"^^rdf:XMLLiteral .

<https://hostname:8080/oslc/r/requirements?id=125>
        a                    oslc_rm:Requirement ;
        oslc:shortTitle      "XXXXXX" ;
        dcterms:created      "2018-11-23T08:56:28Z" ;
        dcterms:description  "XXXXXX" ;
        dcterms:identifier   "XXXXXX" ;
        dcterms:modified     "2019-08-05T08:55:17Z" ;
        dcterms:subject      "Requirement" ;
        dcterms:title        125 .

The way you apply the oslc_rm:uses predicate is consistent with the spec: https://docs.oasis-open.org/oslc-domains/oslc-rm/v2.1/cs01/part2-requirements-management-vocab/oslc-rm-v2.1-cs01-part2-requirements-management-vocab.html#uses

Regarding the OSLC Resource Shape conformance for other properties, looks fine for the collection resource. You may also wish to use https://github.com/eclipse/lyo.validation to check Shape conformance.