OSLC: Correct usage/handling of RDF/XML with Javascript?
Hello,
I use Javascript to get Workitems and Artefacts with the help of OSLC. The Javascript Program is running in DNG Webinterface and is not a NodeJS App. Questions: * Currently I handle the RDF/XML presentation of a Workitem like normal XML...but in this case I lose the semantic. Are there other ways? * Is someone using RDF Javascript libraries like rdfstore.js or rdfquery? * The Namespaces inside RDF/XML make some problems with the XML handling (especially with JQuery), has someone a good solution for this? BTW, I saw the Javascript Implementation from Steve Speicher but this is NodeJS related Thx in advance Steve |
One answer
Hi Donald,
thanks for the valuable hints. You are right...I was mixing OSLC and Reporting/Query REST API regarding the XML (or JSON) presentation features. BTW, there is one bug in JQuery (Ticket #11166) when you append elements to RDF/XML: JQuery convert all element and attribute names to lowercase. Because in OSLC we use "Camelcase" like "oslc_rm:trackedBy" you will run in troubles that are hard to find, i.e. I append new links to DNG Artefacts and it doesn't work. Interesting you get "200 OK" back when you use "PUT" to update the DNG Artefact. Still have no solution for this (except string.replace). Thx Steve |
Your answer
Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.
Comments
Just a thought. CLM applications appear to use JSON, rather than RDF/XML, most of the time. Will it be easier if you switch over to JSON?
Hi Donald,
yes, JSON and Javascript fits perfect together, but it seems to me that not all OSLC API presentations support JSON. RDF/XML is allways supported. And also with JSON... I'm not sure if our OSLC JSON is JSON-LD?
Thx
I believe JSON is supported for all resources (artifacts). But if you are trying to run queries or reports, JSON may not be an option.
I am not sure about the JSON-LD bit. As a simple test, if I add "Accept: application/ld+json" as the request header, I will get an HTTP 406 "not acceptable" response. So I assume it is not JSON-LD.
Unfortunately, JSON is not available with DNG Artefacts.