public void testInferencerTransactionIsolation() throws Exception { testCon.setAutoCommit(false); testCon.add(bob, name, nameBob); assertTrue(testCon.hasStatement(bob, RDF.TYPE, RDFS.RESOURCE, true)); assertFalse(testCon2.hasStatement(bob, RDF.TYPE, RDFS.RESOURCE, true)); testCon.setAutoCommit(true); assertTrue(testCon.hasStatement(bob, RDF.TYPE, RDFS.RESOURCE, true)); assertTrue(testCon2.hasStatement(bob, RDF.TYPE, RDFS.RESOURCE, true)); } }
public void testDomainInference() throws Exception { testCon.add(name, RDFS.DOMAIN, person); testCon.add(bob, name, nameBob); assertTrue(testCon.hasStatement(bob, RDF.TYPE, person, true)); }
public void testMakeExplicit() throws Exception { testCon.setAutoCommit(false); testCon.add(woman, RDFS.SUBCLASSOF, person); testCon.add(alice, RDF.TYPE, woman); testCon.setAutoCommit(true); assertTrue(testCon.hasStatement(alice, RDF.TYPE, person, true)); testCon.add(alice, RDF.TYPE, person); assertTrue(testCon.hasStatement(alice, RDF.TYPE, person, true)); }
public void testInferencerQueryDuringTransaction() throws Exception { testCon.setAutoCommit(false); testCon.add(bob, name, nameBob); assertTrue(testCon.hasStatement(bob, RDF.TYPE, RDFS.RESOURCE, true)); testCon.setAutoCommit(true); }
public void testSubClassInference() throws Exception { testCon.setAutoCommit(false); testCon.add(woman, RDFS.SUBCLASSOF, person); testCon.add(man, RDFS.SUBCLASSOF, person); testCon.add(alice, RDF.TYPE, woman); testCon.setAutoCommit(true); assertTrue(testCon.hasStatement(alice, RDF.TYPE, person, true)); }
public void testExplicitFlag() throws Exception { RepositoryResult<Statement> result = testCon.getStatements(RDF.TYPE, RDF.TYPE, null, true); try { assertTrue("result should not be empty", result.hasNext()); } finally { result.close(); } result = testCon.getStatements(RDF.TYPE, RDF.TYPE, null, false); try { assertFalse("result should be empty", result.hasNext()); } finally { result.close(); } }