Skip to content

Commit

Permalink
Use random bnode generator on Turtle/TriG decoders by default
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelotto committed Jun 28, 2024
1 parent 98f7514 commit a82122d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ Elixir v1.15 or later, where this issue has been resolved.

### Changed

- Default blank node generation in Turtle decoder now generates random blank node
identifiers instead of the previous deterministic incremented identifiers.
This change ensures unique blank nodes across multiple parsing operations.
You can opt back to the previous behaviour with the new `turtle_trig_decoder_bnode_gen`
application config using the `:increment` value.
- The `prefixes` of an `RDF.Graph` are now always a `RDF.PrefixMap` and no longer `nil`
initially, since this had the confusing consequence that an `RDF.Graph` where all
prefixes were deleted was not equal to same graph where the deleted were never set,
Expand Down
2 changes: 2 additions & 0 deletions config/test.exs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Config

config :rdf, :earl_formatter, author_iri: "http://marcelotto.net/#me"

config :rdf, turtle_trig_decoder_bnode_gen: :increment
2 changes: 1 addition & 1 deletion lib/rdf/serializations/turtle_trig/decoder/state.ex
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ defmodule RDF.TurtleTriG.Decoder.State do

alias RDF.BlankNode

@default_turtle_trig_decoder_bnode_gen :increment
@default_turtle_trig_decoder_bnode_gen :random

def default_bnode_gen do
Application.get_env(
Expand Down

0 comments on commit a82122d

Please sign in to comment.