Class EndpointFactory
- Author:
- Andreas Schwarte
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringConstruct a unique id for the provided SPARQL Endpoint, e.g http://dbpedia.org/ => %type%_dbpedia.orgstatic EndpointloadEndpoint(String id, Repository repository) Load anEndpointfor a given (configured) Repository.loadFederationMembers(File dataConfig, File fedXBaseDir) Utility function to load federation members from a data configuration file.loadFederationMembers(Model members, File baseDir) Utility function to load federation members from a model.static EndpointloadNativeEndpoint(File location) Construct aNativeStoreendpoint using the provided information and the file location as name.static EndpointloadNativeEndpoint(String name, File location) Construct a NativeStore endpoint using the provided information.static EndpointloadRemoteRepository(String repositoryServer, String repositoryName) static EndpointloadRemoteRepository(String repositoryServer, String repositoryName, boolean writable) static EndpointloadResolvableRepository(String repositoryId) Load aResolvableEndpointstatic EndpointloadResolvableRepository(String repositoryId, boolean writable) Load aResolvableEndpointstatic EndpointloadSPARQLEndpoint(String endpoint) Construct a SPARQL endpoint using the the provided information and the host of the url as name.static EndpointloadSPARQLEndpoint(String name, String endpoint) Construct a SPARQL endpoint using the the provided information.
-
Constructor Details
-
EndpointFactory
public EndpointFactory()
-
-
Method Details
-
loadSPARQLEndpoint
Construct a SPARQL endpoint using the the provided information.- Parameters:
name- a descriptive name, e.g. http://dbpediaendpoint- the URL of the SPARQL endpoint, e.g. http://dbpedia.org/sparql- Returns:
- an initialized
EndpointBasecontaining the repository - Throws:
FedXException
-
loadSPARQLEndpoint
Construct a SPARQL endpoint using the the provided information and the host of the url as name.- Parameters:
endpoint- the URL of the SPARQL endpoint, e.g. http://dbpedia.org/sparql- Returns:
- an initialized
EndpointBasecontaining the repository - Throws:
FedXException
-
loadRemoteRepository
public static Endpoint loadRemoteRepository(String repositoryServer, String repositoryName) throws FedXException - Throws:
FedXException
-
loadRemoteRepository
public static Endpoint loadRemoteRepository(String repositoryServer, String repositoryName, boolean writable) throws FedXException - Throws:
FedXException
-
loadResolvableRepository
Load aResolvableEndpointThe federation must be initialized with a
RepositoryResolver( seeFedXFactory.withRepositoryResolver(RepositoryResolver)) and this resolver must offer a Repository with the id provided byEndpoint.getId()Note that the name is set to "http://" + repositoryId
- Parameters:
repositoryId- the repository identifier- Returns:
- the configured
Endpoint - See Also:
-
loadResolvableRepository
Load aResolvableEndpointThe federation must be initialized with a
RepositoryResolver( seeFedXFactory.withRepositoryResolver(RepositoryResolver)) and this resolver must offer a Repository with the id provided byEndpoint.getId()Note that the name is set to "http://" + repositoryId
- Parameters:
repositoryId- the repository identifierwritable- whether to configure the endpoint as writable.- Returns:
- the configured
Endpoint - See Also:
-
loadEndpoint
Load anEndpointfor a given (configured) Repository.Note that
EndpointTypeis set toEndpointType.OtherIf the repository is already initialized, it is assumed that the lifecycle is managed externally. Otherwise, FedX will make sure to take care for the lifecycle of the repository, i.e. initialize and shutdown.
- Parameters:
id- the identifier, e.g. "myRepository"repository- the constructed repository- Returns:
- the initialized endpoint
- Throws:
FedXException
-
loadNativeEndpoint
Construct a NativeStore endpoint using the provided information.If the repository location denotes an absolute path, the native store directory must already exist. If a relative path is used, the repository is created on the fly (if necessary).
- Parameters:
name- a descriptive name, e.g. http://dbpedialocation- the location of the data store, either absolute or relative in a "repositories" subfolderSailRepository.getDataDir()- Returns:
- an initialized endpoint containing the repository
- Throws:
FedXException
-
loadNativeEndpoint
Construct aNativeStoreendpoint using the provided information and the file location as name.If the repository location denotes an absolute path, the native store directory must already exist. If a relative path is used, the repository is created on the fly (if necessary).
- Parameters:
location- the location of the data store- Returns:
- an initialized endpoint containing the repository
- Throws:
FedXException
-
loadFederationMembers
public static List<Endpoint> loadFederationMembers(File dataConfig, File fedXBaseDir) throws FedXException Utility function to load federation members from a data configuration file.A data configuration file provides information about federation members in form of turtle. Currently the types NativeStore, ResolvableEndpoint and SPARQLEndpoint are supported. For details please refer to the documentation in
NativeRepositoryInformation,ResolvableRepositoryInformationandSPARQLRepositoryInformation.- Parameters:
dataConfig-- Returns:
- a list of initialized endpoints, i.e. the federation members
- Throws:
FedXException
-
loadFederationMembers
public static List<Endpoint> loadFederationMembers(Model members, File baseDir) throws FedXException Utility function to load federation members from a model.Currently the types NativeStore, ResolvableEndpoint and SPARQLEndpoint are supported. For details please refer to the documentation in
NativeRepositoryInformation,ResolvableRepositoryInformationandSPARQLRepositoryInformation.- Parameters:
members-baseDir-- Returns:
- list of endpoints
- Throws:
FedXException
-
getId
Construct a unique id for the provided SPARQL Endpoint, e.g http://dbpedia.org/ => %type%_dbpedia.org- Parameters:
endpointID-type- the repository type, e.g. native, sparql, etc- Returns:
- the ID for the SPARQL endpoint
-