[Xesam] Metadata API draft

Mikkel Kamstrup Erlandsen mikkel.kamstrup at gmail.com
Wed Oct 8 12:21:45 PDT 2008


2008/10/8 Urho Konttori <urho.konttori at nokia.com>

> ext Jamie McCracken wrote:
>
>> Hi Urho,
>>
>> we need it because tracker needs to know service src/content and URI  at
>> creation time
>>
>> creating objects on the fly is not possible in tracker without above
>> info
>>
>>
> Yeah, I guess you are right. As the URI is there already in the SetMany, it
> *could* be added to the valuemap, but perhaps it's still better to keep the
> create.
>
> I feel that there are issues by having the SetMany without automatic
> creation of the objects (such as: one of the objects hasn't been created -
>  do you fail the entire SetMany, or do you somehow report unable to set the
> one or several failed ones. )


Yeah, the semantics about the transactions is important to get right. In
fact we have the same problem in the simple Set() method. What if one of the
supplied fields doesn't exist in the ontology? Will the rest of the fields
still be set?

The only thing that makes sense to me is to make it fully transactional (or
come up with a smarter API). Ie the server must check that everything is
a-ok before committing to the database. A non-transactional API would be a
pita to code against.

As an app developer I can definitely live with the entire transaction
failing in SetMany() since if it fails it is because of a bug in my code.
Given the server returns a good error message it should be easy to debug.



>
> I'm not opposed to the create methods, just that I think that object
> without any property doesn't justify its own existence and should be
> preferably automatically weeded out.
>

Well an object will always hold a minimum of information:

 * It exists
 * Source category
 * Content category

If it is created via the proposed API it will also have a non-empty uri
field (although it is unclear whether this uri is xesam:url or some other
field). These four items alone can actually be used for quite a lot.

Cheers,
Mikkel


>> On Tue, 2008-10-07 at 12:27 +0300, Urho Konttori wrote:
>>
>>
>>> ext Mikkel Kamstrup Erlandsen wrote:
>>>
>>>
>>>> Hi,
>>>>
>>>> A few of us made a more or less complete draft of a Xesam Metadata
>>>> API. I just brushed it up a bit. You can now find it here:
>>>> http://xesam.org/main/XesamMetadataAPI
>>>>
>>>> Please comment.
>>>>
>>>>
>>>>
>>> I'm really interested in why do we need to have the explicit create
>>> method? Shouldn't all objects/nodes anyway have some property to have the
>>> reason why they were/are created? If so, shouldn't we just use the set
>>> method and explicitly mention that if setting properties for an object that
>>> doesn't exist, the object will be created automatically? Engines will anyway
>>> need to lookup the objects from the database, so they might just as well
>>> trigger the creation of the object while they are at it.
>>>
>>> Also, should we consider allowing xml based graph injection?
>>>
>>> Anyway, looking good already.
>>> _______________________________________________
>>> Xesam mailing list
>>> Xesam at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/xesam
>>>
>>>
>>
>>
>>
>
>


-- 
Cheers,
Mikkel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/xesam/attachments/20081008/d7e0a2a6/attachment.htm 


More information about the Xesam mailing list