"Uri: Command Not Found" When Trying To Run "load-seattle-mem.bsh"

Hello!

I recently download Datomic free and am able to run the server!

I am also able to run the datamic console locally, but it seems there are no data / databases there!

I am assuming the “load-seattle-mem.bsh” file is meant to load the seattle data when it is run…

After doing “chmod +x load-seattle-mem.bsh” I get this error when running “./load-seattle-mem.bsh”:

./load-seattle-mem.bsh: line 1: uri: command not found
./load-seattle-mem.bsh: line 2: syntax error near unexpected token `uri'
./load-seattle-mem.bsh: line 2: `Peer.createDatabase(uri);'

My system:

mac 10.15.3

openjdk 11.0.6 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.6+10, mixed mode)

Any help would be appreciated. Thanks! :pray:

bump! :upside_down_face:

Hi @JimLynchCodes,

The error you are seeing indicates that you do not have a URI set. See the included resources/shell-help.txt file:

To use the shell, just type a Java expression or statement and press
enter (remember the ; ). Like this:

String uri = "datomic:mem://seattle";
Peer.createDatabase(uri);
Connection conn = Peer.connect(uri);

Are you able to manually set the URI in the shell as shown above ^?

I also recommend that you utilize our Getting Started docs over Datomic Free’s packaged Seattle tutorial if you’re just getting into Datomic. https://docs.datomic.com/on-prem/getting-started/brief-overview.html

Thanks,
Jaret

Thank you Jaret!! :heart:

I had no idea that I needed to edit that resources/shell-help.txt file!

Even after following your link and looking through the full datomic documentation I don’t see any mention at all of this file or even load-seattle-mem.bsh for that matter. Is there anywhere in the documentation where this is explained? :thinking:

No, the included samples in Free used to be a part of our documentation but are now deprecated in the docs. Which is why I recommended following the current documentation for getting started material. You can still use the included samples, but they are not documented in our tutorial any longer.

Thanks Jaret!

I am still super confused though. The link you provided goes to Datomic documentation that seems to only talk about Datomic at a very high level and show how to connect with the clojure client.

I don’t see anything related to this shell command or any instructions whatsoever for loading the sample data. I would assume the first thing that people would want to do once downloading and running Datomic is put some data into it. I think loading it in from the sample data file is a great idea, and that is why I am very sad that there is literally no documentation of this anywhere on the datomic site. :disappointed_relieved:

Also, I don’t even see downloads for “Datomic Starter” anywhere on the site… :thinking:

When I click the “Download Starter” button on this page (https://www.datomic.com/get-datomic.html) it brings me to a random license key page, NOT the download page. :thinking:

When I click “Downloads” at the top of this page (my.datomic.com/account) it takes me to a page for “Datomic Pro” downloads. I literally cannot find downloads for “Datomic Starter” ANYWHERE on the site at all… :thinking:

I am definitely not alone in my confusion here as I see pretty much everyone who tries to get started with Datomic running into these difficulties. Like the others I think Datomic is a great idea but nearly impossible to actually use because there are so many gaping holes in the docs. Since this site is not open source and I can’t contribute, I would advise the team there to try to think from the perspective of someone literally coming here for the first time. The dev process should be as easy as possible rather than something that only insiders can understand. :heart:

Hi @JimLynchCodes,

I apologize for the frustration you are experiencing. I will work to clarify here and take the feedback you have provided to the team for their input so that we can make this experience better.

Free is no longer considered to be the starting point for Datomic. Free is only suitable for open-source projects requiring distribution. You will notice that our documentation does not include any mention of Free in the getting started section.

Instead of Free we recommend that users evaluated Datomic with Datomic Pro Starter per FAQ:


Can I evaluate Datomic Pro for free before purchasing?

Yes, you can get Datomic Pro Starter Edition to develop and release your application prior to purchasing a license.


When I click the “Download Starter” button on this page (https://www.datomic.com/get-datomic.html) it brings me to a random license key page, NOT the download page

The “Download Starter” button links to the license page so that you can ensure that you have a Datomic Pro Starter license. Datomic starter and Datomic Pro use the same bits. The only difference is in the license available to you. Starter includes one year of Datomic pro maintenance and updates and is free to use. The use is perpetual meaning that it does not expire, but after you license expiration you will no longer be able to download new updates and releases. Here is an example screenshot showing that the license says “starter”:

When I click “Downloads” at the top of this page (my.datomic.com/account) it takes me to a page for “Datomic Pro” downloads. I literally cannot find downloads for “Datomic Starter” ANYWHERE on the site at all…

Download the pro bits accessible through your now licensed and registered my.datomic.com account and follow the docs starting here:

https://docs.datomic.com/on-prem/get-datomic.html


Once you’ve downloaded Datomic, unzip it somewhere locally. Throughout the documentation, shell commands are run from the root directory of the Datomic install. Change to this directory now, e.g.:

cd /home/user/datomic/datomic-pro-0.9.5561

After that, you will want to follow along through all the sections of “Getting Started” which includes: connecting, transacting schema, transacting data, querying the data, seeing historical data, a tutorial, and a setup for local dev:

image

If you would prefer to not use the client library you can follow our peer getting started documentation here:

https://docs.datomic.com/on-prem/peer-getting-started.html

I hope this helps clarify and I will take your feedback to the team so that we can improve our documentation.

Cheers,
Jaret

One additional note, you may find our Day of Datomic videos useful:

https://docs.datomic.com/on-prem/day-of-datomic.html

You can download the classroom materials and samples to accompany the videos.

Thanks @jaret!

The videos by Stu are great, but they are more just talking about Datomic at a high level and don’t at all explain how to actually use it.

As I originally stated before, all I want to do is load the sample data so I can view it in the console.

I have read the whole Getting Started guide yet again and am still extremely confused. I don’t know what you mean by, “Are you able to manually set the URI in the shell as shown above ^?”

My shell-help.txt file already looks as you quoted:

String uri = "datomic:mem://seattle";
Peer.createDatabase(uri);
Connection conn = Peer.connect(uri);

Now I am even more confused than when I initially started. :disappointed:

  • Is the load-seattle-mem.bsh supposed to load the seattle data into Datomic when I execute the load-seattle-mem.bsh file? I am not even sure anymore…

  • Can you be more specific about what I need to edit in the shell-help.txt file?

Thanks!

@JimLynchCodes Datomic Free is not intended as the ‘getting started’ experience for Datomic. Additionally, the Seattle dataset is quite out of date and not used by most of our reference documentation.

Are you wanting to use Datomic On-Prem specifically (as opposed to Datomic Cloud)? If so, I would suggest that you:

Incidentally, if you do want to use the Seattle neighborhood dataset, I would recommend loading it with the getting-started.clj file in the seattle directory. You can execute it line-by-line at a REPL.
The .bsh file is a BeanShell script, but given that most of the Datomic samples, documentation, and examples are in Clojure (or Java), I would avoid using it.

Hi @marshall,

Thanks for the quick reply.

Not sure what you mean by the seattle data being “out of date”. If the data was fine when it was created then I would think it should work just as well as sample data to be loaded in, regardless of how old it is.

Also, if it is not recommended to use the Seattle data then why is it included in the datomic pro starter pro / pro download at all? (I just downloaded the zip and it is not only included in the “samples” folder, it is the ONLY sample provided!

Unfortunately, linking to the getting started page again doesn’t help me much as I looked at that page when Jarret posted it and had seen it even before creating this thread in the first place!

I have never heard of a “BeanShell script” before, but I guess it cannot be executed the same as bash (ie. ./load-seattle-mem.bsh)?

Suppose I want to spin up a database on a CI server and fill it with some data… “run the commands one by one in a Clojure repl” is not realistic for many cases, and it’s also imo more complicated than it should be.

I just looked at the mbrainz repo (https://github.com/Datomic/mbrainz-sample#getting-the-data) and am extremely disappointed to see that in this repo there is no instruction at all on how exactly to get the data into datomic… :pensive:

Possibly “restore the backup” could be a strange way to phrase what I’m trying to do, but after clicking the link to this page (https://docs.datomic.com/on-prem/backup.html) I am again very confused and totally lost. :cry:

Jim, here is a working hello-world repo for Datomic Free using deps.edn. Cursive IDE can import this folder as a deps project and knows how to run it as deps, which will give you a repl at which point you can go form-by-form through user.clj to get started. https://github.com/dustingetz/datomic-free-hello-world

Thanks @dustingetz! :pray:

Man, this whole process is making me feel really dumb, but I am determined to figure this out! :sweat_smile:

Also, still unsure how I would spin up a db and fill it with data on CI… can I just execute all the steps as one clojure file rather than going line by line in the repl?

Jim,

The command shown in the mbrainz repo:

bin/datomic restore-db file:///path/to/backup/mbrainz-1968-1973 datomic:free://localhost:4334/mbrainz-1968-1973

Would import the mbrainz database into your running Datomic Free system.
If you wanted to use Datomic Starter with Dev storage instead, you would change the target URI in the restore command to your local transactor URI (i.e. datomic:dev://localhost:4334/mbrainz-1968-1973).

For CI you could automate running that restore command via a bash script. Alternatively you could launch a clojure program that did the job once you’ve written one you’re happy with. The example Dustin provided (or the seattle importer clojure file I mentioned previously) would both be reasonable templates to start from.