Reputation: 17
I'm using Reality Gem to Query Wikidata, using this code below. But it gives nil output. i've checked using result.methods command but i dont't see any method to view "part_of" or "instance_of" property values
require 'reality'
result = Reality::Entity("Enterprise JavaBeans")
result.part_of
=> nil
However on wikidata page these properties are available:
https://www.wikidata.org/wiki/Q742961
Can someone help me please?
Upvotes: 0
Views: 120
Reputation: 1129
I don't know why this error is happening.
I guess it's because the document structures on Wikidata and Wikipedia aren't the same.
But you can get around with the following hacky:
require 'reality'
w = Reality::Wikidata::Entity.one_by_id('Q742961')
e = Reality::Entity::WikidataPredicates.parse(w)
e[:part_of]
Upvotes: 1