Package org.cy3sbml.miriam
Class MiriamRegistry
java.lang.Object
org.cy3sbml.miriam.MiriamRegistry
The MIRIAM registry of data collections used to resolve annotation URIs.
Starts with the copy bundled with the app, so it is usable immediately and without
network. refreshInBackground(URI) replaces it with the current registry from
identifiers.org once that download succeeds; readers see either the complete old or the
complete new registry.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordAn identifiers.org resource URI resolved against the registry: its data collection (null if the registry has none for it) and its identifier. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic MiriamRegistrybundled()Creates the registry from the copy bundled with the app.The data collection of the given identifiers.org resource URI or urn:miriam URN, or null, seeresolve(String).The data collection with the given prefix, or null.booleanReplaces the registry with the one downloaded from the source.refreshInBackground(URI source) Refreshes the registry from the source on a background thread, so the caller (e.g. the bundle start) is not blocked by the network.Resolves the given identifiers.org resource URI or urn:miriam URN to its data collection and identifier, or null if the URI cannot be parsed.snapshot()The current content, an unmodifiable map from prefix to data collection.
-
Field Details
-
ONLINE_REGISTRY
The current registry at identifiers.org. -
DOWNLOAD_TIMEOUT
Connect and read timeout of the registry download.
-
-
Method Details
-
bundled
Creates the registry from the copy bundled with the app. -
get
The data collection with the given prefix, or null. -
resolve
Resolves the given identifiers.org resource URI or urn:miriam URN to its data collection and identifier, or null if the URI cannot be parsed. The namespace of the URI is matched case-insensitively (e.g. "NCBITaxon" gives "ncbitaxon"); a namespace with a provider part such as "obo.go" falls back to the part after the dot.The identifier of a compact URI (
<prefix>:<accession>) depends on the data collection: without the namespace embedded in the identifier it is the accession ("BAO:0000362" gives "0000362"), with it the identifier keeps the prefix ("GO:0007049" and "go:GO:0007049" both give "GO:0007049"). -
findByURI
The data collection of the given identifiers.org resource URI or urn:miriam URN, or null, seeresolve(String). -
snapshot
The current content, an unmodifiable map from prefix to data collection. -
refresh
Replaces the registry with the one downloaded from the source. On failure the current registry stays in use.- Returns:
- true if the registry was replaced
-
refreshInBackground
Refreshes the registry from the source on a background thread, so the caller (e.g. the bundle start) is not blocked by the network.- Returns:
- completes with the result of
refresh(URI, Duration)
-