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

Query building #50

Merged
merged 49 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
a3f9d61
add draft for terms
srmnitc Nov 9, 2023
10b50a3
add extra namespaces
srmnitc Nov 9, 2023
4a8c336
add namespaces
srmnitc Nov 9, 2023
db48d51
add terms to network
srmnitc Nov 9, 2023
b24b2af
add overloading for terms
srmnitc Nov 9, 2023
1baca75
add overloading for terms
srmnitc Nov 9, 2023
bec26cc
add operations on terms
srmnitc Nov 21, 2023
8f161e3
add and and or operators
srmnitc Nov 21, 2023
816cc35
update query building with conditions
srmnitc Nov 21, 2023
01a0b33
update terms
srmnitc Nov 22, 2023
7ce6e1c
remove None from condition
srmnitc Nov 22, 2023
05e0d8a
add return in comparison operators
srmnitc Nov 22, 2023
99f2b12
add ontologies
srmnitc Nov 22, 2023
175888d
fix Or constructor
srmnitc Nov 22, 2023
7692498
update term
srmnitc Nov 22, 2023
275bb06
update strip name
srmnitc Nov 22, 2023
ab656e7
remove self
srmnitc Nov 22, 2023
ef2e2f6
add more baked-in ontologies
srmnitc Nov 22, 2023
8a9e135
add onto network and update query
srmnitc Nov 22, 2023
da50c42
add new test notebooks
srmnitc Nov 23, 2023
f73d042
clean up notebooks
srmnitc Nov 27, 2023
f1685fe
remove stray read-in
srmnitc Nov 27, 2023
e04e0ca
add function for adding terms
srmnitc Nov 27, 2023
8cee057
add possibility to overwrite names
srmnitc Nov 27, 2023
b9dbf19
add term names
srmnitc Nov 27, 2023
db0c70c
add query
srmnitc Nov 28, 2023
1eec30e
add possibility to override namespace
srmnitc Nov 28, 2023
5c2225f
only add FILTER if text is present
srmnitc Nov 28, 2023
572a40c
add possibility to return query
srmnitc Nov 28, 2023
b63e3d3
add Alt name
srmnitc Nov 28, 2023
d726a88
remove double namespaces
srmnitc Nov 28, 2023
ca77cdc
add optional selection of ontology
srmnitc Nov 28, 2023
9d514a5
remove workflow terms from inbuilt ontology
srmnitc Nov 28, 2023
321feb0
fix bug
srmnitc Nov 28, 2023
db0dcac
add condition as one of the destinations
srmnitc Nov 28, 2023
e464289
add new clean datatype method
srmnitc Nov 28, 2023
9183185
add source in query names
srmnitc Nov 28, 2023
3c9f182
add sample query and make condition optional
srmnitc Nov 28, 2023
a0f7b5b
fix write method
srmnitc Nov 28, 2023
ae4265d
fix write method
srmnitc Nov 28, 2023
9bf45fe
fix GB terms
srmnitc Nov 28, 2023
32c222d
enforce types of end members
srmnitc Nov 28, 2023
fe4a998
add possibility to enforce types
srmnitc Nov 28, 2023
e49181e
fix GB formulation
srmnitc Nov 28, 2023
5d1882e
only fix types for classes
srmnitc Nov 28, 2023
07c65aa
fix more write methods
srmnitc Nov 28, 2023
a01518c
update examples
srmnitc Nov 28, 2023
108484b
fix ontology paths
srmnitc Nov 28, 2023
4c9b981
fix ontology paths
srmnitc Nov 28, 2023
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
7,802 changes: 4,330 additions & 3,472 deletions examples/01_getting_started.ipynb

Large diffs are not rendered by default.

1,597 changes: 1,597 additions & 0 deletions examples/02_grain_boundaries.ipynb

Large diffs are not rendered by default.

33 changes: 0 additions & 33 deletions examples/02_using_databases.ipynb

This file was deleted.

120 changes: 120 additions & 0 deletions notebooks/create_onto.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 9,
"id": "0480f3cb-a9df-4dff-89b6-95747572fb39",
"metadata": {},
"outputs": [],
"source": [
"from owlready2 import *"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "cdab09a3-b991-4c6f-ab11-3d630293e2a9",
"metadata": {},
"outputs": [],
"source": [
"onto = get_ontology(\"http://purls.helmholtz-metadaten.de/msmo/\")"
]
},
{
"cell_type": "code",
"execution_count": 11,
"id": "8f470001-3a9c-4cd0-817f-57fa06a10da0",
"metadata": {},
"outputs": [],
"source": [
"class Calculation(Thing):\n",
" namespace = onto\n",
"\n",
"class hasMethod(Calculation >> ComputationalMethod):\n",
" pass\n",
" \n",
"class ComputationalMethod(Thing):\n",
" namespace = onto\n",
"\n",
"#Atomistic Method\n",
"class AtomisticMethod(ComputationalMethod):\n",
" pass\n",
"\n",
"class DensityFunctionalTheory(AtomisticMethod):\n",
" pass\n",
"\n",
"class MolecularDynamics(AtomisticMethod):\n",
" pass\n",
"\n",
"class MolecularDynamicsMinimization(MolecularDynamics):\n",
" pass\n",
"\n",
"class MolecularDynamicsNPT(MolecularDynamics):\n",
" pass\n",
"\n",
"class MolecularDynamicsNVT(MolecularDynamics):\n",
" pass\n",
"\n",
"#data properties\n",
"class hasPressure(MolecularDynamics >> float):\n",
" pass\n",
"\n",
"class hasTemperature(MolecularDynamics >> float):\n",
" pass\n",
"\n",
"class usesPotential(MolecularDynamics >> str):\n",
" pass\n",
"\n",
"class AbinitioMolecularDynamics(AtomisticMethod):\n",
" pass\n",
"\n",
"\n",
"#Monte Carlo\n",
"class MonteCarloMethod(ComputationalMethod):\n",
" pass\n",
"\n",
"class KineticMonteCarloMethod(MonteCarloMethod):\n",
" pass"
]
},
{
"cell_type": "code",
"execution_count": 12,
"id": "677852fc-e05a-4922-a808-47761f25ffcb",
"metadata": {},
"outputs": [],
"source": [
"onto.save(file = \"msmo.owl\", format = \"rdfxml\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "22b6e284-2b54-4851-a379-1a8df26f4705",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
142 changes: 142 additions & 0 deletions notebooks/data_read.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "bec4e0e1-2e16-4241-89e0-a7bbf8a53d8c",
"metadata": {},
"source": [
"# DC3 dataset"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "df95f07a-00a8-42f9-9a18-ba8532a5a512",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"from pyscal3.core import System\n",
"import pyscal3.crystal_structures as pcs"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "00abae5c-4123-4456-8144-cf6362ea2bfd",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"sys = System('datasets/T_0.04Tm_snapshot_1')"
]
},
{
"cell_type": "markdown",
"id": "2be601e0-9ea5-4c63-9cd6-67e99fa95306",
"metadata": {},
"source": [
"Lacks all information about the underlying structure:\n",
"\n",
"- species (LAMMPS)\n",
"- lattice constant \n",
"- Crystal structure name\n",
"- Bravais lattice\n",
"- Basis positions\n",
"- Basis occupancy\n",
"- Lattice vectors\n",
"- Space group symbol (?)\n",
"- Space group name (?)"
]
},
{
"cell_type": "markdown",
"id": "5ba58cff-3b6b-44b9-ad5b-92e14e61d517",
"metadata": {},
"source": [
"How we do currently"
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "dd472cdf-ef2c-4ad4-9852-39370c715f5a",
"metadata": {
"tags": []
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Al\n"
]
}
],
"source": [
"atoms, box, sdict = pcs.make_crystal('fcc', lattice_constant=1,\n",
" element='Al', return_structure_dict=True)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "aed4d624-b25a-48b3-8bbe-6140acc5e711",
"metadata": {
"tags": []
},
"outputs": [
{
"data": {
"text/plain": [
"{'natoms': 4,\n",
" 'species': [1, 1, 1, 1],\n",
" 'scaling_factors': [1.0, 1.0, 1.0],\n",
" 'positions': [[0.0, 0.0, 0.0],\n",
" [0.5, 0.0, 0.5],\n",
" [0.0, 0.5, 0.5],\n",
" [0.5, 0.5, 0.0]]}"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"sdict"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "712b32c7-1d6b-4fbb-ae65-64dbebc5a3b2",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.5"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading