Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attempting to add RDF* Data to a Native Repository Breaks the Repository #5123

Open
mnmercer opened this issue Sep 12, 2024 · 0 comments
Open
Assignees
Labels
🐞 bug issue is a bug
Milestone

Comments

@mnmercer
Copy link
Contributor

Current Behavior

After attempting to add Turtle-star data to a Native Repository, it unsurprisingly throws an error as it appears only MemoryStores have the experimental support for RDF* (correct me if I'm wrong). This is fine, however afterwards no other queries can be run against the Repository, effectively bricking it for an entire application.

Expected Behavior

After the NativeStore rejects Turtle-star or TriG-star data with an appropriate exception, the Repository should still be usable.

Steps To Reproduce

  1. Run the following code and notice the exception thrown by the second try block
String data = """
        @prefix ex: <http://example.org/> .
        @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
                        
        # Basic triples
        ex:JohnDoe ex:worksAt ex:CompanyX .
                        
        # RDF* triples
        <<ex:JohnDoe ex:worksAt ex:CompanyX>> ex:since "2022-01-01"^^xsd:date .
        """;
File dataDir = Files.createTempDir();
Repository repo = new SailRepository(new NativeStore(dataDir));
try (RepositoryConnection conn = repo.getConnection()) {
    conn.add(new ByteArrayInputStream(data.getBytes()), null, RDFFormat.TURTLE);
} catch (Exception ex) {
    ex.printStackTrace();
}

try (RepositoryConnection conn = repo.getConnection(); RepositoryResult<Statement> result = conn.getStatements(null, null, null)) {
    result.forEach(System.out::println);
} finally {
    dataDir.delete();
}

Version

5.0.2

Are you interested in contributing a solution yourself?

No

Anything else?

I first encountered the issue with version 4.3.7, but I confirmed the same issue occurs with 5.0.2.
The initial exception thrown when the data is rejected is java.lang.IllegalArgumentException: value parameter should be a URI, BNode or Literal with an additional exception of java.lang.NullPointerException: Cannot invoke "org.eclipse.rdf4j.common.concurrent.locks.Lock.release()" because "this.txnLock" is null. Then the second try block throws java.lang.IllegalArgumentException: value parameter should be a URI, BNode or Literal again.

@mnmercer mnmercer added the 🐞 bug issue is a bug label Sep 12, 2024
@hmottestad hmottestad added this to the 5.0.3 milestone Sep 12, 2024
@hmottestad hmottestad self-assigned this Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug issue is a bug
Projects
None yet
Development

No branches or pull requests

2 participants