Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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

0 votes

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.  



One answer

Permanent link
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

0 votes

Your answer

Register or log in to post 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Jan 16 '15, 4:36 a.m.

Question was seen: 4,708 times

Last updated: Jan 25 '15, 8:40 a.m.

Confirmation Cancel Confirm