Pregunta

I'm trying to find the best way to get the information displayed on a Freebase page via a MQL query.

I've tried the topic API but that includes a lot of metadata.

I've also tried using links/reflection as in:

{
  "id": "/en/samsung_electronics",
  "/type/reflect/any_master": [{
    "link": {
      "master_property": null
    },
    "name": null,
    "id": null

  }],
  "/type/reflect/any_reverse": [{
    "link": {
      "master_property": null
    },
    "name": null,
    "id": null
  }],
  "/type/reflect/any_value": [{
    "link": {
      "master_property": null
    },
    "value": null
  }]
}

But that means I'll be missing some information, such as the number of employees because that's given as a "Dated Integer" which, of course, doesn't get automatically expanded and I won't know what I would have to expand in general. My best attempts at expanding all objects by nesting that query once in itself were met with a

"code": 503,
"message": "Backend Error"

In RDF/SPARQL (e.g. DBpedia) I'd just do select ?p ?o where {URI ?p ?o} and select ?s ?p where {?s ?p URI}, am I missing such a simple way to do this in Freebase?

So to summarize, I'm looking for a way to get the information on a Freebase HTML page with as little overhead as possible and without missing anything.

¿Fue útil?

Solución

The Topic API was designed specifically for this use case (and is what's used to construct the Freebase HTML page). It takes a filter parameter which can be used to tailor its output to include only parts of the schema which are of interest. What metadata is getting in your way? Why can't you just skip it?

If you'd prefer to use SPARQL, there's an RDF dump available that you could load in your own triple store and query with SPARQL.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top