-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GH-4833: Copy triple structures to avoid infinite loops
The current implementation of the algorithm for the hierachical JSON-LD output changes references of the triples stored in `List`s and keeps adding these references to the output. This can leed to infinite loops when traversing the result. Making copies of the contained lists avoids this.
- Loading branch information
1 parent
cdb38ad
commit a1973a3
Showing
3 changed files
with
83 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
core/rio/jsonld/src/test/resources/serialized/testMultipleLoops.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
[ { | ||
"@id" : "sch:node2", | ||
"sch:pred2" : [ { | ||
"@id" : "sch:node3", | ||
"sch:pred4" : [ { | ||
"@id" : "sch:node2" | ||
} ], | ||
"sch:pred5" : [ { | ||
"@id" : "sch:node6", | ||
"sch:pred6" : [ { | ||
"@id" : "sch:node3" | ||
} ] | ||
} ] | ||
}, { | ||
"@id" : "sch:node4", | ||
"sch:pred4" : [ { | ||
"@id" : "sch:node2" | ||
} ] | ||
}, { | ||
"@id" : "sch:node5", | ||
"sch:pred4" : [ { | ||
"@id" : "sch:node2" | ||
} ], | ||
"sch:pred5" : [ { | ||
"@id" : "sch:node6", | ||
"sch:pred6" : [ { | ||
"@id" : "sch:node3", | ||
"sch:pred4" : [ { | ||
"@id" : "sch:node2" | ||
} ], | ||
"sch:pred5" : [ { | ||
"@id" : "sch:node6" | ||
} ] | ||
} ] | ||
} ] | ||
} ], | ||
"sch:pred3" : [ { | ||
"@id" : "sch:node1", | ||
"sch:pred1" : [ { | ||
"@id" : "sch:node2" | ||
} ] | ||
} ] | ||
} ] |