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!
andrew
August 13, 2019, 2:20pm
2
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:shortTitle XXXXXX</oslc:shortTitle>
dcterms:created 2018-11-23T08:56:28Z</dcterms:created>
dcterms:description XXXXXX</dcterms:description>
dcterms:identifier XXXXXX</dcterms:identifier>
dcterms:modified 2019-08-05T08:55:17Z</dcterms:modified>
dcterms:subject Requirement</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:shortTitle XXXXXX</oslc:shortTitle>
dcterms:created 2018-11-23T08:56:28Z</dcterms:created>
dcterms:description XXXXXX</dcterms:description>
dcterms:identifier 126</dcterms:identifier>
dcterms:modified 2019-08-05T08:55:17Z</dcterms:modified>
dcterms:subject Requirement</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
andrew
August 22, 2019, 11:19pm
4
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.