-
Notifications
You must be signed in to change notification settings - Fork 3
/
trigstar-evaluationtest.py
101 lines (77 loc) · 2.88 KB
/
trigstar-evaluationtest.py
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import pytest
from pathlib import Path
from shutil import copyfile
from tempfile import TemporaryDirectory
from rdflib.exceptions import ParserError
from rdflib import Graph, ConjunctiveGraph
from rdflib.util import guess_format
from rdflib.plugin import register
from rdflib.parser import Parser
from rdflib.serializer import Serializer
import rdflib
from rdflib import URIRef
from rdflib.namespace import RDF
from rdflib.namespace import FOAF
register(
"trigs",
Parser,
"rdflib.plugins.parsers.turtlestar",
"TurtleParser",
)
register(
"trigs",
Parser,
"rdflib.plugins.parsers.trigstar",
"TrigParser",
)
register(
"trigstar",
Serializer,
"rdflib.plugins.serializers.trigstar",
"TrigstarSerializer"
)
# g = Graph()
# g.parse(data="test/trig-star/test_rdfliteral.trig", format = "ttl")
# print(g.serialize(format = "ttl"))
# g = Graph()
# g.parse(data="test/trig-star/test1234.trig", format = "trigs")
# print(g.serialize(format = "trigstar"))
g = ConjunctiveGraph()
g.parse(data="test/trigstar-evaluation/trig-star-eval-01.trig", format = "trigs")
print(g.serialize(format = "trigstar"))
g = ConjunctiveGraph()
g.parse("test/trigstar-evaluation/trig-star-eval-02.trig", format = "trigs")
print(g.serialize(format = "trigstar"))
g = ConjunctiveGraph()
g.parse("test/trigstar-evaluation/trig-star-eval-bnode-1.trig", format = "trigs")
print(g.serialize(format = "trig"))
g = ConjunctiveGraph()
g.parse("test/trigstar-evaluation/trig-star-eval-bnode-2.trig", format = "trigs")
print(g.serialize(format = "trig"))
g = ConjunctiveGraph()
g.parse("test/trigstar-evaluation/trig-star-eval-annotation-1.trig", format = "trigs")
print(g.serialize(format = "trig"))
g = ConjunctiveGraph()
g.parse("test/trigstar-evaluation/trig-star-eval-annotation-2.trig", format = "trigs")
print(g.serialize(format = "trigstar"))
g = ConjunctiveGraph()
g.parse("test/trigstar-evaluation/trig-star-eval-annotation-3.trig", format = "trigs")
print(g.serialize(format = "trigstar"))
g = ConjunctiveGraph()
g.parse("test/trigstar-evaluation/trig-star-eval-annotation-4.trig", format = "trigs")
print(g.serialize(format = "trigstar"))
g = ConjunctiveGraph()
g.parse("test/trigstar-evaluation/trig-star-eval-annotation-5.trig", format = "trigs")
print(g.serialize(format = "trigstar"))
# g = Graph()
# g.parse("test/trigstar-evaluation/trig-star-eval-syntax-bnode-03.trig", format = "trigs")
# print(g.serialize(format = "trigstar"))
g = ConjunctiveGraph()
g.parse("test/trigstar-evaluation/trig-star-eval-quoted-annotation-1.trig", format = "trigs")
print(g.serialize(format = "trigstar"))
g = ConjunctiveGraph()
g.parse("test/trigstar-evaluation/trig-star-eval-quoted-annotation-2.trig", format = "trigs")
print(g.serialize(format = "trigstar"))
g = ConjunctiveGraph()
g.parse("test/trigstar-evaluation/trig-star-eval-quoted-annotation-3.trig", format = "trigs")
print(g.serialize(format = "trigstar"))