Sample Gemini code and prompt
Allikas: Lambda
#!/usr/bin/env python3 from google import genai import os api_key = os.environ["GEMINI_API_KEY"] client = genai.Client(api_key=api_key) #cities = ["Tartu", "Saue", "Jõgeva", "Türi", "Võhma", "Kuressaare", "Paldiski", "Võru", "Rakvere", "Kärdla", "Rapla", "Põlva", "Haapsalu", "Pärnu", "Kohtla-Järve", "Narva", "Viljandi", "Valga", "Tallinn", "Paide"] cities = ["Rapla", "Saue"] for city in cities: response = client.models.generate_content( model="gemini-2.0-flash", contents=f"What are capacity and other information about the buildings in {city}, Estonia? \ Give your answers about the facts as RDF triples, where every triple is on a separate line. Use prefix format for subject, predicate and object. Use prefix llm: as a default prefix. \ Use schema.org where possible. Include a triple about schema:location. Output only triples. Do not add comments! Do not add quotes around the numbers!" ) print(response.text.strip("```").strip("turtle")) print(f"llm:{city} owl:sameAs yago:{city} .")