Skip to content
David Leoni edited this page Feb 13, 2014 · 32 revisions

Note: all the following is very much work in progress

Mapping Refine Multiple Queries

Mapping Refine Service metadata

Mapping Refine Suggest service


Refine wiki info about reconciliation is quite complete except for the suggest api. More info can be found in Freebase Search API page

Mapping Refine multiple queries

To try out queries against freebase: http://standard-reconcile.freebaseapps.com/

Possible multiple query:

http://reconcile.freebaseapps.com/reconcile?queries={ "q0" : {     "query" : "Ford Taurus",     "limit" : 3,     "type" : "/automotive/model",     "type_strict" : "any",     "properties" : [       { "p" : "year", "v" : 2009 },       { "pid" : "/automotive/model/make" , "v" : { "id" : "/en/ford" } }     ] }, "q1" : { "query" : "bar" } }

query mapping:

type -> entityTypeId?

type_strict meaning?

properties:

pid -> attributeDefId?

queries parameter in a nice format:

{
   "q0":{
      "query":"Ford Taurus",
      "limit":3,
      "type":"/automotive/model",
      "type_strict":"any",               
      "properties":[
         {
            "p":"year",            
            "v":2009
         },
         {
            "pid":"/automotive/model/make",   
            "v":{                               
               "id":"/en/ford"
            }
         }
      ]
   },
   "q1":{
      "query":"bar"
   }
}

Answer:

{
  "q0" : {
    "result" : [
      {
        "id" : "/m/014_d3",
        "name" : "Ford Taurus",
        "type" : [
          {
            "id" : "/common/topic",
            "name" : "Topic"
          },
          {
            "id" : "/automotive/model",
            "name" : "Automobile Model"
          }
        ],
        "notable" : [
          {
            "id" : "/automotive/model",
            "name" : "Automobile Model"
          }
        ],
        "score" : 2.4281224,
        "match" : false
      },
      {
        "id" : "/m/0275mp",
        "name" : "Ford Five Hundred",
        "type" : [
          {
            "id" : "/common/topic",
            "name" : "Topic"
          },
          {
            "id" : "/base/cars_refactor/model",
            "name" : "Model"
          }
        ],
        "notable" : [
          {
            "id" : "/m/021mp2",
            "name" : "Sedan"
          }
        ],
        "score" : 9.808981E-4,
        "match" : false
      },
      {
        "id" : "/m/0403m49",
        "name" : "Ford Taurus SHO",
        "type" : [
          {
            "id" : "/common/topic",
            "name" : "Topic"
          },
          {
            "id" : "/automotive/model",
            "name" : "Automobile Model"
          },
          {
            "id" : "/base/cars_refactor/model",
            "name" : "Model"
          }
        ],
        "notable" : [
          {
            "id" : "/automotive/model",
            "name" : "Automobile Model"
          }
        ],
        "score" : 1.36315155E-6,
        "match" : false
      }
    ]
  },
  "q1" : {
    "result" : [
      {
        "id" : "/m/0h3xdcp",
        "name" : "Bár",
        "type" : [
          {
            "id" : "/common/topic",
            "name" : "Topic"
          },
          {
            "id" : "/tv/tv_program",
            "name" : "TV Program"
          }
        ],
        "notable" : [],
        "score" : 4.7746744,
        "match" : false
      },
      {
        "id" : "/m/07sm5yh",
        "name" : "BAR",
        "type" : [
          {
            "id" : "/base/wordnet/word",
            "name" : "word"
          }
        ],
        "notable" : [],
        "score" : 1.9763323,
        "match" : false
      },
      {
        "id" : "/m/02vjrgz",
        "name" : "bar",
        "type" : [
          {
            "id" : "/type/property",
            "name" : "Property"
          }
        ],
        "notable" : [],
        "score" : 1.9321159,
        "match" : false
      }
    ]
  },
  "duration" : 203
}

Mapping Refine Service metadata

Returns a description of reconciliation and suggestion services.

Example for Freebase:

http://standard-reconcile.freebaseapps.com/reconcile
{
  "name": "Freebase Reconciliation Service",
  "identifierSpace": "http://rdf.freebase.com/ns/type.object.mid",
  "schemaSpace": "http://rdf.freebase.com/ns/type.object.id",
  "view": {
    "url": "http://www.freebase.com/view{{id}}"
  },
  "preview": {
    "url": "http://www.freebase.com/widget/topic{{id}}?mode=content",
    "width": 430,
    "height": 300
  },
  "suggest": {
    "property": "http://standard-reconcile.freebaseapps.com/suggest_property"
  },
  "defaultTypes": [
    {
      "id": "/people/person",
      "name": "Person"
    },
    {
      "id": "/location/location",
      "name": "Location"
    }
  ]
}

Mapping Refine Suggest service

suggest attribute defs when reconciling a column

WE DON'T NEED TO IMPLEMENT THIS NOW

Example resource:

name birthplace country of residence
String Location Location
David Trento Italy

When reconciling birthplace, supposing Location has country as attribute, we should suggest country as attribute of birthplace location

Column Include? As Property
Country of Residence X Country

Guess column type

WE DON'T NEED TO IMPLEMENT THIS NOW (it's already handled in our schema matching part)

Suggest entities

Given a partial name (amd maybe a type?), gives list of candidate entities

Think we can use our multi query implementation for this.

Mapping Refine Preview service

Gives back info about a particular entity

WE DON'T NEED TO IMPLEMENT THIS NOW, CAN USE REGULAR GetEntity CALLS

Example query:


https://www.googleapis.com/freebase/v1/topic/en/apple_inc?filter=suggest

Response (edited, was too long):

notice response here has two articles by different users

{
 id: "/m/0k8z",
 property: {
    "/common/topic/article":{
       "valuetype":"compound",
       "values":[
          {
             "text":"Apple Inc., (NASDAQ: AAPL) formerly Apple Computer Inc., is an American multinational...",
             "lang":"en",
             "id":"/m/062z310",
             "creator":"/user/vtalwar",
             "timestamp":"2012-01-31T23:27:07.000Z",
             "property":{
                "/common/document/content":{
                   "valuetype":"object",
                   "values":[
                      {
                         "text":"/m/062z31x",
                         "lang":"",
                         "id":"/m/062z31x",
                         "creator":"/user/rcheramy",
                         "timestamp":"2009-05-27T02:14:22.000Z"
                      }
                   ],
                   "count":1
                },
                "/common/document/text":{
                   "valuetype":"string",
                   "values":[
                      {
                         "text":"Apple Inc., (NASDAQ: AAPL) formerly Apple Computer Inc., is an American multinational...",
                         "lang":"en",
                         "value":"Apple Inc., this is the long description bla bla bla bla bla blabla bla blabla bla blabla bla blabla bla bla",
                         "creator":"/user/content_administrator",
                         "timestamp":"2009-05-27T02:14:22.000Z"
                      }
                   ],
                   "count":1
                },
                "/common/document/updated":{
                   "valuetype":"datetime",
                   "values":[
                      {
                         "text":"2009-05-27T02:14:22.272398Z",
                         "lang":"",
                         "value":"2009-05-27T02:14:22.272398Z",
                         "creator":"/user/rcheramy",
                         "timestamp":"2009-05-27T02:14:22.000Z"
                      }
                   ],
                   "count":1
                },
                "/type/object/attribution":{
                   "valuetype":"object",
                   "values":[
                      {
                         "text":"rcheramy",
                         "lang":"",
                         "id":"/m/023b82j",
                         "creator":"/user/rcheramy",
                         "timestamp":"2009-05-27T02:12:55.000Z"
                      }
                   ],
                   "count":1
                },
                "/type/object/type":{
                   "valuetype":"object",
                   "values":[
                      {
                         "text":"Document",
                         "lang":"",
                         "id":"/common/document",
                         "creator":"/user/rcheramy",
                         "timestamp":"2009-05-27T02:12:55.000Z"
                      }
                   ],
                   "count":1
                }
             }
          },
          {
             "text":"Apple Inc. (NASDAQ: AAPL; formerly Apple Computer, Inc.) is an American multinational...",
             "lang":"en",
             "id":"/m/0j3ny16",
             "creator":"/user/mwcl_wikipedia_en",
             "timestamp":"2012-03-06T07:01:34.000Z",
             "property":{
                "/common/document/source_uri":{
                   "valuetype":"uri",
                   "values":[
                      {
                         "text":"http://wp/en/856",
                         "lang":"",
                         "value":"http://wp/en/856",
                         "creator":"/user/mwcl_wikipedia_en",
                         "timestamp":"2012-03-06T07:01:34.000Z"
                      }
                   ],
                   "count":1
                },
                "/common/document/text":{
                   "valuetype":"string",
                   "values":[
                      {
                         "text":"Apple Inc. (NASDAQ: AAPL; formerly Apple Computer, Inc.) is an American multinational...",
                         "lang":"en",
                         "value":"Apple Inc., this is the long description bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla bla ",
                         "creator":"/user/mwcl_wikipedia_en",
                         "timestamp":"2012-03-06T07:01:34.000Z"
                      }
                   ],
                   "count":1
                },
                "/type/object/attribution":{
                   "valuetype":"object",
                   "values":[
                      {
                         "text":"Freebase Data Team",
                         "lang":"",
                         "id":"/m/0j3ny02",
                         "creator":"/user/mwcl_wikipedia_en",
                         "timestamp":"2012-03-06T07:01:34.000Z"
                      }
                   ],
                   "count":1
                },
                "/type/object/type":{
                   "valuetype":"object",
                   "values":[
                      {
                         "text":"Document",
                         "lang":"",
                         "id":"/common/document",
                         "creator":"/user/mwcl_wikipedia_en",
                         "timestamp":"2012-03-06T07:01:34.000Z"
                      }
                   ],
                   "count":1
                }
             }
          }
       ],
       "count":2
    },
    "/common/topic/image":{
       "valuetype":"object",
       "values":[
          {
             "text":"200px-Apple_svg.png",
             "lang":"en",
             "id":"/m/0dlbyhs",
             "creator":"/user/detroiter313",
             "timestamp":"2010-11-07T22:41:46.000Z"
          },
          {
             "text":"200px-Apple_Computer_Logo_rainbow_svg.png",
             "lang":"en",
             "id":"/m/0dlbyhd",
             "creator":"/user/detroiter313",
             "timestamp":"2010-11-07T22:41:26.000Z"
          },
          {
             "text":"Apple_first_logo.png",
             "lang":"en",
             "id":"/m/0dlbyjl",
             "creator":"/user/detroiter313",
             "timestamp":"2010-11-07T22:42:19.000Z"
          }
       ],
       "count":3
    },
    "/common/topic/notable_for":{
       "valuetype":"object",
       "values":[
          {
             "text":"Computer hardware",
             "lang":"en",
             "id":""
          }
       ],
       "count":1
    },
    "/common/topic/notable_types":{
       "valuetype":"object",
       "values":[
          {
             "text":"Video Game Developer",
             "lang":"en",
             "id":"/cvg/cvg_developer"
          }
       ],
       "count":1
    },
    "/type/object/name":{
       "valuetype":"string",
       "values":[
          {
             "text":"Apple",
             "lang":"en",
             "value":"Apple",
             "creator":"/user/lysong",
             "timestamp":"2013-09-27T12:34:57.000Z"
          }
       ],
       "count":43
    },
    "/type/object/type":{
       "valuetype":"object",
       "values":[
          {
             "text":"Operating System Developer",
             "lang":"en",
             "id":"/computer/operating_system_developer",
             "creator":"/user/gardening_bot",
             "timestamp":"2009-10-14T22:20:50.001Z"
          },
          {
             "text":"Product brand",
             "lang":"en",
             "id":"/user/robert/mobile_phones/product_brand",
             "creator":"/user/gardening_bot",
             "timestamp":"2009-10-14T22:20:52.000Z"
          },
          {
             "text":"Ad Agency",
             "lang":"en",
             "id":"/user/micahsaul/advertising/ad_agency",
             "creator":"/user/jluish",
             "timestamp":"2014-01-14T16:40:03.000Z"
          }
       ],
       "count":3
    }
 }
}
Clone this wiki locally