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

Relax requirements #74

Merged
merged 4 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions environment-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ dependencies:
- networkx
- pandas
- owlready2
- sqlalchemy <2.0.0
- rdflib-sqlalchemy
- jupyter-book
- plotly
- ipywidgets
Expand Down
2 changes: 0 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,5 @@ dependencies:
- networkx
- pandas
- owlready2
- sqlalchemy <2.0.0
- rdflib-sqlalchemy
- plotly
- ipywidgets
16 changes: 14 additions & 2 deletions pyscal_rdf/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from rdflib import Graph, Literal, Namespace, XSD, RDF, RDFS, BNode, URIRef, FOAF, SKOS, DCTERMS
from rdflib.store import NO_STORE, VALID_STORE
from rdflib import plugin

import os
import numpy as np
Expand Down Expand Up @@ -93,13 +94,24 @@ def __init__(self, graph_file=None,


elif store=="SQLAlchemy":
#check for modules
try:
import sqlalchemy as sa
except ImportError:
raise RuntimeError('Please install the sqlalchemy package')
try:
import rdflib_sqlalchemy as rsa
except ImportError:
raise RuntimeError('Please install the rdllib-sqlalchemy package. The development version is needed, please do pip install git+https://github.com/RDFLib/rdflib-sqlalchemy.git@develop')

if store_file is None:
raise ValueError("store file is needed if store is not memory")
self.graph = Graph(store="SQLAlchemy", identifier=identifier)

self.graph = Graph(store="SQLAlchemy", identifier=identifier)
uri = Literal(f"sqlite:///{store_file}")
self.graph.open(uri, create=True)
else:
raise ValueError("store should be pyiron_project, SQLAlchemy, or Memory")
raise ValueError("Memory or SQLAlchemy")

#start the storage
self.structure_store = _setup_structure_store(self.structure_store)
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ rdflib
pyyaml
graphviz
networkx
ipycytoscape
pyscal3
spglib
rdflib-sqlalchemy
sqlalchemy<2.0.0
pandas
owlready2
Loading