@Test void testDirectContainerInverse() { final IRI dc = rdf.createIRI(TRELLIS_DATA_PREFIX + idService.getSupplier().get()); final IRI child = rdf.createIRI(dc.getIRIString() + "/" + idService.getSupplier().get()); final IRI member = rdf.createIRI(TRELLIS_DATA_PREFIX + idService.getSupplier().get()); final Dataset dcDataset = rdf.createDataset(); dcDataset.add(Trellis.PreferUserManaged, dc, LDP.isMemberOfRelation, DC.isPartOf); dcDataset.add(Trellis.PreferUserManaged, dc, LDP.membershipResource, member); assertDoesNotThrow(() -> allOf( svc.create(builder(dc).interactionModel(LDP.DirectContainer).container(root) .memberOfRelation(DC.isPartOf).membershipResource(member).build(), dcDataset) .toCompletableFuture(), svc.create(builder(member).interactionModel(LDP.Container).container(root).build(), rdf.createDataset()).toCompletableFuture(), svc.create(builder(child).interactionModel(LDP.RDFSource).container(dc).build(), rdf.createDataset()).toCompletableFuture()).join()); svc.get(child).thenAccept(res -> { assertEquals(1L, res.stream(LDP.PreferMembership).count()); assertEquals(of(rdf.createQuad(LDP.PreferMembership, child, DC.isPartOf, member)), res.stream(LDP.PreferMembership).findFirst()); }).toCompletableFuture().join(); }
@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();  }