The method find_places
returns a list of places that matched the value parameter.
The value can match with the place’s name, or description.
Once you have the IDs, you can use them to filter your search queries with an Entity query filter.
from dotenv import load_dotenv
from bigdata_client import Bigdata
import os
load_dotenv()
# Initialize the Bigdata API
username = os.environ.get("BIGDATA_USERNAME")
password = os.environ.get("BIGDATA_PASSWORD")
bigdata = Bigdata(username, password)
results = bigdata.knowledge_graph.find_places("Spain")
for place in results:
print(f"Entity ID: {place.id}")
print(f"Name: {place.name}")
print(f"Description: {place.description}\n")
Output:
Entity ID: 986F1A
Name: Spain
Description: The Kingdom of Spain is a country located in southwestern Europe on the Iberian Peninsula.
Entity ID: 99ED7C
Name: Port of Spain
Description: Port of Spain, is the capital city of Trinidad and Tobago, located on the northwest coast of the island of Trinidad.
...