How to know the class of an entity?

Petter Reinholdtsen pere at hungry.com
Wed May 24 00:25:45 CEST 2017


[Thomas Sødring]
> So it is possible to filter out saksmappe.

We seem to be making different assumtions.  I assume the only class
names / identifiers a API client can depend on is the value of the rel
attribute, while you seem to assume a specific structure of the value of
the href attribute.  As far as I can tell from the spec, this is also 
valid _links content of a conforming implementation, without any
identifying parts in href:

  rel : http://rel.kxml.no/noark5/v4/api/sakarkiv/saksmappe/
  href : http://localhost:8092/a/b/c/1d7610f4-9bb0-4044-959d-4e79ab86a228/

There is nothing in the spec that specify what the content of the href
should look like.  Thus I wonder how a client depending on what is
dokumented in the specification can figure out what the class of a given
entity is.  And for this, I believe class type must be derived from the
rel values, not the href values.  Do you agree?

This is the background for my idea of using duplicate hrefs with 'self'
and the class name in rel, ie something like this:

  rel : http://rel.kxml.no/noark5/v4/api/sakarkiv/saksmappe/
  href : http://localhost:8092/a/b/c/1d7610f4-9bb0-4044-959d-4e79ab86a228/

  rel : self
  href : http://localhost:8092/a/b/c/1d7610f4-9bb0-4044-959d-4e79ab86a228/

I believe this approach would work, but is there some other way to
determine the class of a entity that is dokumented in the spec?

> We do however still need to be able to just retrieve saksmappe from
> arkivdel.

Yes.  The lack of a way to get the saksmappe entities is blocking the
postliste.html client from getting access to the journalpost metadata.
Would love to have this in place. :)

I would also like the client to depend on what is documented in the
spec, as much as possible.

-- 
Happy hacking
Petter Reinholdtsen


More information about the nikita-noark mailing list