
|
If you were logged in you would be able to see more operations.
|
|
Sesame
Created: 31/Jan/08 03:38 PM
Updated: 20/Mar/08 08:11 PM
|
|
| Component/s: |
Memory Sail
|
| Affects Version/s: |
2.0
|
| Fix Version/s: |
2.0.1
|
|
The following JUnit 4 Testcase shows the error.
-------
package org.semweb4j.sesame;
import junit.framework.Assert;
import org.junit.Test;
import org.openrdf.model.URI;
import org.openrdf.model.impl.URIImpl;
import org.openrdf.model.vocabulary.RDFS;
import org.openrdf.repository.Repository;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.sail.SailRepository;
import org.openrdf.sail.Sail;
import org.openrdf.sail.inferencer.fc.ForwardChainingRDFSInferencer;
import org.openrdf.sail.memory.MemoryStore;
public class InferenceBug {
@Test
public void testAddInferredStatementExplicitly() throws RepositoryException {
URI a = new URIImpl("urn:rel:a");
URI b = new URIImpl("urn:rel:b");
URI c = new URIImpl("urn:rel:c");
URI defaultContext = null;
// create a Sail stack
Sail sail = new MemoryStore();
sail = new ForwardChainingRDFSInferencer(sail);
// create a Repository
Repository repository = new SailRepository(sail);
repository.initialize();
RepositoryConnection con = repository.getConnection();
con.add(a, RDFS.SUBPROPERTYOF, b, defaultContext);
con.add(b, RDFS.SUBPROPERTYOF, c, defaultContext);
Assert.assertTrue(con.hasStatement(a, RDFS.SUBPROPERTYOF, c, true,
defaultContext));
con.add(a, RDFS.SUBPROPERTYOF, c);
Assert.assertTrue(con.hasStatement(a, RDFS.SUBPROPERTYOF, c, true,
defaultContext));
}
}
|
|
Problem was caused by a bug in the memory store: the existing inferred statement was deprecated but the new explicit statement got a wrong transaction status, making it invisible to statement iterators.
Is there a relase of this component available? Or should I use a snapshot or build myself from svn? Can I release it for our maven build? If so, what would be a wise artifactID, groupId and versionID to make sure it is never confusing your releases?
Answer from OpenRDF developers: Fixed in X menas: Its in the trunk and usually there is a -SNAPSHOT built.
|
|