how to know which prefix to use against fieldnames while accessing Rest API for IBM RTC
While creating a new workitem or accessing the existing workitem, how to decide which prefix to use along with fieldsname, because each request has its own prefix response(mostly fix like OSLC,RDF etc.), are they subject to change in future.
For e.g. when I get the rest response of a workitem
list of prefixes
"prefixes": {
"process": "http://jazz.net/ns/process#",
"acp": "http://jazz.net/ns/acp#",
"oslc_cmx": "http://open-services.net/ns/cm-x#",
"rtc_cm": "http://jazz.net/xmlns/prod/jazz/rtc/cm/1.0/",
"oslc_pl": "http://open-services.net/ns/pl#",
"oslc_cm": "http://open-services.net/ns/cm#",
"oslc": "http://open-services.net/ns/core#",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"acc": "http://open-services.net/ns/core/acc#",
"dcterms": "http://purl.org/dc/terms/",
"rtc_ext": "http://jazz.net/xmlns/prod/jazz/rtc/ext/1.0/"
},
so how to decide which prefix to use for accessing fields say for eg. title will come as dcterms:title and any custom field of RTC will come as rtc_ext,
one way is to use the URL of prefix and decide, but what will happen if the URL also changes.
let me know if there is a better/robust way of achieving this.
One answer
Ashish,
The OSLC standards define the namespaces and preferred prefixes for OSLC Core and each of the Domains (Requirements Management, Architecture Management, Change Management, Quality Management, etc.). The namespaces for these specifications is not subject to change, but any given tool might choose to use a different prefix as these don't carry any semantic meaning - they're just text substitution.
For tools that provide extension and their own namespaces and prefixes, you have the prefixes specified in the RDF resource representations. To know what actual resources are in that namespace, you can look at the various ServiceProvider documents provided by the tools through OSLC discovery, and see what namespaces and prefixes are used in the creation factories and query bases, as well as the associated resource shapes (if any).