I'm following this guide on querying from Wikidata.
I can get a certain entity (if I know its code) using with:
from wikidata.client import Client
client = Client()
entity = client.get('Q20145', load=True)
entity
>>><wikidata.entity.Entity Q20145 'IU'>
entity.description
>>>m'South Korean singer-songwriter, record producer, and actress'
But how can I get the RDF triples of that entity? That is, all the outgoing and incoming edges in the form of (subject, predicate, object)
Looks like this SO question managed to get the triples, but only from a data dump here. I'm trying to get it from the library itself.
from Extracting RDF triples from Wikidata
No comments:
Post a Comment