[Hawkular-dev] Serialization format for inventory relations

Heiko W.Rupp hrupp at redhat.com
Thu Apr 23 08:28:20 EDT 2015


On 23 Apr 2015, at 13:19, Jiri Kremser wrote:

> exposing the relationships. Although, it's not probably the use case 
> the REST was designed for (relations are not resources), I would like

No, but relations are links

Link: rel="child", href="http://bla/bla"


Are you talking here about exposing the relationships only?
If you don't plan to include the resources in the result,
would be a list of links not enough?

> Here is an example of 1 relation/edge:
>
> {
> "@context": {
>  "inv": "http://hawkular.org/inventory/0.0.1",
>  "baseUrl": "http://127.0.0.1:8080/hawkular/inventory/"
> },
> "@id": "baseUrl:relationships/1337",
> "inv:shortId": "2",
> "@type": "inv:Relationship",
> "inv:source": {
>  "@id": "baseUrl:tenants/acme",
>  "@type": "inv:Tenant",
>  "inv:shortId": "acme"
> },
> "inv:label": "contains",
> "inv:target": {
>  "@id": "baseUrl:acme/resourceTypes/URL",
>  "@type": "inv:ResourceType",
>  "inv:shortId": "URL"
> },

This doesn't really show me its strengths at the moment and looks
bloated. But perhaps the strength is that the relationship target
has its type supplied?

Do we expect to use some existing clients to browse and visualize
our inventory using JSON-LD?

The other question is if the query is 'give me all related entities to 
this entity'
as you describe above, should we really "only" return the links? Or how
will we treat the fetching of the target entities? Can they optionally 
be
embedded in the answer?


More information about the hawkular-dev mailing list