public final class MRL
extends java.lang.Object
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:
Application
).
Modifier and Type | Method and Description |
---|---|
static MRL |
dataset(Repository repository,
Application application,
java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version)
Creates a dataset
MRL with specified application. |
Application |
getApplication()
Returns the application.
|
java.lang.String |
getArtifactId()
Returns the artifactId.
|
Artifact |
getDefaultArtifact()
Returns the default artifact.
|
java.lang.String |
getGroupId()
Returns the groupId.
|
Repository |
getRepository()
Returns the repository.
|
java.lang.String |
getVersion()
Returns the version.
|
java.util.List<Artifact> |
listArtifacts()
Returns a list of artifacts in this resource.
|
Artifact |
match(java.util.Map<java.lang.String,java.lang.String> criteria)
Returns the first artifact that matches a given criteria.
|
static MRL |
model(Repository repository,
Application application,
java.lang.String groupId,
java.lang.String artifactId,
java.lang.String version,
java.lang.String artifactName)
Creates a model
MRL with specified application. |
void |
prepare(Artifact artifact)
Prepares the artifact for use.
|
void |
prepare(Artifact artifact,
ai.djl.util.Progress progress)
Prepares the artifact for use with progress tracking.
|
java.lang.String |
toString() |
java.net.URI |
toURI()
Returns the URI to the metadata location (used for
Repository implementations). |
static MRL |
undefined(Repository repository,
java.lang.String groupId,
java.lang.String artifactId)
Creates a dataset
MRL with specified application. |
public static MRL model(Repository repository, Application application, java.lang.String groupId, java.lang.String artifactId, java.lang.String version, java.lang.String artifactName)
MRL
with specified application.repository
- the Repository
application
- the desired applicationgroupId
- the desired groupIdartifactId
- the desired artifactIdversion
- the resource versionartifactName
- the desired artifact nameMRL
public static MRL dataset(Repository repository, Application application, java.lang.String groupId, java.lang.String artifactId, java.lang.String version)
MRL
with specified application.repository
- the Repository
application
- the desired applicationgroupId
- the desired groupIdartifactId
- the desired artifactIdversion
- the resource versionMRL
public static MRL undefined(Repository repository, java.lang.String groupId, java.lang.String artifactId)
MRL
with specified application.repository
- the Repository
groupId
- the desired groupIdartifactId
- the desired artifactIdMRL
public java.net.URI toURI()
Repository
implementations).public Repository getRepository()
public Application getApplication()
public java.lang.String getGroupId()
public java.lang.String getArtifactId()
public java.lang.String getVersion()
public Artifact getDefaultArtifact() throws java.io.IOException
java.io.IOException
- for various exceptions depending on the specific datasetpublic Artifact match(java.util.Map<java.lang.String,java.lang.String> criteria) throws java.io.IOException
criteria
- the criteria to match againstjava.io.IOException
- for errors while loading the modelpublic java.util.List<Artifact> listArtifacts() throws java.io.IOException
java.io.IOException
- for errors while loading the modelpublic void prepare(Artifact artifact) throws java.io.IOException
artifact
- the artifact to preparejava.io.IOException
- if it failed to preparepublic void prepare(Artifact artifact, ai.djl.util.Progress progress) throws java.io.IOException
artifact
- the artifact to prepareprogress
- the progress trackerjava.io.IOException
- if it failed to preparepublic java.lang.String toString()
toString
in class java.lang.Object