Skip to content

Commit d4f1f2c

Browse files
Merge pull request #60 from simphony/update-outdated-content
Update outdated content
2 parents d818e9a + 607c5fd commit d4f1f2c

19 files changed

+395
-273
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,12 @@ jobs:
1414
with:
1515
python-version: 3.7
1616
- name: Install OS dependencies
17-
run: >
18-
sudo apt-get install pandoc
19-
latexmk
20-
texlive-fonts-recommended
21-
texlive-latex-recommended
22-
texlive-latex-extra
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install pandoc latexmk
20+
sudo apt-get install texlive-fonts-recommended texlive-latex-recommended texlive-latex-extra
2321
- name: Install python dependencies
2422
run: |
25-
sudo apt-get install pandoc latexmk texlive-fonts-recommended
26-
sudo apt-get install texlive-latex-recommended texlive-latex-extra
2723
python -m pip install --upgrade pip
2824
pip install wheel
2925
pip install -r requirements.txt

docs/source/about.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
# About
22

33
SimPhoNy is an ontology-based framework that promotes and enables interoperability between any 3rd-party software tool.
4-
Its latest version is soon to become an open-source python project.
4+
Its [core functionality](https://github.com/simphony/osp-core) is an open-source python project.
55
The name ‘SimPhoNy’ stems from the SimPhoNy EU-project in which it was originally developed
66
(See more details [here](https://www.simphony-project.eu/)).
77
One of SimPhoNy’s main tasks is to convert *opaque* data, meaning data whose semantics are hidden, to *transparent* data, that is data whose semantics is understood and easily accessible.
88

99
This project aims to clarify the purpose and usage of the SimPhoNy platform through simple, short examples.
1010
In particular, this guide will try to expose the main concepts and components.
1111

12-
_Contact:_ [Pablo de Andres](mailto:[email protected]),
13-
[Matthias Urban](mailto:[email protected]) and
14-
[Yoav Nahshon](mailto:[email protected]) from
15-
the Materials Data Science and Informatics team, Fraunhofer IWM.
12+
All the tutorials in this documentation are Jupyter notebooks that can be downloaded
13+
by clicking on the "Edit on Github" button on the top right of the page.
1614

1715
# License
18-
BSD 3-Clause
19-
Copyright 2020 SimPhoNy OSP-core developers
16+
BSD 3-Clause
17+
Copyright 2020 SimPhoNy OSP-core developers.
2018

2119
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
2220

docs/source/contact.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Contact
2+
If you see something wrong, missing, or in need of clarification, you can directly
3+
create an issue in [here](https://github.com/simphony/docs/issues).
4+
5+
Any other questions, issues or comments can be directed to [Pablo de Andres](mailto:[email protected]),
6+
[Matthias Urban](mailto:[email protected]) and
7+
[Yoav Nahshon](mailto:[email protected])
8+
from the Materials Data Science and Informatics team, Fraunhofer IWM.

docs/source/detailed_design.md

Lines changed: 114 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -6,125 +6,143 @@ For a more general overview, go to [getting started](./getting_started.md#genera
66

77
```eval_rst
88
.. uml::
9-
:caption: Standard design
10-
:align: center
11-
12-
allow_mixing
13-
actor User
14-
15-
rectangle SemanticLayer {
16-
17-
class Cuds {
18-
Session session
19-
UUID uuid
20-
CUBA cuba_key
21-
--
22-
add() : Cuds
23-
get() : Cuds
24-
remove() : void
25-
update() : void
26-
iter() : Iterator<Cuds>
27-
}
28-
}
29-
30-
rectangle InteroperabilityLayer {
31-
32-
class Registry <dict> {
33-
}
34-
35-
abstract class Session {
36-
Registry : registry
37-
--
38-
store() : void
39-
load() : Cuds
40-
sync() : void
41-
}
42-
43-
class SomeWrapperSession implements Session {
44-
List added
45-
List updated
46-
List removed
47-
SyntacticLayer syntactic
48-
--
49-
}
50-
}
9+
:caption: Standard design
10+
:align: center
11+
12+
allow_mixing
13+
actor User
14+
15+
circle pico
16+
17+
rectangle SemanticLayer {
18+
class Cuds {
19+
Session session
20+
UUID uuid
21+
OntologyEntity oclass
22+
--
23+
add() : Cuds
24+
get() : Cuds
25+
remove() : void
26+
update() : void
27+
iter() : Iterator<Cuds>
28+
}
29+
30+
abstract class OntologyEntity {
31+
String name
32+
URIRef iri
33+
String tblname
34+
OntologyNamespace namespace
35+
Set direct_superclasses
36+
Set direct_subclasses
37+
Set superclasses
38+
Set subclasses
39+
String description
40+
--
41+
get_triples() : triple
42+
is_superclass_of() : bool
43+
is_subclass_of() : bool
44+
}
45+
class OntologyClass implements OntologyEntity {
46+
Dict attributes
47+
Dict own_attributes
48+
}
49+
50+
class OntologyRelationship implements OntologyEntity {
51+
OntologyRelationship inverse
52+
}
53+
54+
class OntologyAttribute implements OntologyEntity {
55+
URIRef datatype
56+
--
57+
convert_to_datatype() : Any
58+
convert_to_basic_type() : Any
59+
}
60+
61+
class OntologyNamespace {
62+
--
63+
get_iri() : URIRef
64+
get_default_rel() : OntologyRelationship
65+
get() : OntologyEntity
66+
67+
}
68+
69+
class NamespaceRegistry {
70+
--
71+
get() : OntologyNamespace
72+
update_namespaces() : void
73+
from_iri() : OntologyEntity
74+
clear() : Graph
75+
store() : void
76+
load() : void
77+
}
78+
}
5179
52-
rectangle SyntacticLayer {
53-
class SyntacticLayer {
80+
rectangle InteroperabilityLayer {
81+
class Registry <dict> {
82+
}
83+
84+
abstract class Session {
85+
Registry : registry
86+
--
87+
store() : void
88+
load() : Cuds
89+
sync() : void
90+
}
91+
92+
class SomeWrapperSession implements Session {
93+
List added
94+
List updated
95+
List removed
96+
SyntacticLayer syntactic
97+
--
98+
}
5499
}
55-
}
56100
57-
database backend
101+
rectangle SyntacticLayer {
102+
class SyntacticLayer {
103+
}
104+
}
58105
106+
database backend
59107
60-
' -----------------------
61-
' ------ RELATIONS ------
62-
' -----------------------
63-
User -> Cuds : interacts_with
108+
' -----------------------
109+
' ------ RELATIONS ------
110+
' -----------------------
111+
User -up-> OntologyClass : interacts_with
112+
Cuds -left> OntologyClass : instance_of
113+
OntologyEntity -> OntologyNamespace : part_of
114+
OntologyNamespace -> NamespaceRegistry : contained_in
115+
OntologyClass -left> OntologyAttribute : has
64116
65-
Cuds -> Session : has_a
66-
Session -> Registry : manages
117+
pico -> NamespaceRegistry : manages
67118
68-
SomeWrapperSession -> SyntacticLayer : manages
119+
Cuds -> Session : has_a
120+
Session -> Registry : manages
69121
70-
SyntacticLayer -> backend : acts_on
122+
SomeWrapperSession -> SyntacticLayer : manages
71123
72-
' -----------------------
73-
' -------- NOTES --------
74-
' -----------------------
75-
note top of Cuds
76-
This will be shallow structure with
77-
the uuids of the contained elements:
78-
{
79-
Relation1: {uid1: cuba_key, uid2: cuba_key},
80-
Relation2: {uid4: cuba_key},
81-
Relation3: {uid3: cuba_key, uid5: cuba_key},
82-
}
83-
end note
84-
85-
note top of Session
86-
Provides the info requested to Cuds
87-
end note
88-
89-
note top of SomeWrapperSession
90-
Updates the registry with information
91-
from the backend and vice versa.
92-
end note
93-
94-
note top of Registry
95-
Flat structure that contains all the
96-
objects accessible through their uid:
97-
{
98-
uid1: object1,
99-
uid2: object2,
100-
uid3: object3,
101-
}
102-
end note
124+
SyntacticLayer -> backend : acts_on
103125
104-
note top of SyntacticLayer
105-
Connects to the engine and
106-
knows its specific API
107-
end note
126+
OntologyRelationship -[hidden]> OntologyAttribute
108127
```
109128

110-
111129
## Semantic layer
112130
The semantic layer is the representation of the classes of the ontology in a programming language.
113131

114132
When the user installs an ontology through `pico`,
115-
all ontology classes are saved in a pickle file in the site-packages of the python environment.
133+
all ontology concepts are saved in a graph in `~/.osp_ontologies`.
116134

117135
The procedure is as follows:
118136
- The `OntologyInstallationManager` receives a list of yml files with ontologies to install.
119137
- It instantiates a `Parser`.
120138
- The parser goes through the ontologies and creates an `OntologyClass` per entity.
121139
- All the oclasses of the same namespace are grouped in an `OntologyNamespace`.
122-
- All the registries are collected in the `NamespaceRegistry`. This object will be pickled.
140+
- All the registries are collected in the `NamespaceRegistry`.
123141

124-
Installing new ontologies loads the pickle and adds new namespaces or modifies the existing ones.
142+
Installing new ontologies loads the graph and adds new namespaces or modifies the existing ones.
125143

126144
When a class is instantiated, an individual is created.
127-
The pickled file is read, and an instance of the [Cuds](#cuds) class with the ontology information is created.
145+
The graph is read, and an instance of the [Cuds](#cuds) class with the ontology information is created.
128146

129147
Through the Cuds they realise the [Cuds API](#cuds-api) which enables the user to work with them in a generic, simple way.
130148

@@ -133,15 +151,15 @@ _Location:_ `osp.core.cuds`
133151

134152
It is the base class for all instances.
135153
Besides whatever might have been defined in the ontology, they all have 3 basic attributes:
136-
- uid: instance of `uuid.UUID`, it serves to uniquely identify an instance
154+
- uid: instance of `uuid.UUID`, it serves to uniquely identify an instance.
137155
- session: this is the link to the interoperability layer.
138156
By default all objects are in the `CoreSession`, unless they are in a wrapper.
139157
- oclass: indicates the ontology class they originate from.
140158

141159
#### Cuds structure
142160
Each cuds object contains the uids and oclass of the directly related entities,
143161
as well as the relationship that connects them.
144-
The actual related objects are kept in the [registry](#registry)
162+
The actual related objects are kept in the [registry](#registry).
145163
```
146164
a_cuds_object := {
147165
Relation1: {uid1: oclass, uid2: oclass},

0 commit comments

Comments
 (0)