18 karma · joined Jun 25, 2018 (8y ago) · 26 submissions
comment 1w ago · link · parent
Historically, implicit optionals in our schema design caused a few recurring headaches—most notably not being able to switch on emptiness, and queries silently changing behavior when an existing variable was made optional.
We looked at how functional languages handle this with explicit Option/None types and decided to bring that strictness to the database level. We actually ended up borrowing the most from languages like Kotlin, using our existing union-of-types model to naturally accommodate the new None type.
We had a lot of fun wrestling with the semantics and language design while making this change.
I'd love to hear how others have thought about designing nullability and type strictness. Happy to answer any questions!
3.
Replacing implicit optionals with a None type in TypeDB(typedb.com ↗)
13 points · by flyingsilverfin · 1w ago · 3 comments
comment 2mo ago · link · parent
A database is a smaller surface than a programming language, so we turned it into a benchmark that holds the model constant and swaps the language: SQL, Cypher, TypeQL, same questions, same data. It's not a clean apples-to-apples comparison and the post's limitations section outlines that further.
One result that points us in the direction of a strong type system is that SQL wins first-shot, but 93% of TypeQL's wrong queries fail with an error, versus 5% for SQL and 40% for Cypher. Add in a retry loop TypeQL ends up ahead, because it can only fix mistakes it can see.
Of course there's a lot of variables here, such model, skill, token usage, question selection, etc. I actually think it's quite a hard thing to study!
If anyone knows of work on LLMs driving systems with stronger vs weaker verifiers, with the model held fixed, I'd love to see it.
5.
Benchmarking LLM query generation across SQL, Cypher, and TypeQL(typedb.com ↗)
1 points · by flyingsilverfin · 2mo ago · 1 comment
6.
How strict should your schema be?(typedb.com ↗)
3 points · by flyingsilverfin · 3mo ago · discuss
comment 8mo ago · link · parent
comment 9mo ago · link · parent
TypeDB's data model has a strict schema, higher-level abstractions (role-based interfaces, subtyping & inheritance), and hypergraph structures (n-ary relations & relations in relations) built in. This combination enables better AI query generation.
It's like giving the LLM a strongly typed language instead of a loosely typed one. With a relational db, the model has to infer relationships from foreign keys and naming conventions. With graph databases, there's no enforced schema. In TypeDB, the schema says "friendship is a relation with two friends, each played by a person" — the LLM gets a constraint space to navigate rather than guess at. It still gets things wrong — the post shows a syntax error it had to recover from — but the error surface is smaller and more correctable.
Would love to hear your thoughts. Happy to answer anything about TypeDB as well!
9.
Show HN: TypeDB Studio's AI agent for schema exploration and query generation(typedb.com ↗)
4 points · by flyingsilverfin · 9mo ago · 1 comment
comment 1y ago · link · parent
comment 2y ago · link · parent
Incidentally I think it also addresses what a lot of the comments here are talking about: not learning JOINs, indexing, build-in relation cardinality constraints, etc, but that's a separate point!
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 4y ago · link · parent
Downsides were that in the US there were expensive, and need proper daily cleaning, but the tradeoff is worth it - only need 1 pair per year - less waste too!
Going to get Lasik this year because they don't play nicely with travel in developing countries, but they were absolutely fantastic for school and university.
comment 5y ago · link · parent
SQL is the standard because, as others have pointed out, it's so entrenched and also builds upon a solid theoretical foundation. And given its dominance, it has been optimised and performed extremely well until recently, where data complexity is catching up again.
Recent noSQL databases won't take over SQL because of the lack of schema/typing. They do scale nicely, but aren't as constrainable as SQL, which is a feature (compare building a large software in Python vs Rust or Java) that enforces safety and good abstractions. There are some newer DBs which are combining strict schemas with NoSQL, which is promising!
Disclaimer: I work on TypeDB (vaticle.com/typedb) which is a native ERA (entity-relation-attribute) model with strict typing via the schema.
comment 5y ago · link · parent
Alternatively, we do end up extracting Ca from the ocean that is not replenished (there's probably so much we don't care) and rely on the atmospheric CO2 to correct ph balance of the ocean?
comment 5y ago · link · parent
Thanks!!
comment 5y ago · link · parent
comment 5y ago · link · parent
comment 5y ago · link · parent
comment 5y ago · link · parent
For others: we're also starting to look into ML on knowledge graphs, check out our initial work at https://github.com/graknlabs/kglib :D