[Developers] one query about two topics

John Giannandra jg at metaweb.com
Fri Aug 8 06:52:18 UTC 2008



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



More information about the Developers mailing list