Where is the schema or shape defined for non-standard OSLC objects?
I'm playing around with RTC OSLC 2.0 API, and I have retrieved a work item.
Accepted answer
The work item's RDF should include a oslc:resourceShape statement to an OSLC Resource Shape.
Where an OSLC resource has relationships to other resources, the shape should have an OSLC property that describes that relationship. Implementations might specify an oslc:range and/or oslc:valueShape for that property. Looking at a work item resource shape I see it includes:
<https://jazz.net/jazz/oslc/shapes/workitems/_i6im8MhlEeu9RY6EqQ8OtA/property/projectArea>
a oslc:Property ;
oslc:allowedValues <https://jazz.net/jazz/oslc/shapes/workitems/_i6im8MhlEeu9RY6EqQ8OtA/property/projectArea/allowedValues> ;
oslc:name "project"^^<http://www.w3.org/2001/XMLSchema#string> ;
oslc:occurs oslc:Zero-or-one ;
oslc:propertyDefinition
<http://open-services.net/ns/cm-x#project> ;
oslc:range <http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/Project> ;
oslc:readOnly "true"^^<http://www.w3.org/2001/XMLSchema#boolean> ;
oslc:representation oslc:Either ;
oslc:valueType oslc:Resource ;
dcterms:title "Project Area"^^rdf:XMLLiteral .
So that specifies a range. Best practice is to reference a range that is GETtable with an RDF media type, but that doesn't appear to be the case here.
Performing a GET of a project area with Accept=text/turtle shows RDF that does not include a reference to a resource shape. It would be best practice to include a reference to an instance shape. But it is what it is.
You can get the Ontology for a project area (and other process types) by performing a GET with Accept=text/turtle on http://jazz.net/ns/process#.
It's also worth noting that project area is a Jazz concept, not an OSLC defined one. None of the OSLC specifications define project areas or similar containers.
Comments
Another thing to mention, is that the more standard RDF property to reference a project is process:projectArea. There is an OSLC property for that:
<https://jazz.net/jazz/oslc/shapes/workitems/_i6im8MhlEeu9RY6EqQ8OtA/property/process_projectArea>
a oslc:Property ;
oslc:name "projectArea"^^<http://www.w3.org/2001/XMLSchema#string> ;
oslc:occurs oslc:Zero-or-one ;
oslc:propertyDefinition
<http://jazz.net/ns/process#projectArea> ;
oslc:range <http://jazz.net/ns/process#ProjectArea> ;
oslc:readOnly "true"^^<http://www.w3.org/2001/XMLSchema#boolean> ;
oslc:representation oslc:Either ;
oslc:valueType oslc:Resource ;
dcterms:title "Project Area"^^rdf:XMLLiteral .
And as mentioned before, you can GET
http://jazz.net/ns/process#ProjectArea
to see the Ontology. I also found a resource shape for project areas at http://jazz.net/ns/process/shapes/ProjectArea.
As a tangential comment, I strongly discourage everyone from using the term "project" when referring to an ELM "project area". Almost every company/team uses the term "project", and they virtually never mean an object that corresponds to "project area". In particular, if you create a "project area" for each of your projects, it is almost always the wrong thing to do. In most cases, multiple "projects" will be run inside of a single project area, and in many cases, a "project" will require the use of many project areas. Calling a "project area" a "process area" is very reasonable (and arguably would have been a significantly better choice than "project area", but it is probably too late to make that change).
1 vote
Thanks a lot David - that seems really helpful. In particular I hadn't put together that following the shape of the original item could clue you in about related items.