terminusdb / terminusdb-docs

TerminusDB Documentation
https://terminusdb.com/docs/
6 stars 6 forks source link

CLI Guide - Examples #163

Open OJ423 opened 1 year ago

OJ423 commented 1 year ago

https://terminusdb.gitbook.io/new-docs-structure/guides/interface-guides/cli

1) Should we include example code snippets as well as the terminusdb query DB_SPEC QUERY OPTIONS sections?

daramcq commented 1 year ago

Please add a couple of examples for this.

daramcq commented 1 year ago

To give you an example of what could be useful. I've created a database as such:

{
  "@base": "terminusdb:///data/",
  "@schema": "terminusdb:///schema#",
  "@type": "@context"
}
{
  "@id": "Person",
  "@type": "Class",
  "age": "xsd:integer",
  "name": "xsd:string"
}

I've added documents as such:

{
  "@id": "Person/f0e5fded47f2bd24773ece320b0d2ce064406bd634328acb50e807af3753c4c3",
  "@type": "Person",
  "age": 24,
  "name": "Jim"
}
{
  "@id": "Person/1b42045a08655bd0c299b9deb89f15b3bb9a9abab495136b9c9bccedd8451d99",
  "@type": "Person",
  "age": 28,
  "name": "Jemma"
}

I've been trying to write a query to show me the oldest person in the database, or simply to select the person with age 28. I haven't found anything in the documentation or videos that can help me do this.