File tree Expand file tree Collapse file tree 4 files changed +12
-5
lines changed
case_utils/case_sparql_construct
tests/case_sparql_construct Expand file tree Collapse file tree 4 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def main():
78
78
"format" : output_format
79
79
}
80
80
if output_format == "json-ld" :
81
- context_dictionary = {k :v for (k ,v ) in graph .namespace_manager .namespaces ()}
81
+ context_dictionary = {k :v for (k ,v ) in out_graph .namespace_manager .namespaces ()}
82
82
serialize_kwargs ["context" ] = context_dictionary
83
83
84
84
out_graph .serialize (args .out_graph , ** serialize_kwargs )
Original file line number Diff line number Diff line change
1
+ output.json
1
2
output.ttl
Original file line number Diff line number Diff line change 21
21
output.ttl
22
22
23
23
check : \
24
+ output.json \
24
25
output.ttl
25
26
source $(tests_srcdir)/venv/bin/activate \
26
27
&& pytest \
@@ -30,10 +31,10 @@ clean:
30
31
@rm -rf \
31
32
__pycache__
32
33
@rm -f \
33
- output.ttl \
34
+ output.* \
34
35
_*
35
36
36
- output.ttl : \
37
+ output.% : \
37
38
$(tests_srcdir)/.venv.done.log \
38
39
$(top_srcdir)/case_utils/case_sparql_construct/__init__.py \
39
40
input-1.sparql \
Original file line number Diff line number Diff line change 15
15
16
16
import case_utils
17
17
18
- def test_templates_with_blank_nodes_result( ) :
18
+ def _test_templates_with_blank_nodes_result(filename ) :
19
19
ground_truth_positive = {
20
20
("Alice", "Hacker"),
21
21
("Bob", "Hacker")
22
22
}
23
23
ground_truth_negative = set()
24
24
25
25
graph = rdflib.Graph()
26
- graph.parse("output.ttl" , format=case_utils.guess_format("output.ttl" ))
26
+ graph.parse(filename , format=case_utils.guess_format(filename ))
27
27
28
28
computed = set()
29
29
query_string = """\
@@ -47,3 +47,8 @@ def test_templates_with_blank_nodes_result():
47
47
l_family_name.toPython()
48
48
))
49
49
assert computed == ground_truth_positive
50
+
51
+ def test_templates_with_blank_nodes_result_json() :
52
+ _test_templates_with_blank_nodes_result("output.json")
53
+ def test_templates_with_blank_nodes_result_turtle() :
54
+ _test_templates_with_blank_nodes_result("output.ttl")
You can’t perform that action at this time.
0 commit comments