[Developers] Querying schema + instances

Jason Douglas jason at metaweb.com
Tue Aug 19 01:07:51 UTC 2008


Does this do what you're asking for?

[{
     "type" : "/type/link",
     "target" : {
       "type" : "/common/webpage",
       "uri" : "http://www.freebase.com"
     },
     "master_property" : {
       "id" : null,
       "name" : null
     },
     "source" : {
       "id" : null,
       "name" : null
     }
}]

For these kinds of "survey the graph for patterns" questions, I  
usually find it easier to query the links rather than the objects.

-jason


On Aug 18, 2008, at 5:49 PM, Eynard, Davide wrote:

> Hi all,
>
> I'm trying to query all the topics which contain one
> "/common/webpage" in their schemas for some given URL,
> but I'm not having much success. My problem is that,
> given a URL, I'd like to find the topics that refer
> to that URL: however, they could refer to it as a
> normal weblink (as in /common/topic), as an IMDB film
> page (as in /film/film), as an artist page (as in
> /music/artist) and so on.
> I can easily get the list of types which contain one
> property that points to a /common/webpage:
>
> [
>  {
>    "id" : null,
>    "name" : null,
>    "properties" : [
>      {
>        "expected_type" : "/common/webpage",
>        "id" : null,
>        "name" : null
>      }
>    ],
>    "type" : "/type/type"
>  }
> ]
>
> So the basic approach I thought about was to try to
> build up a query based on this information. I have
> the type, the name of the property whose type is
> a webpage, so it should not be impossible to build an
> MQL query which will automatically adapt for any
> future schema. However, I was wondering if there was
> a way to do this only in MQL, without the need to
> pass though an external app.
>
> Any hints? :)
>
> Cheers,
>
> da
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers



More information about the Developers mailing list