Bug 30263 - New class nie:StoredDataObject to store data objects in the database directly
Summary: New class nie:StoredDataObject to store data objects in the database directly
Status: NEW
Alias: None
Product: shared-desktop-ontologies
Classification: Unclassified
Component: nie (show other bugs)
Version: unspecified
Hardware: Other All
: medium enhancement
Assignee: shared-desktop-ontologies-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-19 04:26 UTC by Sebastian Trüg
Modified: 2011-01-10 01:00 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Patch implementing the proposal (1.71 KB, patch)
2010-09-19 04:26 UTC, Sebastian Trüg
Details | Splinter Review

Description Sebastian Trüg 2010-09-19 04:26:13 UTC
Created attachment 38796 [details] [review]
Patch implementing the proposal

Currently nie:DataObjects need to be stored in some desktop resource like a file. However, there are cases when one wants to store a DataObject in the database itself.
Thus, there is the need for a StoredDataObject and corresponding properties that store the data itself. the attached patch introduces exactly that.

An example usage is storing avatar photos for IM contacts directly in the RDF data.
Comment 1 phreedom.stdin 2010-12-19 22:00:44 UTC
An alternative is to use data:// URI scheme to store the data directly, especially since such a stored object won't have any other URI(unless we come up with something).

A related use case that we need to consider is storing a copy of data in the database.

It can be implemented by 2 DOs: one with data:// URI and another the "real" one, both linked together by copy relationship.

Alternatively, it can be implemented by a slight tweak of your proposal: introduce also nie:CachedDataObject to differentiate cached DOs from the ones primarily stored in the database; or change nie:textContent and nie:binaryContent domain to nie:DataObject to let you freely store caches and use StoredDataObject as a marker for DOs primarily stored in the database.

Caches, however, tend to get out of date, especially if we talk about remote resources. Should we care? Should we store the last fetch date? Where should we store it: DO itself or use existing graph metadata?

Ideas?

Sorry for derailing such a simple change request but it's really a close topic.
Comment 2 Sebastian Trüg 2011-01-04 01:56:06 UTC
I do not follow your data:// approach. Where would the data actually be stored then? In the URI itself?

Do you have a use case for the caching idea?
If so I would be fine with introducing CachedDataObject and changing the domain of the properties to nie:DataObject.
Comment 3 phreedom.stdin 2011-01-08 23:51:46 UTC
(In reply to comment #2)
> I do not follow your data:// approach. Where would the data actually be stored
> then? In the URI itself?

http://en.wikipedia.org/wiki/Data_URI_scheme

> Do you have a use case for the caching idea?
> If so I would be fine with introducing CachedDataObject and changing the domain
> of the properties to nie:DataObject.

I was thinking about Akonadi here and their desire to use Virtuoso, or some nepomuk services working with remote resources. Won't they want to keep cached copies around?
Comment 4 Sebastian Trüg 2011-01-10 01:00:55 UTC
If I understand correctly we could just put a data: URI into the nie:url property and KIO would properly load the data. That would indeed be simple and not really require new types.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.