Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [lyo-dev] How to optimize retrieval of ResourceShapes

Hi Nils,

Does it take 600ms to fetch the resource shape and parse each time?  One alternative is to simply to keep a local cache of the ResourceShapes as they do not vary much from the resources themselves.  Instead of fetching directly from RTC, you just look up from your local cache (assuming the key would be the URL for the ResourceShape).   I'd need to do some testing with RTC and possibly some other implementations to see how much they really vary their shapes per resource.  You can do an occasional GET/HEAD on the shape to see if it has changed to keep your cache fresh.  You might be able to break things apart in the resource shape and reuse this cache for these pieces, property definitions, vocabulary terms, etc as they all should be URL addressable and therefore cacheable.

- Steve Speicher


On Wed, Sep 4, 2013 at 4:46 AM, Nils Kronqvist <nissekronqvist@xxxxxxxxxxx> wrote:
Hi,

As I understand it, one difference between OO's relation between instances of a class and the Class, and rdf's relation between Resource and it's optional ResourceShape, is that the ResourceShape can be unique for a specific Resource. E.g. if trying to get the http://open-services.net/ns/core#occurs value for a specific Property of Resource A, I have to get the ResourceShape for A and check the occurs value.

In case you are retrieving a list of resources and want to check properties for each resource, it's a significant cost to have to retrieve the ResourceShape for each resource. In my case, using RTC's OSLC CM, the rdf for the ResourceShape of a ChangeRequest takes about 600ms to read, where the Resource takes about 100ms.

Any room for implementation shortcuts here?

You could look for the rdf:type and in case of ChangeRequest also for dcterms:type - very likely that a ResourceShape from the same ServiceProvider, for the same rdf:type and dcterms:type will have the same Property definitions. So in this case you *likely* can cache the ResourceShape. Does NOT feel robust however.

Or you have to limit what you can assume about the resources retrieved, rethinking some presentation options when dealing much data retrieved. Making it less usable though.

Other options?

Rgs,

/Nils K 

_______________________________________________
lyo-dev mailing list
lyo-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/lyo-dev



Back to the top