Skip to content

Change the things that must be changed in Windows. #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kataph opened this issue Apr 16, 2025 · 11 comments
Closed

Change the things that must be changed in Windows. #83

kataph opened this issue Apr 16, 2025 · 11 comments

Comments

@kataph
Copy link

kataph commented Apr 16, 2025

So, I am trying to use this software. Unfortunately, I am using Windows. Unfortunately, I am also unexperienced with Emacs.
I managed to deduce that I have to open the .emacs file and change the elisp path location (I followed the instructions on the README file, however this resulted Emacs not being able to find the elisp folder). Now I can use elot, however if I e.g. try to produce diagrams, a similar error is raised. I see that I have to

the following variables then need to be edited with M-x customize ;; - elot-robot-jar-path (for ROBOT query and more) ;; - org-plantuml-jar-path (for PlantUML) ;; - elot-rdfpuml-path (for RDF diagrams)

However, it is exceedingly non-obvious how to do so even when searching on the internet.

So, I would be grateful if you could supply some instruction about how to do that.

Many thanks for your most kind attention and kind regards

@johanwk
Copy link
Owner

johanwk commented Apr 16, 2025

Hi, thanks for trying out Elot!

I hope to update and improve the README rather soon, it really needs some work. Your particular problem should however not be difficult to fix. I myself mainly use Emacs on Windows.

  1. There is a default value for elot-robot-jar-path; it will be set when you open an ELOT file, thanks to the very first line in the file, which looks like the following, instructing Emacs to load the ELOT library of functions when the file is opened:
# -*- eval: (load-library "elot-defaults") -*-

(This line will be inserted for you if you start an ontology with an empty file, by hitting shift+F5 to open the Elot menu and typing odh, for "insert header".)

The default value for elot-robot-jar-path is ~/bin/robot.jar. The tilde ~ refers to your user home directory. After downloading ROBOT, move it to a directory named bin in your home directory and rename it robot.jar. ROBOT should now be found by Elot, and it will be called upon to produce a Turtle file whenever you tangle your work to an ontology file.

However, it may be that Emacs doesn't understand where your home directory is located, especially on Windows! The problem is one that many Emacs users have faced over the years. I recommend setting the HOME environment variable to point to your home directory (this is done from the Control Panel; make sure to restart Emacs after setting the variable). And, maybe check out the aptly titled "Don't forget to set the HOME directory for Emacs on Windows".

  1. The variable org-plantuml-jar-path doesn't have a default value. To set it, you should use the Emacs "customize" feature. Hit M-x customize-variable (M-x means Alt+X on Windows or Linux, Command+X on a Mac.). You will see a prompt in the minibuffer, the line at the bottom of the Emacs window that is used to issue commands (there's too many commands in Emacs to fit all into menus). Then type org-plantuml-jar-path, press Enter. You will be presented with a view that allows you to type in the path to plantuml.jar; edit that and click the button Apply and Save.

After this, you should be good to go.

I recommend also downloading elot-exporter.jar from Releases. When you have this available, the command elot-open-owl can be used to open existing OWL ontologies in the Elot org-mode format. To make sure that jar is found, again use customize to set the variable elot-exporter-jar-path.

@johanwk
Copy link
Owner

johanwk commented Apr 16, 2025

PS! You mention that you wish to create diagrams, which for Elot by default means using rdfpuml.

On Windows, I strongly recommend downloading and using rdfpuml.exe, which Vladimir Alexiev kindly put together for use with Elot. It's of course not impossible to install rdfpuml as a Perl program, but I struggled with that in the past (on Mac or Linux, this is not nearly as complicated).

So, please download rdfpuml.exe and put that too into ~/bin or whichever folder you prefer for your personal binaries. And then make sure that ~/bin is included in your PATH -- if it's not, then Emacs will not find the program. So, once more go to Control Panel, add something like c:/Users/myname/bin to the PATH -- and diagram generation should work.

To get started with diagrams, you may check out pizza.org in the examples folder in this repository.

@kataph
Copy link
Author

kataph commented Apr 28, 2025

Hi, thankyou for your answer.

However, it is not resolutive and only partially relevant.

First, note that I read completely the README file and correctly implemented all steps.

In particular, the Emacs HOME directory is C:/Users/[me]. And the directory C:/Users/[me]/bin is added to both the user's and the system PATH variable. And everything is downloaded.

This is however not sufficient to solve the issue: if I try to follow the tutorial to produce a diagram it tells me that rdfpuml isnt found and suggest to use the command M-x set-variable to set the org-plantuml-jar-path variable. After I learned how to do that, I reasonably set the value of said variable to "~/bin/rdfpuml.exe" (rdfpulm.exe is there together with the other stuff). After that, the error changes, but the diagram generation still fails, see image:

Image

Could you help?
Many thanks

@kataph
Copy link
Author

kataph commented Apr 28, 2025

In addition, when vanilla Emacs starts, it is immediately responsive; when Elot-Emacs starts, it needs between 10 to 30 seconds (tested on different connections) to do stuff (it says "contacting host", the one that consumes the most time is "melpa.org"). Is this an anomalous behavior?

@johanwk
Copy link
Owner

johanwk commented Apr 28, 2025

Hi, many thanks for following up. I'll check these out and get back to you.

It's conceivable that some change to Perl might be an issue -- I just found a similar-looking problem on my Mac (not on my Windows computer, though). Just in case: Are you in Windows 11?

@johanwk
Copy link
Owner

johanwk commented Apr 28, 2025

Ok, I just tested rdfpuml again on my Windows 11 computer.

Could you please run a quick test with a file that is known to work? The pizza.org file in folder examples/ has a header rdfpuml diagram and a call: that will make a diagram in line 149. Please try this out by moving cursor to that line and doing C-c C-c. If that fails, we will need to look more closely.

When I look at your screenshot, there may be a clue in that you have a results: block with the type of ttl (i.e., #+begin_src ttl). This indicates that the results of your rdfpuml call returned Turtle instead of a graphic -- which makes no sense. So I think it's a good idea to start with the pizza.org example and verify first that that works (or doesn't work).

@johanwk
Copy link
Owner

johanwk commented Apr 29, 2025

In addition, when vanilla Emacs starts, it is immediately responsive; when Elot-Emacs starts, it needs between 10 to 30 seconds (tested on different connections) to do stuff (it says "contacting host", the one that consumes the most time is "melpa.org"). Is this an anomalous behavior?

Actually, this is mainly due to an overly cautious setup for new users. An ELOT package is due to be made available before long. With that, ELOT will be just one among hundreds of packages that users can choose to include, and loading time should be quite fast.

In the meantime, if you have these lines in your .emacs startup file, try commenting out this line, which is likely to take time:

(package-refresh-contents)

@kataph
Copy link
Author

kataph commented Apr 29, 2025

Could you please run a quick test with a file that is known to work? The pizza.org file in folder examples/ has a header rdfpuml diagram and a call: that will make a diagram in line 149. Please try this out by moving cursor to that line and doing C-c C-c. If that fails, we will need to look more closely.

Yes, absolutely.

I executed the following steps:

  1. Opened Emacs (with Elot installed; and as admin, for what it can help)
  2. File>Open --> opened pizza.org in the examples folder
  3. move cursor to line 149 (had to expand some sections using tab)
  4. press C-c C-c

The result was an error: let*: Opening input file: No such file or directory, c:/Users/Francesco/elisp/elot/examples/pizzattl. More specifically

Image

This was caused by the lack of having generated the ttl by using SHIFT+F5 > t, I assume, so I did that. Then re-did 1. to 4.. Then I got again the if: PlantUML not found. Set org-plantuml-jar-path with M-x customize-variable error, but I know how to fix this by setting said variable to the correct value, so I also did that.

Image

Then I re-did 1. to 4.. This time I get the error that tells me that some file or directory is missing:

Image

Notice that I can correctly use the .jar file from the command line to produce diagrams and (with the .exe file) .puml files. Also elot sees that the file is there because if I change the file location or set a different value for the address variable I get the previous error message about the jar not found.

Kind regards

@johanwk
Copy link
Owner

johanwk commented Apr 29, 2025

Interesting .. the last error says "Unable to access jarfile ~/bin/plantuml.jar". Sorry to be asking this question, but you are 100% sure that you have renamed the plantuml jar to just "plantuml.jar" and placed it in the c:/Users/Francesco/bin folder?

It's conceivable that the shortcut "~" is still not picked up by Emacs as an alias for c:/Users/Francesco. So you could try to set org-plantuml-jar-path to the explicit "c:/Users/Francesco/bin/plantuml.jar" and try once more.

If this still doesn't work, I'd be happy to do a video meeting and help you fix it for real...

@kataph
Copy link
Author

kataph commented Apr 30, 2025

Sorry to be asking this question, but you are 100% sure that you have renamed the plantuml jar to just "plantuml.jar" and placed it in the c:/Users/Francesco/bin folder?

No worries, I would think the same. However the file is there:

Image

Image

Also, as I've mentioned, If I move the file the error changes. Plus the robot.jar is in the same place, but that one gets found. Also the tilda does appear to be taken as the correct alias:

Image

Image

However, setting the jar path to "c:/Users/Francesco/bin/plantuml.jar" explicitely did the trick, although I don't understand way:

Image

Well, I consider the issue solved.

Many thanks for the attention and kind regards.

@johanwk
Copy link
Owner

johanwk commented Apr 30, 2025

Wonderful! And I believe I finally see the root cause here.

Namely: Java doesn't understand backslash in file paths. That means it will be happy to load c:/Users/Francesco/bin/plantuml.jar, and it will not understand c:\Users\Francesco\bin\plantuml.jar at all.

I have to add a note about this in the README.

@johanwk johanwk closed this as completed Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants