File: data_visualization.py

package info (click to toggle)
rudof 0.1.146%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 10,048 kB
  • sloc: python: 1,288; makefile: 32; sh: 1
file content (31 lines) | stat: -rw-r--r-- 694 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from pyrudof import Rudof, RudofConfig, RDFFormat 
config = RudofConfig()
rudof = Rudof(config)

print(config)
data_str = """
prefix : <http://example.org/>
:a :name "Alice" .
"""
data_str1 = """prefix xsd: <http://www.w3.org/2001/XMLSchema#>
prefix : <http://example.org/>
:alice :name "Alice" ; 
  :birthdate "1980-03-02"^^xsd:date ; 
  :enrolledIn :cs101 ;
  :knows :bob .

:bob :name "Robert" ; 
  :birthdate "1981-03-02"^^xsd:date ; 
  :enrolledIn :cs101 ;
  :knows :alice .

:cs101 :name "Computer Science 101"; 
  :student :alice, :bob .
"""

rudof.read_data_str(data_str)

print("RDF Data in PlantUML format:")
uml = rudof.data2plantuml()
print("Finished conversion to UML.")
print(uml)