[Developers] one query about two topics

Jack Alves jack.alves at gmail.com
Tue Aug 12 23:14:10 UTC 2008


JG, I can't tell if the query you sent works for what I want to do.
When I do my query I get things like what is below. I can't figure out
how to modify your query to get the same data.

 {
    "mates:/type/reflect/any_master" : [
      {
        "link" : [
          {
            "master_property" : {
              "id" : "/film/performance/actor",
              "name" : "Actor",
              "schema" : {
                "domain" : {
                  "id" : "/film",
                  "name" : "Film"
                }
              }
            }
          }
        ],
        "name" : "Spencer Tracy"
      }
    ],
    "name" : null,
    "others:/type/reflect/any_master" : [
      {
        "name" : "Global Write Permission",
        "type" : [
          "/type/permission"
        ]
      },
      {
        "name" : "Film performance",
        "type" : [
          "/type/type",
          "/freebase/type_profile"
        ]
      },
      {
        "name" : "Woman of the Year",
        "type" : [
          "/common/topic",
          "/film/film",
          "/award/award_nominated_work",
          "/user/robert/american_comedy/movie"
        ]
      },
      {
        "name" : "Spencer Tracy",
        "type" : [
          "/common/topic",
          "/people/person",
          "/film/actor",
          "/people/deceased_person",
          "/award/award_winner",
          "/award/award_nominee"
        ]
      }
    ],
    "type" : [
      {
        "/freebase/type_hints/mediator" : [
          true
        ],
        "name" : "Film performance"
      }
    ]
  }



On Thu, Aug 7, 2008 at 11:52 PM, John Giannandra <jg at metaweb.com> wrote:
>
>
> I think you want something like this, all links leaving 9202a8c04000641f8000000000056d07 and all links in and out of the thing that you are connected to.
> -jg
>
>
> [{
>        "type":"/type/link",
>        "source":{"id":"/guid/9202a8c04000641f8000000000056d07"},
>        "target":{
>                "id":null,
>                "a:/type/reflect/any_reverse":{"id":"/guid/9202a8c04000641f800000000005b44f", "optional":"true"},
>                "b:/type/reflect/any_master":{"id":"/guid/9202a8c04000641f800000000005b44f", "optional":"true"}
>        },
>        "master_property":null
> }]
>
>
>
> ----- Original Message -----
> From: "Jack Alves" <jack.alves at gmail.com>
> To: developers at freebase.com
> Sent: Thursday, August 7, 2008 10:41:28 AM (GMT-0800) America/Los_Angeles
> Subject: [Developers] one query about two topics
>
> Just for kicks I am trying to create a single query that will return
> all topics linked to either of two specified topics, and if a cvt is
> returned I want to know the sibling topics. I want to show all topics
> they have in common and topics they don't have in common. For example,
> if I specify Katharine Hepburn and Spencer Tracy I get get a bunch of
> quotations from Katharine, and Film Performance mediators for both of
> them. When I get a mediator I want to figure out what topic to display
> ("Bringing up Baby").
>
> I tried a variety of things and wrote the convoluted query below. Can
> you suggest a more straight forward approach? Would a different query
> return quicker?
>
> The guids below are Katharine Hepburn and Spencer Tracy.
>
>
>
> [
>  {
>    "limit" : 50,
>    "mates:/type/reflect/any_master" : [
>      {
>        "guid|=" : [
>          "#9202a8c04000641f8000000000056d07",
>          "#9202a8c04000641f800000000005b44f"
>        ],
>        "link" : [
>          {
>            "master_property" : {
>              "id" : null,
>              "name" : null,
>              "schema" : {
>                "domain" : {
>                  "id" : null,
>                  "name" : null
>                }
>              }
>            }
>          }
>        ],
>        "name" : null
>      }
>    ],
>    "name" : null,
>    "others:/type/reflect/any_master" : [
>      {
>        "name" : null,
>        "type" : []
>      }
>    ],
>    "sort" : "-others:/type/reflect/any_master.name",
>    "type" : [
>      {
>        "/freebase/type_hints/mediator" : [],
>        "name" : null
>      }
>    ]
>  }
> ]
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
>
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
>


More information about the Developers mailing list