History | Log In     View a printable version of the current page. Get help!  
Issue Details [XML]

Key: SES-521
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Arjohn Kampman
Reporter: Max Völkel
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Sesame

cannot add a statement which is already inferred

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


 Description   
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));
}
}


 All   Comments   Change History      Sort Order:
Comment by Arjohn Kampman [01/Feb/08 09:51 PM]
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.

Comment by Max Völkel [02/Feb/08 06:22 PM]
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?

Comment by Max Völkel [05/Feb/08 09:04 PM]
Answer from OpenRDF developers: Fixed in X menas: Its in the trunk and usually there is a -SNAPSHOT built.