Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TOAR-II FastAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
toar-data
TOAR-II FastAPI
Commits
d08ec2b5
Commit
d08ec2b5
authored
4 years ago
by
Sabine Schröder
Browse files
Options
Downloads
Patches
Plain Diff
onthologies: forgot to delete debug statement
parent
0a6067cf
No related branches found
No related tags found
No related merge requests found
Pipeline
#58404
passed
4 years ago
Stage: deploy
Stage: pages
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
toardb/utils/TOARII_ontology.py
+1
-2
1 addition, 2 deletions
toardb/utils/TOARII_ontology.py
toardb/utils/onto_example.py
+9
-7
9 additions, 7 deletions
toardb/utils/onto_example.py
with
10 additions
and
9 deletions
toardb/utils/TOARII_ontology.py
+
1
−
2
View file @
d08ec2b5
...
@@ -52,7 +52,7 @@ class TOAR_Ontology:
...
@@ -52,7 +52,7 @@ class TOAR_Ontology:
"""
"""
self
.
filename
=
filename
self
.
filename
=
filename
g
=
rdflib
.
Graph
()
g
=
rdflib
.
Graph
()
self
.
graph
=
g
.
parse
(
"
TOAR-II-Ontology_2020-11-24.owl
"
,
format
=
'
json-ld
'
)
self
.
graph
=
g
.
parse
(
self
.
filename
,
format
=
'
json-ld
'
)
def
get_class
(
self
,
title
):
def
get_class
(
self
,
title
):
"""
"""
...
@@ -60,7 +60,6 @@ class TOAR_Ontology:
...
@@ -60,7 +60,6 @@ class TOAR_Ontology:
"""
"""
for
s
,
p
,
o
in
self
.
graph
.
triples
(
(
None
,
RDF
.
type
,
rdflib
.
URIRef
(
"
http://www.w3.org/2002/07/owl#Class
"
)
)
):
for
s
,
p
,
o
in
self
.
graph
.
triples
(
(
None
,
RDF
.
type
,
rdflib
.
URIRef
(
"
http://www.w3.org/2002/07/owl#Class
"
)
)
):
value
=
self
.
graph
.
value
(
subject
=
s
,
predicate
=
RDFS
.
label
)
value
=
self
.
graph
.
value
(
subject
=
s
,
predicate
=
RDFS
.
label
)
print
(
f
"
value:
{
value
}
, title:
{
title
}
"
)
if
value
and
value
.
strip
()
==
title
.
strip
():
if
value
and
value
.
strip
()
==
title
.
strip
():
ont_class
=
s
ont_class
=
s
return
ont_class
return
ont_class
...
...
This diff is collapsed.
Click to expand it.
toardb/utils/onto_example.py
+
9
−
7
View file @
d08ec2b5
import
TOARII_ontology
import
TOARII_ontology
help
(
TOARII_ontology
)
help
(
TOARII_ontology
)
onto
=
TOARII_ontology
.
TOAR_Ontology
(
'
TOAR-
II-
Ontology
_2020-11-24
.owl
'
)
onto
=
TOARII_ontology
.
TOAR_Ontology
(
'
TOAR-Ontology
-TimeZone-CountryCode
.owl
'
)
help
(
onto
)
help
(
onto
)
onto
.
print
()
onto
.
print
()
onto
.
print
(
format
=
"
turtle
"
)
onto
.
print
(
format
=
"
turtle
"
)
...
@@ -15,16 +15,18 @@ onto.show_class_definition(czclass)
...
@@ -15,16 +15,18 @@ onto.show_class_definition(czclass)
onto
.
show_entries
(
czclass
)
onto
.
show_entries
(
czclass
)
onto
.
check_entry
(
'
PolarMoist
'
,
czclass
)
onto
.
check_entry
(
'
PolarMoist
'
,
czclass
)
onto
.
check_entry
(
'
PolarWet
'
,
czclass
)
onto
.
check_entry
(
'
PolarWet
'
,
czclass
)
onto
=
TOARII_ontology
.
TOAR_Ontology
(
'
TOAR-Ontology-TimeZone-CountryCode.owl
'
)
dlclass
=
onto
.
get_class
(
'
Station Dominant Landcover Type
'
)
onto
.
show_class_definition
(
dlclass
)
onto
.
show_entries
(
dlclass
)
ccclass
=
onto
.
get_class
(
'
Country Code
'
)
ccclass
=
onto
.
get_class
(
'
Country Code
'
)
ccclass
=
onto
.
get_class
(
'
Country Code
'
)
ccclass
=
onto
.
get_class
(
'
Country Code
'
)
onto
.
show_class_definition
(
ccclass
)
onto
.
show_class_definition
(
ccclass
)
onto
.
show_entries
(
ccclass
)
onto
.
show_entries
(
ccclass
)
onto
.
check_entry
(
'
DE
'
,
ccclass
)
onto
.
check_entry
(
'
BE
'
,
ccclass
)
#highest index of NamedInvidual is 194
#highest index of NamedInvidual is 194
#==> start counting from here
#==> start counting from here
onto
.
add_entry
(
ccclass
,
195
,
"
GB
"
,
"
United Kingdom of Great Britain and Northern Ireland
"
)
onto
.
add_entry
(
ccclass
,
195
,
'
TZ
'
,
'
United Republic of Tanzania
'
)
onto
.
add_entry
(
ccclass
,
196
,
'
SX
'
,
'
Sint Maarten (Dutch part)
'
)
onto
.
add_entry
(
ccclass
,
197
,
'
BE
'
,
'
Belgium
'
)
onto
.
check_entry
(
'
BE
'
,
ccclass
)
onto
.
show_entries
(
ccclass
)
onto
.
show_entries
(
ccclass
)
onto
.
save
(
'
TOAR-II-Ontology_2021-01-26.owl
'
)
#nun hier entsprechendes für Timezone
onto
.
save
(
'
TOAR-Ontology-TimeZone-CountryCode_20210128.owl
'
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment