public interface ResourceService extends RetrievalService<Resource>
PostConstruct). This may or may not include
actions in external systems like databases, which may be better managed elsewhere.| Modifier and Type | Method and Description |
|---|---|
CompletionStage<Void> |
add(IRI identifier,
Dataset dataset) |
default CompletionStage<Void> |
create(Metadata metadata,
Dataset dataset)
Create a resource in the server.
|
CompletionStage<Void> |
delete(Metadata metadata)
Delete a resource from the server.
|
String |
generateIdentifier()
An identifier generator.
|
CompletionStage<Void> |
replace(Metadata metadata,
Dataset dataset)
Replace a resource in the server.
|
default RDFTerm |
skolemize(RDFTerm term)
Skolemize a blank node.
|
Set<IRI> |
supportedInteractionModels()
Return a collection of interaction models supported by this Resource Service.
|
default <T extends RDFTerm> |
toExternal(T term,
String baseUrl)
Return an "external" representation of an RDF term.
|
default <T extends RDFTerm> |
toInternal(T term,
String baseUrl)
Return an "internal" representation of an RDF term.
|
CompletionStage<Void> |
touch(IRI identifier)
Update the modification date of the provided resource.
|
default RDFTerm |
unskolemize(RDFTerm term)
Un-skolemize a blank node.
|
getdefault CompletionStage<Void> create(Metadata metadata, Dataset dataset)
metadata - metadata for the new resourcedataset - the dataset to be persistedCompletionStage will complete exceptionally and can be handled with
CompletionStage.handle(java.util.function.BiFunction<? super T, java.lang.Throwable, ? extends U>), CompletionStage.exceptionally(java.util.function.Function<java.lang.Throwable, ? extends T>) or similar methods.replace(org.trellisldp.api.Metadata, org.apache.commons.rdf.api.Dataset) method.CompletionStage<Void> replace(Metadata metadata, Dataset dataset)
metadata - metadata for the resourcedataset - the dataset to be persistedCompletionStage will complete exceptionally and can be handled with
CompletionStage.handle(java.util.function.BiFunction<? super T, java.lang.Throwable, ? extends U>), CompletionStage.exceptionally(java.util.function.Function<java.lang.Throwable, ? extends T>) or similar methods.CompletionStage<Void> delete(Metadata metadata)
metadata - metadata for the resourceCompletionStage will complete exceptionally and can be handled with
CompletionStage.handle(java.util.function.BiFunction<? super T, java.lang.Throwable, ? extends U>), CompletionStage.exceptionally(java.util.function.Function<java.lang.Throwable, ? extends T>) or similar methods.CompletionStage<Void> add(IRI identifier, Dataset dataset)
identifier - the identifier under which to persist a datasetdataset - a dataset to persistCompletionStage will complete exceptionally and can be handled with
CompletionStage.handle(java.util.function.BiFunction<? super T, java.lang.Throwable, ? extends U>), CompletionStage.exceptionally(java.util.function.Function<java.lang.Throwable, ? extends T>) or similar methods.default RDFTerm skolemize(RDFTerm term)
term - the RDF termdefault RDFTerm unskolemize(RDFTerm term)
term - the RDF termdefault <T extends RDFTerm> T toInternal(T term, String baseUrl)
T - the type of RDF termterm - the RDF termbaseUrl - the base URL of the domaindefault <T extends RDFTerm> T toExternal(T term, String baseUrl)
T - the type of RDF termterm - the RDF termbaseUrl - the base URL of the domainCompletionStage<Void> touch(IRI identifier)
identifier - the identifier of the resourceSet<IRI> supportedInteractionModels()
String generateIdentifier()