InferredAxiomLoader extends AbstractAxiomLoader { @Override boolean contains(Resource subject, Property property, RDFNode object, URI context) { return connector.containsWithInference(subject, property, object, context != null ? context.toString() : null); } InferredAxiomLoader(InferredStorageConnector connector);   }
@Test void containsChecksForInferredAxiomExistenceInDefaultGraph() { final URI clsUri = Generator.generateUri(); final Axiom<?> axiom = new AxiomImpl<>(SUBJECT, Assertion.createClassAssertion(true), new Value<>(NamedResource.create(clsUri))); when(connectorMock.containsWithInference(SUBJECT_RES, RDF.type, createResource(clsUri.toString()), null)) .thenReturn(true); assertTrue(axiomLoader.contains(axiom, null)); verify(connectorMock).containsWithInference(SUBJECT_RES, RDF.type, createResource(clsUri.toString()), null); }
@Test void containsChecksForInferredAxiomExistenceInNamedGraph() { final URI clsUri = Generator.generateUri(); final Axiom<?> axiom = new AxiomImpl<>(SUBJECT, Assertion.createClassAssertion(true), new Value<>(NamedResource.create(clsUri))); when(connectorMock .containsWithInference(SUBJECT_RES, RDF.type, createResource(clsUri.toString()), CONTEXT.toString())) .thenReturn(true); assertTrue(axiomLoader.contains(axiom, CONTEXT)); verify(connectorMock) .containsWithInference(SUBJECT_RES, RDF.type, createResource(clsUri.toString()), CONTEXT.toString()); }