Class ResourceStoreImpl
java.lang.Object
org.aksw.jena_sparql_api.http.repository.impl.ResourceStoreImpl
- All Implemented Interfaces:
ResourceStore
ResourceManager for a single folder; does not manage multiple repositories
- Author:
- raven
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Pathprotected Stringprotected PathAnnotatorRdfprotected org.aksw.jena_sparql_api.http.repository.impl.ResourceSourceFileprotected String -
Constructor Summary
ConstructorsConstructorDescriptionResourceStoreImpl(Path basePath) ResourceStoreImpl(Path basePath, Function<String, Path> uriToRelPath) -
Method Summary
Modifier and TypeMethodDescriptionallocateEntity(String uri, org.apache.jena.rdf.model.Resource description) allocateEntity(Path baseRelPath, org.apache.jena.rdf.model.Resource _info) booleanTest whether the path lies within the store - does not check for existencegetEntityForPath(Path absEntityPath) Bridge between paths and entitiesorg.apache.jena.rdf.model.Resourceorg.apache.jena.rdf.model.ResourceReturn the metadata associated with a given pathstatic <T> Map.Entry<RdfHttpEntityFile,T> getOrCacheEntity(HttpResourceRepositoryFromFileSystem repo, ResourceStore store, String uri, HttpObjectSerializer<T> serializer, Supplier<T> contentSupplier) Request an RDF model from the repository based on a given uri (or any string)getResource(String uri) listEntities(Path relContentFolder) pathToResource(Path baseRelPath) putWithMove(String uri, org.aksw.jena_sparql_api.http.domain.api.RdfEntityInfo metadata, Path file) Put a given file into an appropriate place in the repository using a move operationstatic Map.Entry<RdfHttpEntityFile,org.apache.jena.rdf.model.Model> requestModel(HttpResourceRepositoryFromFileSystem repo, ResourceStore store, String uri, org.apache.jena.riot.RDFFormat preferredOutputFormat, Supplier<org.apache.jena.rdf.model.Model> modelSupplier) Find a model in the given resource repository or create one it in the given store based on the lambda if it does not yet existvoidupdateInfo(Path path, Consumer<? super org.apache.jena.rdf.model.Resource> callback)
-
Field Details
-
TMP_SUFFIX
-
basePath
-
CONTENT
-
resourceSource
protected org.aksw.jena_sparql_api.http.repository.impl.ResourceSourceFile resourceSource -
pathAnnotator
-
uriToRelPath
-
-
Constructor Details
-
ResourceStoreImpl
-
ResourceStoreImpl
-
-
Method Details
-
requestModel
public static Map.Entry<RdfHttpEntityFile,org.apache.jena.rdf.model.Model> requestModel(HttpResourceRepositoryFromFileSystem repo, ResourceStore store, String uri, org.apache.jena.riot.RDFFormat preferredOutputFormat, Supplier<org.apache.jena.rdf.model.Model> modelSupplier) throws IOException Find a model in the given resource repository or create one it in the given store based on the lambda if it does not yet exist- Parameters:
repo-store-uri-preferredOutputFormat-modelSupplier-- Returns:
- Throws:
IOException
-
getOrCacheEntity
public static <T> Map.Entry<RdfHttpEntityFile,T> getOrCacheEntity(HttpResourceRepositoryFromFileSystem repo, ResourceStore store, String uri, HttpObjectSerializer<T> serializer, Supplier<T> contentSupplier) throws IOException Request an RDF model from the repository based on a given uri (or any string)- Parameters:
repo-store-uri-preferredOutputformat-modelSupplier-- Returns:
- Throws:
IOException
-
getAbsolutePath
- Specified by:
getAbsolutePathin interfaceResourceStore
-
getInfo
- Specified by:
getInfoin interfaceResourceStore
-
fullPath
-
get
-
putWithMove
public RdfHttpEntityFile putWithMove(String uri, org.aksw.jena_sparql_api.http.domain.api.RdfEntityInfo metadata, Path file) throws IOException Put a given file into an appropriate place in the repository using a move operation- Specified by:
putWithMovein interfaceResourceStore- Parameters:
uri-file-- Returns:
- Throws:
IOException
-
getEntityForPath
Description copied from interface:ResourceStoreBridge between paths and entities- Specified by:
getEntityForPathin interfaceResourceStore- Parameters:
absEntityPath- Absolute path to an entity.- Returns:
-
getResource
- Specified by:
getResourcein interfaceResourceStore
-
listEntities
- Specified by:
listEntitiesin interfaceResourceStore
-
contains
Description copied from interface:ResourceStoreTest whether the path lies within the store - does not check for existence- Specified by:
containsin interfaceResourceStore- Returns:
-
getInfo
Description copied from interface:ResourceStoreReturn the metadata associated with a given path- Specified by:
getInfoin interfaceResourceStorelayer- A label to retrieve the metadata from a single source- Returns:
-
allocateEntity
- Specified by:
allocateEntityin interfaceResourceStore
-
pathToResource
-
allocateEntity
- Specified by:
allocateEntityin interfaceResourceStore
-
updateInfo
- Specified by:
updateInfoin interfaceResourceStore
-