It's all about the answers!

Ask a question

RM: OSLC fetch all properties ref IDs for a given artifact type


0
1
Buzz Moschetti (7625) | asked Jan 10 '13, 6:08 p.m.
Within a project area, I can see a creationFactory with an associated list of resourceShapes that are types /rm/types/$id.   These types appear to be all the artifact types.    Each one of those /rm/types/id when fetched produces a list of oslc:property.   The name and valueType are recognized as attributes appearing in my artifacts, including the custom attributes I set up in a new artifact type; OK.
Problem:   There's no indication of the name of the artifact type; thus, I cannot narrow the set of attributes that are relevant to a particular NAMED artifact (as opposed to using the ID).

So...  can anyone articulate how to get fetch the oslc:property tuples (i.e. all the attribute defs) for a SINGLE NAMED artifact type in RM?

One answer



permanent link
Sudarshan Rao (1963) | answered Jan 11 '13, 4:07 a.m.

Are you looking for a way to identify which named artifact type does the resource shape belong to, on a resource shape URI?

I don't see a way to do that directly without doing a get on the resource shape URI. But the result of GET on resource shape URI does have a tuple that would allow you to identify which named artifact type's properties they are, along with the bunch of oslc:properties it gets:

<dc:title rdf:parseType="Literal">Feature</dc:title>

Comments
Buzz Moschetti commented Jan 11 '13, 8:28 a.m.

Funny how when you step away and then look again, you see it.   Yes, the dc:title is in fact in there as a peer item to the oslc:property items (which irritatingly enough are not wrapped as a collection similar to other calls).   For some reason I simply did not see it before.

So I whipped it up and now it works.   I get the resourceShapes from the creationFactory, then iterate over them, ignoring all but the dc:title of the desired artifact type.   Functionally OK but there can be a performance hit, especially since my custom artifacts tend to end up at the BOTTOM of the list.  

Thanks.

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.