Skip to content
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

Unable to Display SPARQL Query Results Using %%sparql Magic Cell #515

Open
miguelsmuller opened this issue Aug 9, 2023 · 6 comments
Open
Labels
bug Something isn't working
Projects

Comments

@miguelsmuller
Copy link

Hello,

I hope this message finds you well. I am currently using the AWS Graph Notebook in Visual Studio Code to execute SPARQL queries. However, I'm facing an issue with displaying the results of SPARQL queries using the %%sparql magic cell annotation.

Problem:

When I attempt to execute a SPARQL query using the %%sparql cell annotation in Visual Studio Code, the query runs successfully, but the results are not being displayed in the output. Instead, I only see an empty cell with no visible output.

Steps to Reproduce:

  1. Open Visual Studio Code.
  2. Create a new notebook.
  3. Use the %%sparql magic cell annotation to execute a SPARQL query.
  4. Run the cell.
  5. Notice that the query executes, but the results are not displayed.

Expected Outcome:

I expect that when I execute a SPARQL query using the %%sparql magic cell annotation, the query results should be displayed in the output cell as expected.

Additional Information:

  • I am using the latest version of the AWS Graph Notebook extension.
  • I have tried executing various SPARQL queries, but none of them display results using the %%sparql cell annotation.
  • I have also attempted to restart Visual Studio Code and reload the notebook, but the issue persists.

I would greatly appreciate your assistance in resolving this issue.

Please let me know if there's any additional information or logs that would be helpful for debugging.

Thank you for your attention to this matter.

@miguelsmuller miguelsmuller added the bug Something isn't working label Aug 9, 2023
@michaelnchin
Copy link
Member

Hi @miguelsmuller,

Can you describe the process you took install graph-notebook onto VS Code? Please provide additional details around your env (Python version and package versions used, at least for Jupyter core - run !jupyter --version)

If possible, please also provide the VS Code Jupyter logs from running the %%sparql cell. You can enable and grab the logs via these steps:

  1. In VS Code, open Settings, then go to Extensions -> Jupyter -> Logging
  2. Set the Logging level in the dropdown to "verbose", then restart VS Code
  3. Re-run the %%sparql query in the Jupyter Notebook
  4. Pull the logs from the "Output" tab in the lower console

@michaelnchin michaelnchin added this to New issues/Needs triage or review in Planning via automation Aug 11, 2023
@michaelnchin
Copy link
Member

This issue might be related: #515

Worth checking if a downgrade to jupyter_client<8 and pyzmq<25 fixes the issue.

@miguelsmuller
Copy link
Author

miguelsmuller commented Aug 11, 2023

I will provide two comments. For the first one, I will share the environment setup I have here and the current screenshots:

Currently, I'm using a virtual environment (venv) with Python version 3.9.16. I set up the venv as follows:

~/.pyenv/versions/3.9.16/bin/python -m venv .venv

I have the following libraries installed:

pylama==8.4.1
pycodestyle==2.10.0
black==23.7.0

ipykernel==5.3.4
graph-notebook==3.8.2
jupyter==1.0.0
jupyter-client==7.1.2
jupyter-console==6.4.3
jupyter-contrib-core==0.3.3
jupyter-contrib-nbextensions==0.5.1
jupyter-core==4.9.2
jupyter-highlight-selected-word==0.2.0
jupyter-latex-envs==1.4.6
jupyter-nbextensions-configurator==0.4.1
jupyter-server==1.13.1
jupyterlab==3.2.8
jupyterlab-server==2.10.3
jupyterlab-widgets==1.1.0

rdflib==5.0.0
SPARQLWrapper==1.8.4
networkx==2.4

pandas==1.5.3
numpy<1.24.0
spacy==3.5.0
nltk==3.8.1
pydantic==1.10.7
pyarrow==12.0.1
seaborn==0.12.2
matplotlib==3.7.2
google-cloud-bigquery==3.11.3

fuzzywuzzy==0.18.0
python-Levenshtein==0.21.1
stringcase==1.2.0
python-stopwatch==1.0.5

VSCode Screenshot

Screenshot 2023-08-11 at 10 59 38

Jupyter in Browser screenshot:

Screenshot 2023-08-11 at 10 58 29

@miguelsmuller
Copy link
Author

@michaelnchin, As you requested, here's the log generated when I execute the SPARQL query in Visual Studio Code:

11:13:24.886 [info] Handle Execution of Cells 6 for {MY_FOLDER}/0001.ipynb
11:13:24.887 [debug] start the kernel, options.disableUI=false for {MY_FOLDER}/0001.ipynb
11:13:24.889 [debug] Execution Request Sent to Kernel for cell 6
11:13:24.902 [debug] Start cell 6 execution @ 1691763204899 (clear output)
11:13:24.902 [info] Kernel acknowledged execution of cell 6 @ 1691763204899
11:13:24.922 [debug] Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:1.2.0
11:13:24.940 [debug] Widget Message: WidgetManager: Loading class TabModel:@jupyter-widgets/controls:1.5.0
11:13:24.942 [debug] Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:1.2.0
11:13:24.946 [debug] Widget Message: WidgetManager: Loading class TabModel:@jupyter-widgets/controls:1.5.0
11:13:24.950 [debug] Widget Message: WidgetManager: Loading class OutputModel:@jupyter-widgets/output:1.0.0
11:13:24.957 [debug] Widget Message: WidgetManager: Loading class LayoutModel:@jupyter-widgets/base:1.2.0
11:13:24.963 [debug] Widget Message: WidgetManager: Loading class ForceModel:graph_notebook_widgets:3.8.2
11:13:24.967 [debug] Widget Message: WidgetManager: Loading class OutputModel:@jupyter-widgets/output:1.0.0
11:13:24.979 [debug] Widget Message: WidgetManager: Loading class OutputModel:@jupyter-widgets/output:1.0.0
11:13:24.984 [debug] Widget Message: Received display data message c08a61d1b64f40dba9a011caaf5ad593
11:13:24.999 [debug] Version of IPyWidgets 7 determined after 0s
11:13:25.012 [debug] Widget Message: Waiting for model to be available before rendering it c08a61d1b64f40dba9a011caaf5ad593
11:13:25.014 [error] Widget Error: Error: Failed to render widget c08a61d1b64f40dba9a011caaf5ad593, Error: widget model not found
11:13:25.018 [info] End cell 6 execution @ 1691763204950, started @ 1691763204899, elapsed time = 0.051s
11:13:25.018 [debug] Cell 6 executed with state Success

@michaelnchin
Copy link
Member

Hi @miguelsmuller , apologies for the late response.

Thank you for the additional information around your setup - I was able to reproduce this locally on VSCode, while the same env setup worked with Jupyter Classic Notebook and JupyterLab. The application-specific nature of the bug seems suggests that VSCode has additional requirements to get Jupyter widgets running in general.

I haven't been able to nail down a root cause as of yet, so scope of the changes needed remains ambiguous to me. Given the unclear dev time commitment required here, I think we have to consider VSCode support lower priority for now, but we will keep this in the backlog for investigation.

@miguelsmuller
Copy link
Author

No problem, @michaelnchin .

I appreciate the time you've taken to conduct this initial investigation.

If I can assist in any way, please let me know. I'd be happy to collaborate.

@Poornacn Poornacn moved this from New issues/Needs triage or review to Low priority in Planning Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Planning
Low priority
Development

No branches or pull requests

2 participants