File: shex_validate.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 (32 lines) | stat: -rw-r--r-- 593 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
32
from pyrudof import Rudof, RudofConfig

rudof = Rudof(RudofConfig())

rudof.read_shex_str("""
""")

rudof.read_data_str("""
prefix : <http://example.org/>
                    
:x :p 1 .
:y :q 2 .
""")

rudof.read_shapemap_str("""
:x@:S, :y@:S
""")

results = rudof.validate_shex()
print(results.show_as_table())

#for (node, shape, status) in results.to_list():
#    print(f"Node: {node.show()}")
#    print(f"Shape: {shape.show()}")
#    print(f"Conformant?: {status.is_conformant()}")
#    print(f"Appinfo: {status.as_json()}")
#    print("")


rudof.read_shapemap_str("""
:x@:S, :y@:S
""")