ExplicitAxiomLoader extends AbstractAxiomLoader { @Override boolean contains(Resource subject, Property property, RDFNode object, URI context) { return connector.contains(subject, property, object, context != null ? context.toString() : null); } ExplicitAxiomLoader(StorageConnector connector);   }
@Test void containsChecksForStatementExistenceInStorage() { final String typeUri = Generator.generateUri().toString(); final Axiom<?> ax = new AxiomImpl<>(SUBJECT, Assertion.createClassAssertion(false), new Value<>(NamedResource.create(typeUri))); when(connectorMock.contains(any(), any(), any(), any())).thenReturn(true); assertTrue(explicitAxiomLoader.contains(ax, null)); verify(connectorMock).contains(SUBJECT_RES, createProperty(Vocabulary.RDF_TYPE), createResource(typeUri), null); }
@Test void containsChecksForStatementExistenceInStorageContext() { final String typeUri = Generator.generateUri().toString(); final URI contextUri = Generator.generateUri(); final Axiom<?> ax = new AxiomImpl<>(SUBJECT, Assertion.createClassAssertion(false), new Value<>(NamedResource.create(typeUri))); when(connectorMock.contains(any(), any(), any(), anyString())).thenReturn(false); assertFalse(explicitAxiomLoader.contains(ax, contextUri)); verify(connectorMock).contains(SUBJECT_RES, createProperty(Vocabulary.RDF_TYPE), createResource(typeUri), contextUri.toString()); }