Skip to content

Commit 3b44d50

Browse files
committed
Add test
1 parent fa2edb4 commit 3b44d50

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed

tests/data/example_dataset.trig

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
3+
4+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
5+
@prefix fam: <https://vocab.example.org/family#> .
6+
@prefix sim: <https://simpsons.example.org/> .
7+
8+
sim:TheSimpsons {
9+
10+
#The Simpson
11+
sim:TheSimpsons rdf:type fam:Family ;
12+
fam:hasFamilyMember sim:Homer ,
13+
sim:Marge ,
14+
sim:Bart ,
15+
sim:Lisa ,
16+
sim:Maggie .
17+
18+
#Homer
19+
sim:Homer rdf:type foaf:Person .
20+
sim:Homer foaf:name "Homer Simpson" .
21+
sim:Homer foaf:age "36"^^xsd:int .
22+
23+
#Marge
24+
sim:Marge rdf:type foaf:Person ;
25+
foaf:name "Marge Simpson" ;
26+
foaf:age "34"^^xsd:int .
27+
28+
#Bart
29+
sim:Bart rdf:type foaf:Person ;
30+
foaf:name "Bart Simpson" ;
31+
foaf:age "10"^^xsd:int .
32+
33+
#Lisa
34+
sim:Lisa rdf:type foaf:Person ;
35+
foaf:name "Lisa Simpson" ;
36+
foaf:age "8"^^xsd:int .
37+
38+
#Maggie
39+
sim:Maggie rdf:type foaf:Person ;
40+
foaf:name "Maggie Simpson" ;
41+
foaf:age "1"^^xsd:int .
42+
}
43+
44+
sim:Relatives {
45+
#Grandparents
46+
sim:Abraham rdf:type foaf:Person ;
47+
foaf:name "Abraham Simpson".
48+
sim:Mona rdf:type foaf:Person .
49+
50+
#Aunts and Uncles
51+
sim:Patty rdf:type foaf:Person .
52+
sim:Selma rdf:type foaf:Person .
53+
sim:Herb rdf:type foaf:Person .
54+
55+
sim:Patty fam:hasSister sim:Selma .
56+
sim:Selma fam:hasSister sim:Patty .
57+
58+
}
59+
60+
sim:OtherPeople {
61+
sim:Moe rdf:type foaf:Person ;
62+
foaf:name "Moe Szyslak";
63+
foaf:age "50".
64+
}
65+
66+
#Family relationships
67+
sim:Homer fam:hasSpouse sim:Marge .
68+
sim:Marge fam:hasSpouse sim:Homer .
69+
70+
sim:Bart fam:hasFather sim:Homer ;
71+
fam:hasMother sim:Marge ;
72+
fam:hasSister sim:Lisa ;
73+
fam:hasSister sim:Maggie .
74+
75+
sim:Lisa fam:hasFather sim:Homer ;
76+
fam:hasMother sim:Marge ;
77+
fam:hasBrother sim:Bart ;
78+
fam:hasSister sim:Maggie .
79+
80+
sim:Maggie fam:hasFather sim:Homer ;
81+
fam:hasMother sim:Marge ;
82+
fam:hasBrother sim:Bart ;
83+
fam:hasSister sim:Lisa .
84+
85+
#Maggies Grandparents
86+
sim:Maggie fam:hasParent [
87+
fam:hasFather sim:Abraham
88+
] .
89+
90+
sim:Maggie fam:hasParent [
91+
fam:hasMother sim:Mona
92+
] .
93+
94+
#Lisas Aunts and Uncles
95+
sim:Lisa fam:hasParent [
96+
fam:hasSister sim:Selma ;
97+
fam:hasSister sim:Patty
98+
] .
99+
100+
sim:Lisa fam:hasParent [
101+
fam:hasBrother sim:Herb
102+
] .
103+
104+
#Marge father in law
105+
sim:Homer fam:hasFather sim:Abraham .

tests/test_api.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@ def test_api_with_turtle_graph_specify_format(tmp_path):
1313
p = tmp_path / "graph_file.ttl"
1414
copy_file(simpsons.graph_file, p)
1515
sparql_file(p, graph_format="turtle")
16+
17+
18+
def test_api_with_trig_graph_specify_format(tmp_path):
19+
p = tmp_path / "dataset.trig"
20+
copy_file("tests/data/example_dataset.trig", p)
21+
sparql_file(p, graph_format="trig")

0 commit comments

Comments
 (0)