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

Better graphs #43

Merged
merged 24 commits into from
Sep 13, 2023
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: 1 addition & 1 deletion notebooks/example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.10.12"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion notebooks/memory_profiling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.10.12"
}
},
"nbformat": 4,
Expand Down
16 changes: 10 additions & 6 deletions pyscal_rdf/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
import pandas as pd

from pyscal_rdf.visualize import visualize_graph
from pyscal_rdf.network import OntologyNetwork
from pyscal_rdf.network.network import OntologyNetwork
from pyscal_rdf.rdfsystem import System
import pyscal_rdf.properties as prp
#from pyscal3.core import System
from pyscal3.atoms import Atoms

CMSO = Namespace("https://purls.helmholtz-metadaten.de/cmso/")
PLDO = Namespace("https://purls.helmholtz-metadaten.de/pldo/")
PODO = Namespace("https://purls.helmholtz-metadaten.de/podo/")
CMSO = Namespace("http://purls.helmholtz-metadaten.de/cmso/")
PLDO = Namespace("http://purls.helmholtz-metadaten.de/pldo/")
PODO = Namespace("http://purls.helmholtz-metadaten.de/podo/")

defstyledict = {
"BNode": {"color": "#ffe6ff",
Expand Down Expand Up @@ -93,7 +93,7 @@ def __init__(self, graph_file=None,
self.material = None
self.sysdict = None
self.sgraph = None
self._query_graph = OntologyNetwork()
#self._query_graph = OntologyNetwork()
self._atom_ids = None

def process_structure(self, structure, format=None):
Expand Down Expand Up @@ -882,7 +882,11 @@ def query(self, inquery):
"""
res = self.graph.query(inquery)
if res is not None:
return pd.DataFrame(res)
for line in inquery.split('\n'):
if 'SELECT DISTINCT' in line:
break
labels = [x[1:] for x in line.split()[2:]]
return pd.DataFrame(res, columns=labels)
raise ValueError("SPARQL query returned None")


Expand Down
203 changes: 0 additions & 203 deletions pyscal_rdf/network.py

This file was deleted.

Empty file added pyscal_rdf/network/__init__.py
Empty file.
Loading