It's all about the answers!

Ask a question

Creating Modules in dng using OSLC


Sagnick Banerjee (1112) | asked Jan 22 '18, 1:47 a.m.

Can anyone help me how to create modules in dng using eclipse lyo [oslc], programatically?

2 answers



permanent link
Donald Nong (14.5k614) | answered Jan 22 '18, 6:29 p.m.

Module is not part of the OSLC specification. You can take a look at the new Module API introduced in DNG 6.0.5.
https://jazz.net/wiki/bin/view/Main/DNGModuleApiOverview
https://jazz.net/wiki/bin/view/Main/DNGModuleAPI


permanent link
Lonnie VanZandt (88717) | answered Jan 22 '18, 7:16 p.m.

 Here's the sketch of an algorithm:


find the URI of the ResourceShape for the InstanceShape of your new Module;
find the URI of the Parent folder for the new Module;
find the URI of the ProjectArea Component that the new Module will be within;

Response postResponse = Stream.of( componentUri )
.map( cu -> OslcOauthGet( cu ) )
.map( cmp -> cmp.getServiceProvider() )
.map( spu -> OslcOauthGet( spu ) )
.flatMap( sp -> Arrays.stream( sp.getServices() ) )
.flatMap( srv -> srv.getCreationFactories() )
.filter( cf -> isForOslcComponent( componentUri ) )
.filter( cf -> isForRdfType( "http://open-services.net/ns/rm#RequirementCollection" ) )
.filter( cf -> cf.getCreation() ) .first()
.map( cfu -> {
blankNodeModule = RdfXmlModule.newForType( "http://jazz.net/ns/rm#Module" ).parent( parentUri ).shape( moduleInstanceShapeUri ).title( "My New Module" );
return OslcOauthPost( cfu ).body( blankNodeModule ).type( TextTurtle etc );
} )
.orElseThrow( "ask for help, don't give up hope. this can be done." );

Your answer


Register or 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.