@Test void testNonEmptyContainer() { final IRI iri = rdf.createIRI("http: final IRI container = rdf.createIRI(TRELLIS_DATA_PREFIX + idService.getSupplier().get()); final IRI child = rdf.createIRI(container.getIRIString() + "/" + idService.getSupplier().get()); final Dataset dataset = rdf.createDataset(); dataset.add(Trellis.PreferUserManaged, container, RDFS.label, rdf.createLiteral("A container")); final Dataset childDataset = rdf.createDataset(); childDataset.add(Trellis.PreferUserManaged, child, FOAF.primaryTopic, iri); assertDoesNotThrow(() -> allOf( svc.create(builder(container).interactionModel(LDP.BasicContainer).container(root).build(), dataset) .toCompletableFuture(), svc.create(builder(child).interactionModel(LDP.RDFSource).container(container).build(), childDataset).toCompletableFuture()).join()); svc.get(container).thenAccept(res -> { assertEquals(1L, res.stream(LDP.PreferContainment).count()); assertEquals(of(rdf.createQuad(LDP.PreferContainment, rdf.createIRI(container.getIRIString() + "/"), LDP.contains, child)), res.stream(LDP.PreferContainment).findFirst()); }).toCompletableFuture().join(); assertThrows(CompletionException.class, svc.delete(builder(container).interactionModel(LDP.Resource) .build()).toCompletableFuture()::join, "No exception with a non-empty container!"); assertDoesNotThrow(svc.delete(builder(child).interactionModel(LDP.Resource) .build()).toCompletableFuture()::join, "Error deleting child resource"); assertDoesNotThrow(svc.delete(builder(container).interactionModel(LDP.Resource) .build()).toCompletableFuture()::join, "Error deleting child resource"); }
@Override public Stream<Quad> stream() { return Stream.concat(graphMapper.values().stream().flatMap(Supplier::get), extensions.keySet().stream().flatMap(this::fetchExtensionQuads)); }
DBResource implements Resource { @Override public Stream<Quad> stream() { return Stream.concat(graphMapper.values().stream().flatMap(Supplier::get), extensions.keySet().stream().flatMap(this::fetchExtensionQuads)); } }
DBResource implements Resource { @Override public Stream<Quad> stream() { return Stream.concat(graphMapper.values().stream().flatMap(Supplier::get), extensions.keySet().stream().flatMap(this::fetchExtensionQuads)); } protected  DBResource(final Jdbi jdbi, final IRI identifier, final Map<String, IRI> extensions,
            final boolean includeLdpType, final boolean supportDirectContainment,
            final boolean supportIndirectContainment); }
DBResource implements Resource { @Override public Stream<Quad> stream() { return Stream.concat(graphMapper.values().stream().flatMap(Supplier::get), extensions.keySet().stream().flatMap(this::fetchExtensionQuads)); } protected  DBResource(final Jdbi jdbi, final IRI identifier, final Map<String, IRI> extensions,
            final boolean includeLdpType, final boolean supportDirectContainment,
            final boolean supportIndirectContainment); static CompletionStage<Resource> findResource(final DataSource ds, final IRI identifier,
            final Map<String, IRI> extensions, final boolean includeLdpType); static CompletionStage<Resource> findResource(final Jdbi jdbi, final IRI identifier,
            final Map<String, IRI> extensions, final boolean includeLdpType); static CompletionStage<Resource> findResource(final Jdbi jdbi, final IRI identifier,
            final Map<String, IRI> extensions, final boolean includeLdpType, final boolean supportDirectContainment,
            final boolean supportIndirectContainment); boolean isDeleted(); @Override Stream<Quad> stream(); @Override Stream<Quad> stream(final Collection<IRI> graphNames); @Override IRI getIdentifier(); @Override IRI getInteractionModel(); @Override Optional<IRI> getContainer(); @Override Optional<IRI> getMembershipResource(); @Override Optional<IRI> getMemberRelation(); @Override Optional<IRI> getMemberOfRelation(); @Override Optional<IRI> getInsertedContentRelation(); @Override Optional<BinaryMetadata> getBinaryMetadata(); @Override Instant getModified(); @Override boolean hasMetadata(final IRI graphName); @Override Set<IRI> getMetadataGraphNames(); @Override Stream<Map.Entry<String,String>> getExtraLinkRelations(); }
DBResource implements Resource { @Override public Stream<Quad> stream() { return Stream.concat(graphMapper.values().stream().flatMap(Supplier::get), extensions.keySet().stream().flatMap(this::fetchExtensionQuads)); } protected  DBResource(final Jdbi jdbi, final IRI identifier, final Map<String, IRI> extensions,
            final boolean includeLdpType, final boolean supportDirectContainment,
            final boolean supportIndirectContainment); static CompletionStage<Resource> findResource(final DataSource ds, final IRI identifier,
            final Map<String, IRI> extensions, final boolean includeLdpType); static CompletionStage<Resource> findResource(final Jdbi jdbi, final IRI identifier,
            final Map<String, IRI> extensions, final boolean includeLdpType); static CompletionStage<Resource> findResource(final Jdbi jdbi, final IRI identifier,
            final Map<String, IRI> extensions, final boolean includeLdpType, final boolean supportDirectContainment,
            final boolean supportIndirectContainment); boolean isDeleted(); @Override Stream<Quad> stream(); @Override Stream<Quad> stream(final Collection<IRI> graphNames); @Override IRI getIdentifier(); @Override IRI getInteractionModel(); @Override Optional<IRI> getContainer(); @Override Optional<IRI> getMembershipResource(); @Override Optional<IRI> getMemberRelation(); @Override Optional<IRI> getMemberOfRelation(); @Override Optional<IRI> getInsertedContentRelation(); @Override Optional<BinaryMetadata> getBinaryMetadata(); @Override Instant getModified(); @Override boolean hasMetadata(final IRI graphName); @Override Set<IRI> getMetadataGraphNames(); @Override Stream<Map.Entry<String,String>> getExtraLinkRelations();  }