Package ai.djl.repository
Class MRL
java.lang.Object
ai.djl.repository.MRL
The
MRL (Machine learning Resource Locator) is a pointer to a Metadata "resource"
on a machine learning Repository.
Each mrl references a single metadata file (parsed to Metadata and the collection of
artifacts located within it. Those artifacts all share the same groupId and artifactId, but can
differ based on the name and properties.
The mrl consists of three different properties:
- type - The resource type, e.g. model or dataset.
- application - The resource application (See
Application). - groupId - The group id identifies the group publishing the artifacts using a reverse domain name system.
- artifactId - The artifact id identifies the different artifacts published by a single group.
-
Method Summary
Modifier and TypeMethodDescriptionstatic MRLdataset(Repository repository, Application application, String groupId, String artifactId, String version) Creates a datasetMRLwith specified application.Returns the application.Returns the artifactId.Returns the default artifact.Returns the groupId.Returns the repository.Returns the version.booleanisPrepared(Artifact artifact) Returnstrueif the artifact is ready for use.Returns a list of artifacts in this resource.Returns the first artifact that matches a given criteria.static MRLmodel(Repository repository, Application application, String groupId, String artifactId, String version, String artifactName) Creates a modelMRLwith specified application.voidPrepares the artifact for use.voidPrepares the artifact for use with progress tracking.toString()toURI()Returns the URI to the metadata location (used forRepositoryimplementations).static MRLundefined(Repository repository, String groupId, String artifactId) Creates a datasetMRLwith specified application.
-
Method Details
-
model
public static MRL model(Repository repository, Application application, String groupId, String artifactId, String version, String artifactName) Creates a modelMRLwith specified application.- Parameters:
repository- theRepositoryapplication- the desired applicationgroupId- the desired groupIdartifactId- the desired artifactIdversion- the resource versionartifactName- the desired artifact name- Returns:
- a model
MRL
-
dataset
public static MRL dataset(Repository repository, Application application, String groupId, String artifactId, String version) Creates a datasetMRLwith specified application.- Parameters:
repository- theRepositoryapplication- the desired applicationgroupId- the desired groupIdartifactId- the desired artifactIdversion- the resource version- Returns:
- a dataset
MRL
-
undefined
Creates a datasetMRLwith specified application.- Parameters:
repository- theRepositorygroupId- the desired groupIdartifactId- the desired artifactId- Returns:
- a dataset
MRL
-
toURI
Returns the URI to the metadata location (used forRepositoryimplementations).- Returns:
- the URI to the metadata location
-
getRepository
Returns the repository.- Returns:
- the repository
-
getApplication
Returns the application.- Returns:
- the application
-
getGroupId
Returns the groupId.- Returns:
- the groupId
-
getArtifactId
Returns the artifactId.- Returns:
- the artifactId
-
getVersion
Returns the version.- Returns:
- the version
-
getDefaultArtifact
Returns the default artifact.- Returns:
- the default artifact
- Throws:
IOException- for various exceptions depending on the specific dataset
-
match
Returns the first artifact that matches a given criteria.- Parameters:
criteria- the criteria to match against- Returns:
- the first artifact that matches the criteria. Null will be returned if no artifact matches
- Throws:
IOException- for errors while loading the model
-
listArtifacts
Returns a list of artifacts in this resource.- Returns:
- a list of artifacts in this resource
- Throws:
IOException- for errors while loading the model
-
isPrepared
Returnstrueif the artifact is ready for use.- Parameters:
artifact- the artifact to prepare- Returns:
trueif the artifact is ready for use- Throws:
IOException- if it failed to prepare
-
prepare
Prepares the artifact for use.- Parameters:
artifact- the artifact to prepare- Throws:
IOException- if it failed to prepare
-
prepare
Prepares the artifact for use with progress tracking.- Parameters:
artifact- the artifact to prepareprogress- the progress tracker- Throws:
IOException- if it failed to prepare
-
toString
-