diff --git a/examples/guides/custom_data_models.py b/examples/guides/custom_data_models.py index 0eb314227..be7a588b3 100644 --- a/examples/guides/custom_data_models.py +++ b/examples/guides/custom_data_models.py @@ -35,4 +35,5 @@ async def main(): await add_data_points([alice, bob, charlie]) -asyncio.run(main()) +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/guides/custom_prompts.py b/examples/guides/custom_prompts.py index 0d0a55a80..64e9c59c0 100644 --- a/examples/guides/custom_prompts.py +++ b/examples/guides/custom_prompts.py @@ -14,7 +14,7 @@ async def main(): [ "Alice moved to Paris in 2010, while Bob has always lived in New York.", "Andreas was born in Venice, but later settled in Lisbon.", - "Diana and Tom were born and raised in Helsingy. Diana currently resides in Berlin, while Tom never moved.", + "Diana and Tom were born and raised in Helsinki. Diana currently resides in Berlin, while Tom never moved.", ] ) await cognee.cognify(custom_prompt=custom_prompt) diff --git a/examples/guides/graph_visualization.py b/examples/guides/graph_visualization.py index d463cbb56..3ee980081 100644 --- a/examples/guides/graph_visualization.py +++ b/examples/guides/graph_visualization.py @@ -10,4 +10,5 @@ async def main(): await visualize_graph("./graph_after_cognify.html") -asyncio.run(main()) +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/guides/memify_quickstart.py b/examples/guides/memify_quickstart.py index 040654350..61fdf6991 100644 --- a/examples/guides/memify_quickstart.py +++ b/examples/guides/memify_quickstart.py @@ -1,6 +1,6 @@ import asyncio import cognee -from cognee import SearchType +from cognee.modules.search.types import SearchType async def main(): @@ -26,4 +26,5 @@ async def main(): print("Rules:", rules) -asyncio.run(main()) +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/guides/ontology_input_example/basic_ontology.owl b/examples/guides/ontology_input_example/basic_ontology.owl new file mode 100644 index 000000000..81c4182d4 --- /dev/null +++ b/examples/guides/ontology_input_example/basic_ontology.owl @@ -0,0 +1,290 @@ + + + + Created for making cars accessible to everyone. + + + + + + + + + + + + + + + + + Famous for high-performance sports cars. + + + + + + + + + Pioneering social media and virtual reality technology. + + + + + + + + Known for its innovative consumer electronics and software. + + + + + + + + + + + + Known for its modern designs and technology. + + + + + + + + + + + + + + + + Focused on performance and driving pleasure. + + + + + + + + + + + + + + + + + + + + + Started as a search engine and expanded into cloud computing and AI. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Dominant in software, cloud computing, and gaming. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Synonymous with luxury and quality. + + + + + + + + + + + From e-commerce to cloud computing giant with AWS. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/guides/ontology_quickstart.py b/examples/guides/ontology_quickstart.py index 2784dab19..e3b58d5d6 100644 --- a/examples/guides/ontology_quickstart.py +++ b/examples/guides/ontology_quickstart.py @@ -1,5 +1,8 @@ import asyncio import cognee +import os +from cognee.modules.ontology.ontology_config import Config +from cognee.modules.ontology.rdf_xml.RDFLibOntologyResolver import RDFLibOntologyResolver async def main(): @@ -8,10 +11,6 @@ async def main(): await cognee.add(texts) # or: await cognee.add("/path/to/folder/of/files") - import os - from cognee.modules.ontology.ontology_config import Config - from cognee.modules.ontology.rdf_xml.RDFLibOntologyResolver import RDFLibOntologyResolver - ontology_path = os.path.join( os.path.dirname(os.path.abspath(__file__)), "ontology_input_example/basic_ontology.owl" ) diff --git a/examples/guides/search_basics_additional.py b/examples/guides/search_basics_additional.py index f1847ad4b..f98dd8db9 100644 --- a/examples/guides/search_basics_additional.py +++ b/examples/guides/search_basics_additional.py @@ -1,7 +1,7 @@ import asyncio import cognee -from cognee.modules.search.types import SearchType, CombinedSearchResult +from cognee.api.v1.search import SearchType async def main(): @@ -47,12 +47,6 @@ async def main(): ) assert len(answers) > 0 - answers = await cognee.search( - query_text="Quarterly financial highlights", - datasets=["NLP_coding", "Sandwiches"], - use_combined_context=True, - ) - assert isinstance(answers, CombinedSearchResult) - -asyncio.run(main()) +if __name__ == "__main__": + asyncio.run(main()) diff --git a/examples/guides/search_basics_core.py b/examples/guides/search_basics_core.py index 15c073c0e..15e2b5670 100644 --- a/examples/guides/search_basics_core.py +++ b/examples/guides/search_basics_core.py @@ -23,4 +23,5 @@ async def main(): print(answer) -asyncio.run(main()) +if __name__ == "__main__": + asyncio.run(main())