You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to create a MemoryStore from a datafile containing a nested Triple fails.
Expected Behavior
A MemoryStore can be created from a datafile containing a nested Triple.
Steps To Reproduce
Create MemoryStore with persist=true.
Add a statement involving a nested Triple.
Shutdown MemoryStore.
Create MemoryStore from datafile.
Exception in thread "main" java.lang.ClassCastException: class org.eclipse.rdf4j.model.impl.SimpleTriple cannot be cast to class org.eclipse.rdf4j.sail.memory.model.MemResource (org.eclipse.rdf4j.model.impl.SimpleTriple and org.eclipse.rdf4j.sail.memory.model.MemResource are in unnamed module of loader 'app')
2024-01-03T13:28:27.689776800Z at org.eclipse.rdf4j.sail.memory.FileIO.readStatement(FileIO.java:256)
2024-01-03T13:28:27.689938600Z at org.eclipse.rdf4j.sail.memory.FileIO.read(FileIO.java:183)
2024-01-03T13:28:27.689956200Z at org.eclipse.rdf4j.sail.memory.MemoryStore.initializeInternal(MemoryStore.java:289)
2024-01-03T13:28:27.689972100Z at org.eclipse.rdf4j.sail.helpers.AbstractSail.init(AbstractSail.java:183)
2024-01-03T13:28:27.689990100Z at org.eclipse.rdf4j.repository.sail.SailRepository.initializeInternal(SailRepository.java:158)
Version
4.3.8
Are you interested in contributing a solution yourself?
pulquero
changed the title
MemoryStore fails to read data involving persisted triples
MemoryStore fails to read data involving persisted nested triples
Jan 4, 2024
@pulquero Thanks for figuring out this bug! It should be fixed in 4.3.9.
Btw. I noticed that you don't have a name in your Github profile. We like to credit people for bug reports and fixes in the release notes on rdf4j.org, if you add a name to your Github profile then we will use that when we credit you in the release notes.
Current Behavior
Trying to create a MemoryStore from a datafile containing a nested Triple fails.
Expected Behavior
A MemoryStore can be created from a datafile containing a nested Triple.
Steps To Reproduce
Create MemoryStore with persist=true.
Add a statement involving a nested Triple.
Shutdown MemoryStore.
Create MemoryStore from datafile.
Exception in thread "main" java.lang.ClassCastException: class org.eclipse.rdf4j.model.impl.SimpleTriple cannot be cast to class org.eclipse.rdf4j.sail.memory.model.MemResource (org.eclipse.rdf4j.model.impl.SimpleTriple and org.eclipse.rdf4j.sail.memory.model.MemResource are in unnamed module of loader 'app')
2024-01-03T13:28:27.689776800Z at org.eclipse.rdf4j.sail.memory.FileIO.readStatement(FileIO.java:256)
2024-01-03T13:28:27.689938600Z at org.eclipse.rdf4j.sail.memory.FileIO.read(FileIO.java:183)
2024-01-03T13:28:27.689956200Z at org.eclipse.rdf4j.sail.memory.MemoryStore.initializeInternal(MemoryStore.java:289)
2024-01-03T13:28:27.689972100Z at org.eclipse.rdf4j.sail.helpers.AbstractSail.init(AbstractSail.java:183)
2024-01-03T13:28:27.689990100Z at org.eclipse.rdf4j.repository.sail.SailRepository.initializeInternal(SailRepository.java:158)
Version
4.3.8
Are you interested in contributing a solution yourself?
None
Anything else?
The root cause of this is line
rdf4j/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/FileIO.java
Line 323 in d8bdc75
where SimpleValueFactory is used to convert an encoded triple IRI to a nested Triple. This will then cause a class cast exception on line
rdf4j/core/sail/memory/src/main/java/org/eclipse/rdf4j/sail/memory/FileIO.java
Line 256 in d8bdc75
RDFStarUtil should contain methods that take the ValueFactory to use so that the MemoryStore can pass in its ValueFactory.
The text was updated successfully, but these errors were encountered: