Null values from MQL query to business/sponsored_recipient/sponsorship

106 views Asked by At

I am running a simple query about Skateboarder Steve Caballero

https://www.freebase.com/m/0qmzf

Which has a property of the type https://www.freebase.com/business/sponsored_recipient/sponsorship?schema=

In freebase, I can see that the property has the following items:

Steve Caballero's sponsors

The MQL is this:

[{
  "id": "/m/0qmzf",
  "name": null,
  "/business/sponsored_recipient/sponsorship": []
}]

Bu it returns this:

{
  "result": [{
    "id": "/m/0qmzf",
    "/business/sponsored_recipient/sponsorship": [
      null,
      null,
      null,
      null
    ],
    "name": "Steve Caballero"
  }]
}

Can anybody help me figure out why the null value for the list? Thanks

1

There are 1 answers

0
Tom Morris On BEST ANSWER

The sponsorship is a mediated type (also called a Compound Value Type (CVT)) which means that it's got multiple values (notably From & To dates) in addition to the Sponsor and Sponsorship recipient.

You can see the schema here: https://www.freebase.com/business/sponsorship?schema=

The CVT node has no name (thus the nulls), but what you really want is to go one hop further. You could do something like this to get a list of sponsored skateboarders with the sponsors and sponsorship start and end dates:

[{
  "type":       "/people/person",
  "name":       null,
  "profession": "Skateboarder",
  "/business/sponsored_recipient/sponsorship": [{
    "sponsored_by": null,
    "from":         null,
    "to":           null
  }]
}]