Skip to content

Commit 1e96c27

Browse files
committed
fix: tilde and period cases
1 parent 1d98fc7 commit 1e96c27

File tree

3 files changed

+32
-24
lines changed

3 files changed

+32
-24
lines changed

src/json2rdf/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = "74" # shoud equal `git rev-list --count master`
1+
__version__ = "75" # shoud equal `git rev-list --count master`
22
# can roll back to 0 if errors
33
from .json2rdf import json2rdf, j2r

test/test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ def json():
2020
"s p a c e s": "spaced out",
2121
"key_w_us": "has nice key",
2222
"CamelCase": "has nice key",
23+
'~.': 'not allowed at the end',
24+
'.': 'not allowed at the end',
25+
'~': 'tilde sucks',
26+
'x~x': 'tilde sucks',
2327
}
2428
}
2529

test/test/test.ttl

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,38 @@ prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
22
prefix id: <urn:example:id:>
33
prefix prefix: <urn:example:prefix:>
44

5-
_:1696312668992 prefix:k _:1696350342976.
6-
_:1696350202944 prefix:dwbadid id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20.
7-
_:1696350202944 prefix:dwid id:33.
8-
_:1696350202944 prefix:ed _:1696350343488.
9-
_:1696350202944 prefix:el _:1696350343552.
10-
_:1696350202944 prefix:k _:1696350269312.
11-
_:1696350202944 prefix:kk _:1696312668992.
12-
_:1696350202944 prefix:l _:1696350343680.
13-
_:1696350269312 rdf:_0 _:1696350340096.
14-
_:1696350269312 rdf:type rdf:Seq.
15-
_:1696350340096 prefix:k 3.
16-
_:1696350340096 prefix:kk "dil".
17-
_:1696350340096 prefix:kkk true.
18-
_:1696350342976 prefix:k "did".
19-
_:1696350343552 rdf:type rdf:Seq.
20-
_:1696350343680 rdf:_0 1.
21-
_:1696350343680 rdf:_1 2.
22-
_:1696350343680 rdf:_2 3.
23-
_:1696350343680 rdf:_3 "a".
24-
_:1696350343680 rdf:_4 "b".
25-
_:1696350343680 rdf:_5 "c".
26-
_:1696350343680 rdf:type rdf:Seq.
5+
_:2341726208960 prefix:k "did".
6+
_:2341745025984 prefix:k _:2341726208960.
7+
_:2341781694912 prefix:k 3.
8+
_:2341781694912 prefix:kk "dil".
9+
_:2341781694912 prefix:kkk true.
10+
_:2341781773760 prefix:dwbadid id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20.
11+
_:2341781773760 prefix:dwid id:33.
12+
_:2341781773760 prefix:ed _:2341781881664.
13+
_:2341781773760 prefix:el _:2341781881728.
14+
_:2341781773760 prefix:k _:2341781779008.
15+
_:2341781773760 prefix:kk _:2341745025984.
16+
_:2341781773760 prefix:l _:2341781881856.
17+
_:2341781779008 rdf:_0 _:2341781694912.
18+
_:2341781779008 rdf:type rdf:Seq.
19+
_:2341781881728 rdf:type rdf:Seq.
20+
_:2341781881856 rdf:_0 1.
21+
_:2341781881856 rdf:_1 2.
22+
_:2341781881856 rdf:_2 3.
23+
_:2341781881856 rdf:_3 "a".
24+
_:2341781881856 rdf:_4 "b".
25+
_:2341781881856 rdf:_5 "c".
26+
_:2341781881856 rdf:type rdf:Seq.
2727
id:33 prefix:id 33.
2828
id:33 prefix:k "v".
29+
id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20 prefix:%252E "not allowed at the end".
2930
id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20 prefix:%2F "fs".
3031
id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20 prefix:CamelCase "has nice key".
3132
id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20 prefix:horrible%20key%20%40%20%2A%24%20%22%20%2F%20 "!@#$ sdf ".
3233
id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20 prefix:id "sdfsdf / \" : ! @ # ".
3334
id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20 prefix:key_w_us "has nice key".
3435
id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20 prefix:refid id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20.
35-
id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20 prefix:s%20p%20a%20c%20e%20s "spaced out".
36+
id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20 prefix:s%20p%20a%20c%20e%20s "spaced out".
37+
id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20 prefix:x%257Ex "tilde sucks".
38+
id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20 prefix:%257E "tilde sucks".
39+
id:sdfsdf%20%2F%20%22%20%3A%20%21%20%40%20%23%20 prefix:%257E%252E "not allowed at the end".

0 commit comments

Comments
 (0)