Skip to content

Instantly share code, notes, and snippets.

@jalakoo
jalakoo / app.py
Created May 13, 2025 03:30
BAML to Graph Data Example
import streamlit as st
from st_cytoscape import cytoscape
from baml_client import b
import json
# Set page config
st.set_page_config(layout="wide")
def process_graph_result(result):
"""Convert BAML graph result to cytoscape elements format"""
@jalakoo
jalakoo / main.py
Created April 20, 2025 00:29
Simple Python script for updating all Nodes "name" property in a target Neo4j database
from neo4j import GraphDatabase
import sys
def update_node_names(uri, user, password, target, replace_with):
driver = GraphDatabase.driver(uri, auth=(user, password))
def update_name(tx, target, replace_with):
query = (
"MATCH (n) "
"WHERE n.name = $target "
@jalakoo
jalakoo / main.py
Created April 19, 2025 03:31
Simple FastAPI server that takes a list of URLs for audio files, extract entities using AssemblyAI and uploads it to Neo4j.
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
import assemblyai as aai
from neo4j import GraphDatabase
from dotenv import load_dotenv
import os
# Load environment variables
load_dotenv()
@jalakoo
jalakoo / app.py
Created April 18, 2025 18:15
Python code for extracting entities from audio with AssemblyAI, then uploading that data into a Neo4j Graph database
import assemblyai as aai
from neo4j import GraphDatabase
aai.settings.api_key = "<ASSEMBLYAI_API_KEY>"
audio_file = "https://assembly.ai/wildfires.mp3"
# audio_file = "./local_file.mp3" #syntax for using a local file
config = aai.TranscriptionConfig(entity_detection=True)
transcript = aai.Transcriber().transcribe(audio_file, config)
@jalakoo
jalakoo / app.py
Created April 15, 2025 04:00
Super Simple RushDB Python Sample App
from rushdb import RushDB
# Initialize the RushDB client
client = RushDB(
"<your_locally_generated_api_key>",
base_url="http://localhost:3000",
)
# Simple - Create a single Node
single_record = {
@jalakoo
jalakoo / smallbook.ttl
Created March 16, 2025 00:51
Ontology Marketplace Test Turtle File
@prefix : <http://www.semanticweb.org/srikargadusu/ontologies/2025/0/untitled-ontology-10/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://www.semanticweb.org/srikargadusu/ontologies/2025/0/untitled-ontology-10/> .
<http://www.semanticweb.org/srikargadusu/ontologies/2025/0/untitled-ontology-10> rdf:type owl:Ontology .
@jalakoo
jalakoo / cytoscape2neo4j.py
Last active May 14, 2025 23:01
Examples of uploading Cytoscape formatted JSON data to Neo4j and downloading back as Cytoscape compatible dict
from neo4j import GraphDatabase
from neo4j.graph import Relationship, Node
from typing import Optional, List
import json
import os
from dotenv import load_dotenv
load_dotenv()
def upload_cytoscape_to_neo4j(
@jalakoo
jalakoo / open_source_short_list.csv
Created May 8, 2024 17:33
VectorFriends Open Source Short List
name language
TensorFlow Python
Django Python
Flask Python
Verba Python
CNTK C++
Jenkins Java
Spring Java
Apache Tomcat Java
@jalakoo
jalakoo / open_source_projects.csv
Created May 8, 2024 17:25
VectorFriends Open Source Projects
name language
TensorFlow Python
Django Python
Flask Python
OpenCV Python
Ansible Python
Verba Python
CNTK C++
IncludeOS C++
Kodi C++
@jalakoo
jalakoo / software_technologies.csv
Created May 8, 2024 17:16
VectorFriends Tech List
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
name
Orchard Core
MVC
Blazor
WPF
Qt
Boost
POCO
STL
Cinder