Commit bc17fb7
authored
jsonld: Do not merge nodes with different invalid URIs (#3011)
When parsing JSON-LD with invalid URIs in the `@id`, the
`generalized_rdf: True` option allows parsing these nodes as blank nodes
instead of outright rejecting the document.
However, all nodes with invalid URIs were mapped to the same blank node,
resulting in incorrect data. For example, without this patch, the new test
fails with:
```
AssertionError: Expected:
@Prefix schema: <https://schema.org/> .
<https://example.org/root-object> schema:author [ schema:familyName "Doe" ;
schema:givenName "Jane" ;
schema:name "Jane Doe" ],
[ schema:familyName "Doe" ;
schema:givenName "John" ;
schema:name "John Doe" ] .
Got:
@Prefix schema: <https://schema.org/> .
<https://example.org/root-object> schema:author <> .
<> schema:familyName "Doe" ;
schema:givenName "Jane",
"John" ;
schema:name "Jane Doe",
"John Doe" .
```1 parent 182c3ba commit bc17fb7
File tree
4 files changed
+49
-1
lines changed- rdflib/plugins/parsers
- test/jsonld/local-suite
4 files changed
+49
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
215 | 216 | | |
216 | 217 | | |
217 | 218 | | |
| 219 | + | |
218 | 220 | | |
219 | 221 | | |
220 | 222 | | |
| |||
623 | 625 | | |
624 | 626 | | |
625 | 627 | | |
626 | | - | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
627 | 634 | | |
628 | 635 | | |
629 | 636 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
30 | 41 | | |
31 | 42 | | |
32 | 43 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
0 commit comments