[Developers] "Duck Types" in Freebase

Daniel O'Connor daniel.oconnor at gmail.com
Sat Aug 8 06:32:42 UTC 2009


On Sat, Aug 8, 2009 at 3:44 AM, Paul Houle <paul at ontology2.com> wrote:

>     Something I've seen in how types are used in Freebase and how the
> system pushes me to design schemas is a pattern similar to the "Duck
> Typing" used in many languages.  Rather than working out what sort of
> existing type is correct for the value of the property,  it often makes
> sense to define a new type.
>

When I'm doing this in RDF, I often find myself doing

<animal:Cat>
   <foaf:name>Fluffles</foaf:name>
   <!-- hmm, Fluffles is owned by me, but it's hard to say that all Cats
have owners. I should really refactor, but screw it; it's the same kind of
ownership as my TV. Except only one purrs -->
   <product:owner rdf:resource="#me" />
</animal:Cat>

IE: I'm not typing something as a Product, but I'm saying it has the same
"product ownership" as a Product.


It would break a lot of design choices made in freebase no doubt (thus:
wontfix!), but it would be create if I could use properties from another
Type without declaring whatever it is as a Type.


Alternatively, tweaking the wording so it's conceptually more like....

class Foo implements Cat, Product, FoafAgent {
   //
}

would be somewhat neat.

*/idle pondering which doesn't really help anything a great deal*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freebase.com/pipermail/developers/attachments/20090808/e368ca0c/attachment.htm 


More information about the Developers mailing list