Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
Requirement Formalization Tool
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Thodoris Nestoridis
Requirement Formalization Tool
Commits
3db478fe
Commit
3db478fe
authored
Jan 27, 2021
by
Thodoris Nestoridis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test the add of rdflib-test scripts
parent
bf1b8fb5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
crud_ontology.py
reqtool/test_scripts/crud_ontology.py
+29
-0
No files found.
reqtool/test_scripts/crud_ontology.py
0 → 100644
View file @
3db478fe
from
rdflib
import
Graph
from
rdflib
import
Namespace
from
rdflib.namespace
import
RDF
g
=
Graph
()
#g.parse("../Ontologies/Mokos_18_1_7_47 copy.ttl", format="turtle")
#print(len(g)) # prints 2
RDO_instances
=
Namespace
(
"http://delab.csd.auth.gr/ontologies/2018/RDO-instances#"
)
RBO
=
Namespace
(
"http://delab.csd.auth.gr/ontologies/2018/RBO#"
)
RDO
=
Namespace
(
"http://delab.csd.auth.gr/ontologies/2018/RDO#"
)
#add unique id
new_req
=
RDO_instances
.
EEMR
#add the S1-S5 or M1-M16 etc
new_req_2
=
RBO
.
M16
new_req_3
=
RBO
.
M17
#g.bind('RDO_instances', RDO_instances)
g
.
add
((
new_req
,
RDF
.
type
,
new_req_2
))
g
.
add
((
new_req
,
RDF
.
type
,
new_req_3
))
print
(
g
.
serialize
(
format
=
"turtle"
)
.
decode
(
"utf-8"
))
#save in file
#g.serialize(destination='output.txt', format='turtle')
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment