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():
7878 "format" : output_format
7979 }
8080 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 ()}
8282 serialize_kwargs ["context" ] = context_dictionary
8383
8484 out_graph .serialize (args .out_graph , ** serialize_kwargs )
Original file line number Diff line number Diff line change 1+ output.json
12output.ttl
Original file line number Diff line number Diff line change 2121 output.ttl
2222
2323check : \
24+ output.json \
2425 output.ttl
2526 source $(tests_srcdir)/venv/bin/activate \
2627 && pytest \
@@ -30,10 +31,10 @@ clean:
3031 @rm -rf \
3132 __pycache__
3233 @rm -f \
33- output.ttl \
34+ output.* \
3435 _*
3536
36- output.ttl : \
37+ output.% : \
3738 $(tests_srcdir)/.venv.done.log \
3839 $(top_srcdir)/case_utils/case_sparql_construct/__init__.py \
3940 input-1.sparql \
Original file line number Diff line number Diff line change 1515
1616import case_utils
1717
18- def test_templates_with_blank_nodes_result( ) :
18+ def _test_templates_with_blank_nodes_result(filename ) :
1919 ground_truth_positive = {
2020 ("Alice", "Hacker"),
2121 ("Bob", "Hacker")
2222 }
2323 ground_truth_negative = set()
2424
2525 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 ))
2727
2828 computed = set()
2929 query_string = """\
@@ -47,3 +47,8 @@ def test_templates_with_blank_nodes_result():
4747 l_family_name.toPython()
4848 ))
4949 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