[Data-modeling] surprised that I could assign properties without also typing an object with the property's parent type
Reilly Hayes
rfh at metaweb.com
Thu Jul 16 16:43:16 UTC 2009
The client uses types to organize the display of properties.
Properties on objects that do not have the corresponding type asserted
will not show up.
MQL uses types to decode unqualified property names (among other
things). In the case you've created, only the fully qualified
property name will work.
This works:
> [{
> id : "/en/wie_schon_leuchtet_der_morgenstern",
> "/base/jsbach/bach_composition/bwv" : null
> }]
This fails to find the object (because it is not of the right type):
> [{
> id : "/en/wie_schon_leuchtet_der_morgenstern",
> type: "/base/jsbach/bach_composition",
> "bwv" : null
> }]
This gets an error because the property name "bwv" isn't in /type/
object:
> [{
> id : "/en/wie_schon_leuchtet_der_morgenstern",
> "bwv" : null
> }]
This gets an error because the property name "bwv" isn't in /common/
topic:
> [{
> id : "/en/wie_schon_leuchtet_der_morgenstern",
> "type" : "/common/topic",
> "bwv" : null
> }]
-r
On Jul 16, 2009, at 9:22 AM, John Giannandrea wrote:
>
> Raymond Yee wrote:
>> The question I was mulling this morning was whether a Freebase object
>> can be assigned properties without also being typed with the
>> property's
>> parent type.
>
> Yes, MQL does not enforce that an object is typed any particular way.
> The type system is non-normative.
> Sometimes we refer to this feature as "bare properties" that you can
> have any specific property regardless of your types.
>
> The freebase.com application will assert a type on the target topic
> when you enter a topic value in a property field. It does this by
> using the expected_type property of /type/property to figure out what
> the destination type should be. MQL is acting at a lower level and
> does not enforce that.
>
> -jg
>
>
> _______________________________________________
> Data-modeling mailing list
> Data-modeling at freebase.com
> http://lists.freebase.com/mailman/listinfo/data-modeling
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2434 bytes
Desc: not available
Url : http://lists.freebase.com/pipermail/data-modeling/attachments/20090716/515f96da/attachment.bin
More information about the Data-modeling
mailing list