Search in sources :

Example 1 with SynBioHubException

use of org.synbiohub.frontend.SynBioHubException in project libSBOLj by SynBioDex.

the class SBOLDocument method getExperiment.

/**
 * Returns the experiment matching the given identity URI from this SBOL
 * document's list of experiments.
 *
 * @param experimentURI
 *            the given identity URI of the experiment to be retrieved
 * @return the matching experiment if present, or {@code null} otherwise
 */
public Experiment getExperiment(URI experimentURI) {
    Experiment experiment = experiments.get(experimentURI);
    if (experiment == null) {
        for (SynBioHubFrontend frontend : getRegistries()) {
            try {
                SBOLDocument document = frontend.getSBOL(experimentURI);
                if (document != null) {
                    experiment = document.getExperiment(experimentURI);
                    createCopy(document);
                }
            } catch (SynBioHubException | SBOLValidationException e) {
                experiment = null;
            }
        }
    }
    return experiment;
}
Also used : SynBioHubFrontend(org.synbiohub.frontend.SynBioHubFrontend) SynBioHubException(org.synbiohub.frontend.SynBioHubException)

Example 2 with SynBioHubException

use of org.synbiohub.frontend.SynBioHubException in project libSBOLj by SynBioDex.

the class SBOLDocument method getActivity.

/**
 * Returns the activity matching the given display identity URI from this SBOL
 * document's list of activities.
 *
 * @param activityURI
 *            the identity URI of the top-level to be retrieved
 * @return the matching activity if present, or {@code null} otherwise.
 */
public Activity getActivity(URI activityURI) {
    Activity activity = activities.get(activityURI);
    if (activity == null) {
        for (SynBioHubFrontend frontend : getRegistries()) {
            try {
                SBOLDocument document = frontend.getSBOL(activityURI);
                if (document != null) {
                    activity = document.getActivity(activityURI);
                    createCopy(document);
                }
            } catch (SynBioHubException | SBOLValidationException e) {
                activity = null;
            }
        }
    }
    return activity;
}
Also used : SynBioHubFrontend(org.synbiohub.frontend.SynBioHubFrontend) SynBioHubException(org.synbiohub.frontend.SynBioHubException)

Example 3 with SynBioHubException

use of org.synbiohub.frontend.SynBioHubException in project libSBOLj by SynBioDex.

the class SBOLDocument method getComponentDefinition.

/**
 * Returns the component definition matching the given identity URI from this
 * SBOL document's list of component definitions.
 *
 * @param componentDefinitionURI
 *            the given identity URI of the component definition to be retrieved
 * @return the matching component definition if present, or {@code null}
 *         otherwise.
 */
public ComponentDefinition getComponentDefinition(URI componentDefinitionURI) {
    ComponentDefinition componentDefinition = componentDefinitions.get(componentDefinitionURI);
    if (componentDefinition == null) {
        for (SynBioHubFrontend frontend : getRegistries()) {
            try {
                SBOLDocument document = frontend.getSBOL(componentDefinitionURI);
                if (document != null) {
                    componentDefinition = document.getComponentDefinition(componentDefinitionURI);
                    createCopy(document);
                }
            } catch (SynBioHubException | SBOLValidationException e) {
            }
        }
    }
    return componentDefinition;
}
Also used : SynBioHubFrontend(org.synbiohub.frontend.SynBioHubFrontend) SynBioHubException(org.synbiohub.frontend.SynBioHubException)

Example 4 with SynBioHubException

use of org.synbiohub.frontend.SynBioHubException in project libSBOLj by SynBioDex.

the class SBOLDocument method getCollection.

/**
 * Returns the collection matching the given identity URI from this SBOL
 * document's list of collections.
 *
 * @param collectionURI
 *            the given identity URI of the collection to be retrieved
 * @return the matching collection if present, or {@code null} otherwise
 */
public Collection getCollection(URI collectionURI) {
    Collection collection = collections.get(collectionURI);
    if (collection == null) {
        for (SynBioHubFrontend frontend : getRegistries()) {
            try {
                SBOLDocument document = frontend.getSBOL(collectionURI);
                if (document != null) {
                    collection = document.getCollection(collectionURI);
                    createCopy(document);
                }
            } catch (SynBioHubException | SBOLValidationException e) {
                collection = null;
            }
        }
    }
    return collection;
}
Also used : SynBioHubFrontend(org.synbiohub.frontend.SynBioHubFrontend) SynBioHubException(org.synbiohub.frontend.SynBioHubException)

Example 5 with SynBioHubException

use of org.synbiohub.frontend.SynBioHubException in project libSBOLj by SynBioDex.

the class SBOLDocument method getTopLevel.

/**
 * Returns the top-level matching the given identity URI from this SBOL
 * document's lists of top-levels.
 *
 * @param topLevelURI
 *            the identity URI of the top-level to be retrieved
 * @return the matching top-level if present, or {@code null} otherwise.
 */
public TopLevel getTopLevel(URI topLevelURI) {
    TopLevel topLevel = getTopLevelLocalOnly(topLevelURI);
    if (topLevel == null) {
        for (SynBioHubFrontend frontend : getRegistries()) {
            try {
                SBOLDocument document = frontend.getSBOL(topLevelURI);
                if (document != null) {
                    topLevel = document.getTopLevel(topLevelURI);
                    createCopy(document);
                }
            } catch (SynBioHubException | SBOLValidationException e) {
            }
        }
    }
    return topLevel;
}
Also used : SynBioHubFrontend(org.synbiohub.frontend.SynBioHubFrontend) SynBioHubException(org.synbiohub.frontend.SynBioHubException)

Aggregations

SynBioHubException (org.synbiohub.frontend.SynBioHubException)16 SynBioHubFrontend (org.synbiohub.frontend.SynBioHubFrontend)16 File (java.io.File)1 IOException (java.io.IOException)1 URI (java.net.URI)1 QName (javax.xml.namespace.QName)1