简体   繁体   中英

Freebase rdf API: get rdf triple with a specific tail

I want to get triples which has a specific tail. For example get triples with /m/3s31es as their tail and the results like:

/m/111111      /has/name      /m/3s31es
/m/222222      /has/city      /m/3s31es
/m/333333      ...            /m/3s31es
...

Is there an freebase api to implement this? Thank you

The Freebase RDF endpoint only serves up single RDF documents. There is no API associated with it (SPARQL or otherwise).

You have three choices:

  1. Do your querying using the Freebase MQLRead API (perhaps using the results to retrieve RDF documents if that's the final format that you want).

  2. Download the RDF dump, load it in a RDF triplestore and use SPARQL or whatever query language the triplestore supports.

  3. Download the RDF dump and use zgrep to find all the triples which match your desired pattern.

The first option will be quickest for small amounts of data and #3 will be quickest for larger amounts of data. If you're going to have to do this a lot, the extra upfront costs of #2 may be worth it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM