public class SBOLDocument extends Object
Modifier and Type | Field and Description |
---|---|
static String |
FASTAformat
Constant representing FASTA file format
|
static String |
GENBANK
Constant representing GenBank file format
|
static String |
JSON
Constant representing JSON file format
|
static String |
RDF
Constant representing RDF file format
|
static String |
RDFV1
Constant representing the format of an SBOL version 1.1 output file as being RDF format
|
static String |
TURTLE
Constant representing TURTLE file format
|
Constructor and Description |
---|
SBOLDocument()
Creates a new SBOLDocument instance with one empty list for the namespaces and one for each top-level instance,
and then adds the following namespaces:
Sbol2Terms.sbol2 , Sbol1Terms.rdf , Sbol2Terms.dc ,
and Sbol2Terms.prov . |
Modifier and Type | Method and Description |
---|---|
void |
addNamespace(QName qName)
Adds the given namespace QName to this SBOL document.
|
void |
addNamespace(URI nameSpaceURI,
String prefix)
Adds the given namespace URI and its prefix to this SBOL document.
|
SynBioHubFrontend |
addRegistry(String registryURL)
Adds the given registry to this SBOL document.
|
SynBioHubFrontend |
addRegistry(String registryURL,
String uriPrefix)
Adds the given registry to this SBOL document.
|
SBOLDocument |
changeURIPrefixVersion(String URIPrefix,
String version)
Copy all objects to an a new SBOL Document and change the URI prefix/version of each object
|
void |
clearCollections()
Removes all entries in the list of collections owned by this SBOL document.
|
void |
clearComponentDefinitions()
Removes all entries in the list of component definitions owned by this SBOL document.
|
void |
clearGenericTopLevels()
Removes all entries in the list of generic top-levels
owned by this SBOL document.
|
void |
clearModels()
Removes all entries in the list of models owned by this SBOL document.
|
void |
clearModuleDefinitions()
Removes all entries in the list of module definitions owned by this SBOL document.
|
void |
clearNamespaces()
Removes all non-required namespaces from this SBOL document.
|
void |
clearRegistries()
Removes all registries from this SBOL document.
|
void |
clearSequences()
Removes all entries in the list of sequences owned by this SBOL document.
|
Collection |
createCollection(String displayId)
Creates a collection first, and then adds to this SBOL document's list of collections.
|
Collection |
createCollection(String displayId,
String version)
Creates a collection first, and then adds to this SBOL document's list of collections.
|
Collection |
createCollection(String URIprefix,
String displayId,
String version)
Creates a collection first, and then adds to this SBOL document's list of collections.
|
ComponentDefinition |
createComponentDefinition(String displayId,
Set<URI> types)
Creates a component definition, and then adds it to this SBOL document's list of component definitions.
|
ComponentDefinition |
createComponentDefinition(String displayId,
String version,
Set<URI> types)
Creates a component definition, and then adds it to this SBOL document's list of component definitions.
|
ComponentDefinition |
createComponentDefinition(String URIprefix,
String displayId,
String version,
Set<URI> types)
Creates a component definition, and then adds it to this SBOL document's list of component definitions.
|
ComponentDefinition |
createComponentDefinition(String URIprefix,
String displayId,
String version,
URI type)
Creates a component definition, and then adds it to this SBOL document's list of component definitions.
|
ComponentDefinition |
createComponentDefinition(String displayId,
String version,
URI type)
Creates a component definition, and then adds it to this SBOL document's list of component definitions.
|
ComponentDefinition |
createComponentDefinition(String displayId,
URI type)
Creates a component definition, and then adds it to this SBOL document's list of component definitions.
|
void |
createCopy(SBOLDocument document)
Creates an identical copy of each top-level element of a document, and then adds the created top-level to the corresponding
list of top-levels in this SBOL document.
|
TopLevel |
createCopy(TopLevel topLevel)
Creates an identical copy of the given top-level, and then adds the created top-level to the corresponding
list of top-levels in this SBOL document.
|
TopLevel |
createCopy(TopLevel topLevel,
String displayId)
Creates a copy of the given top-level with the given display ID, and then adds the created top-level to the corresponding
list of top-levels in this SBOL document.
|
TopLevel |
createCopy(TopLevel topLevel,
String displayId,
String version)
Creates a copy of the given top-level with the given display ID and version,
and then adds the created top-level to the corresponding list of top-levels in this SBOL document.
|
TopLevel |
createCopy(TopLevel topLevel,
String URIprefix,
String displayId,
String version)
Creates a copy of the given top-level with the given URI prefix, display ID and version,
and then adds the created top-level to the corresponding list of top-levels in this SBOL document.
|
GenericTopLevel |
createGenericTopLevel(String displayId,
QName rdfType)
Creates a generic top-level, and then adds it to this SBOL document's list of generic top-levels.
|
GenericTopLevel |
createGenericTopLevel(String displayId,
String version,
QName rdfType)
Creates a generic top-level, and then adds it to this SBOL document's list of generic top-levels.
|
GenericTopLevel |
createGenericTopLevel(String URIprefix,
String displayId,
String version,
QName rdfType)
Creates a generic top-level, and then adds it to this SBOL document's list of generic top-levels.
|
Model |
createModel(String URIprefix,
String displayId,
String version,
URI source,
URI language,
URI framework)
Creates a model, and then adds it to this SBOL document's list of models.
|
Model |
createModel(String displayId,
String version,
URI source,
URI language,
URI framework)
Creates a model, and then adds it to this SBOL document's list of models.
|
Model |
createModel(String displayId,
URI source,
URI language,
URI framework)
Creates a model, and then adds it to this SBOL document's list of models.
|
ModuleDefinition |
createModuleDefinition(String displayId)
Creates a module definition, and then adds it to this SBOL document's list of module definitions.
|
ModuleDefinition |
createModuleDefinition(String displayId,
String version)
Creates a module definition, and then adds it to this SBOL document's list of module definitions.
|
ModuleDefinition |
createModuleDefinition(String URIprefix,
String displayId,
String version)
Creates a module definition with the given arguments, and then adds it to this SBOL document's list of module definitions.
|
SBOLDocument |
createRecursiveCopy(TopLevel topLevel)
Creates an identical copy of the given top-level and returns it in
a new SBOLDocument.
|
Sequence |
createSequence(String URIprefix,
String displayId,
String version,
String elements,
URI encoding)
Creates a Sequence instance with the given arguments, and then adds it to this SBOLDocument
object's list of Sequence instances.
|
Sequence |
createSequence(String displayId,
String version,
String elements,
URI encoding)
Creates a Sequence instance with this SBOL document's
defaultURIprefix
and the given arguments, and then adds it to this SBOL document's list of Sequence instances. |
Sequence |
createSequence(String displayId,
String elements,
URI encoding)
Creates a Sequence instance with this SBOL document's
defaultURIprefix ,
the given arguments, and an empty version string, and then
adds it to this SBOL document's list of Sequence instances. |
boolean |
equals(Object obj) |
Set<TopLevel> |
getByWasDerivedFrom(URI wasDerivedFrom)
Retrieves a set of top-levels in this SBOL document whose
wasDerivedFrom field matches
the given one. |
Collection |
getCollection(String displayId,
String version)
Returns the collection matching the given display ID and version from this SBOL document's list of
collections.
|
Collection |
getCollection(URI collectionURI)
Returns the collection matching the given identity URI from this
SBOL document's list of collections.
|
Set<Collection> |
getCollections()
Returns the set of
Collection instances owned by this SBOL document. |
ComponentDefinition |
getComponentDefinition(String displayId,
String version)
Returns the component definition matching the given display ID and version from this SBOL document's list of
component definitions.
|
ComponentDefinition |
getComponentDefinition(URI componentDefinitionURI)
Returns the component definition matching the given identity URI from this
SBOL document's list of component definitions.
|
Set<ComponentDefinition> |
getComponentDefinitions()
Returns the set of component definitions owned by this SBOL document.
|
String |
getDefaultURIprefix()
Returns the default URI prefix of this SBOL document.
|
GenericTopLevel |
getGenericTopLevel(String displayId,
String version)
Returns the generic top-level matching the given display ID and version from this SBOL document's list of
generic top-levels.
|
GenericTopLevel |
getGenericTopLevel(URI genericTopLevelURI)
Returns the generic top-level matching the given display identity URI from this SBOL document's list of
generic top-levels.
|
Set<GenericTopLevel> |
getGenericTopLevels()
Returns the set of generic top-levels owned by this SBOL document.
|
Model |
getModel(String displayId,
String version)
Returns the model matching the given display ID and version from this SBOL document's list of
models.
|
Model |
getModel(URI modelURI)
Returns the model matching the given identity URI from this
SBOL document's list of models.
|
Set<Model> |
getModels()
Returns the set of models owned by this SBOL document.
|
ModuleDefinition |
getModuleDefinition(String displayId,
String version)
Returns the module definition matching the given display ID
and version from this SBOLDocument object's list of
module definitions.
|
ModuleDefinition |
getModuleDefinition(URI moduleDefinitionURI)
Returns the module definition matching the given identity URI from this
SBOL document object's list of module definitions.
|
Set<ModuleDefinition> |
getModuleDefinitions()
Returns the set of module definitions owned by this SBOLDocument object.
|
QName |
getNamespace(String namespacePrefix)
Returns the QName matching the given namespace prefix from this
SBOL document's list of QNames.
|
QName |
getNamespace(URI namespaceURI)
Returns the QName matching the given namespace URI from this
SBOL document's list of QNames.
|
List<QName> |
getNamespaces()
Returns the list of namespaces owned by this SBOL document.
|
List<SynBioHubFrontend> |
getRegistries()
Returns the list of registries used by this SBOL document.
|
SynBioHubFrontend |
getRegistry(String registryURL)
Returns the StackFrontend for the registry specified by its URL
|
Set<ComponentDefinition> |
getRootComponentDefinitions()
Returns the set of root component definitions.
|
Set<ModuleDefinition> |
getRootModuleDefinitions()
Returns the set of root module definitions.
|
Sequence |
getSequence(String displayId,
String version)
Returns the sequence matching the given display ID
and version from this SBOL document's list of sequences.
|
Sequence |
getSequence(URI sequenceURI)
Returns the sequence matching the given
modelURI from this
SBOL document's list of sequences. |
Set<Sequence> |
getSequences()
Returns the set of sequences owned by this SBOL document.
|
TopLevel |
getTopLevel(URI topLevelURI)
Returns the top-level matching the given identity URI from this
SBOL document's lists of top-levels.
|
Set<TopLevel> |
getTopLevels()
Returns the set of all top-levels owned by this SBOL document.
|
int |
hashCode() |
boolean |
isComplete()
Returns the value of the complete flag for this SBOL document.
|
boolean |
isCompliant()
Returns the value of the compliant flag in this SBOL document.
|
boolean |
isCreateDefaults()
Returns the value of the createDefaults flag in this SBOL document.
|
boolean |
isTypesInURIs()
Returns the value of the typesInURI flag in this SBOL document.
|
void |
read(File file)
Takes in a given RDF file and adds the data read to this SBOL document.
|
void |
read(InputStream in)
Takes in a given RDF input stream and adds the data read to this SBOL document.
|
void |
read(String fileName)
Takes in a given RDF file name and adds the data read to this SBOLDocument.
|
boolean |
removeCollection(Collection collection)
Removes the given collection from this SBOL document's list of collections.
|
boolean |
removeComponentDefinition(ComponentDefinition componentDefinition)
Removes the given component definition from this SBOL document's list of component definitions.
|
boolean |
removeGenericTopLevel(GenericTopLevel genericTopLevel)
Removes the given generic top-level from this SBOL document's list of generic top-levels.
|
boolean |
removeModel(Model model)
Removes the given model from this SBOL document's list of models.
|
boolean |
removeModuleDefinition(ModuleDefinition moduleDefinition)
Removes the given module definition from this SBOL document's list of module definitions.
|
void |
removeNamespace(URI namespaceURI)
Removes the given namespace URI from this SBOL document's list of namespaces.
|
void |
removeRegistry(String registryId)
Removes the given registry id from this SBOL document's list of registries.
|
boolean |
removeSequence(Sequence sequence)
Removes the given sequence from this SBOL document's list of sequences.
|
void |
removeTopLevel(TopLevel topLevel)
Method to remove a TopLevel object
|
TopLevel |
rename(TopLevel topLevel,
String displayId)
Renames the given top-level's display ID with the given one.
|
TopLevel |
rename(TopLevel topLevel,
String displayId,
String version)
Renames the given top-level's display ID and version with the given ones.
|
TopLevel |
rename(TopLevel topLevel,
String URIprefix,
String displayId,
String version)
Renames the given top-level's URI prefix, display ID, and version with the given ones.
|
void |
setComplete(boolean complete)
Sets the complete flag to the given value.
|
void |
setCreateDefaults(boolean createDefaults)
Sets the createDefaults flag to the given value.
|
void |
setDefaultURIprefix(String defaultURIprefix)
Sets the default URI prefix of this SBOL document to the given one.
|
void |
setTypesInURIs(boolean typesInURIs)
Sets the typesInURIs flag to the given value.
|
String |
toString() |
void |
write(File file)
Outputs this SBOL document's data from the RDF/XML serialization to the given file.
|
void |
write(File file,
String fileType)
Outputs this SBOL document's data from the serialization in the given serialization format
to the given file.
|
void |
write(OutputStream out)
Outputs this SBOL document's data from the RDF/XML serialization to the given output stream.
|
void |
write(OutputStream out,
String fileType)
Outputs this SBOL document's data from the serialization in the given serialization format
to the given output stream.
|
void |
write(String filename)
Outputs this SBOL document's data from the RDF/XML serialization to a new file with the given file name.
|
void |
write(String filename,
String fileType)
Outputs this SBOL document's data from serialization in the given serialization format
to a new file with the given file name.
|
public static final String TURTLE
public static final String JSON
public static final String RDFV1
public static final String RDF
public static final String FASTAformat
public static final String GENBANK
public SBOLDocument()
Sbol2Terms.sbol2
, Sbol1Terms.rdf
, Sbol2Terms.dc
,
and Sbol2Terms.prov
.public ModuleDefinition createModuleDefinition(String displayId) throws SBOLValidationException
This method calls createModuleDefinition(String, String, String)
with the default URI
prefix of this SBOL document, the given module definition display ID, and an empty version string.
displayId
- the display ID of the module definition to be createdSBOLValidationException
- if an SBOL validation rule was violated in createModuleDefinition(String, String, String)
.public ModuleDefinition createModuleDefinition(String displayId, String version) throws SBOLValidationException
This method calls createModuleDefinition(String, String, String)
with the default URI
prefix of this SBOL document, the given module definition display ID and version.
displayId
- the display ID of the module definition to be createdversion
- the version of the module definition to be createdSBOLValidationException
- if an SBOL validation rule was violated in createModuleDefinition(String, String, String)
.public ModuleDefinition createModuleDefinition(String URIprefix, String displayId, String version) throws SBOLValidationException
This method first creates a compliant URI for the module definition to be retrieved. It starts with
the given URI prefix after its been successfully validated, optionally followed by its type, namely TopLevel.MODULE_DEFINITION
,
followed by the given display ID, and ends with the given version.
URIprefix
- the URI prefix used to construct the compliant URI for the module definition to be createddisplayId
- the display ID of the module definition to be createdversion
- the version of the module definition to be createdSBOLValidationException
- if any of the following SBOL validation rules was violated:
10201, 10202, 10204, 10206, 10220.public boolean removeModuleDefinition(ModuleDefinition moduleDefinition) throws SBOLValidationException
moduleDefinition
- The moduleDefinition to be removedtrue
if the given moduleDefinition
is successfully removed, false
otherwise.SBOLValidationException
- if either of the following SBOL validation rules was violated:
11703, 12103.public ModuleDefinition getModuleDefinition(String displayId, String version)
This method first creates a compliant URI for the module definition to be retrieved.
It starts with the given URI prefix after its been successfully validated,
optionally followed by its type, namely TopLevel.MODULE_DEFINITION
,
followed by the given display ID, and ends with the given version.
This URI is used to look up the module definition in this SBOL document.
displayId
- the display ID of the module definition to be retrievedversion
- the version of the module definition to be retrievednull
otherwisepublic ModuleDefinition getModuleDefinition(URI moduleDefinitionURI)
moduleDefinitionURI
- the give identity URI of the module definition to be retrievednull
otherwisepublic Set<ModuleDefinition> getModuleDefinitions()
public void clearModuleDefinitions() throws SBOLValidationException
This method calls removeModuleDefinition(ModuleDefinition)
to iteratively remove
each module definition.
SBOLValidationException
- if an SBOL validation rule violation occurred in removeModuleDefinition(ModuleDefinition)
.public Collection createCollection(String displayId) throws SBOLValidationException
This method calls createCollection(String, String, String)
with the default URI prefix
for this SOBL document, the given display ID of the collection to be created, and an empty version
string.
displayId
- the display ID of the collection to be createdSBOLValidationException
- if an SBOL validation rule violation occurred
in createCollection(String, String, String)
.public Collection createCollection(String displayId, String version) throws SBOLValidationException
This method calls createCollection(String, String, String)
with the default URI prefix
for this SOBL document, the given display ID and version of the collection to be created.
displayId
- the display ID of the collection to be createdversion
- the version of the collection to be createdSBOLValidationException
- if an SBOL validation rule violation occurred
in createCollection(String, String, String)
.public Collection createCollection(String URIprefix, String displayId, String version) throws SBOLValidationException
This method creates a compliant URI for the collection to be created first. It starts with the given URI prefix after its been successfully validated, followed by the given display ID, and ends with the given version.
URIprefix
- the URI prefix for the collection to be createddisplayId
- the display ID of the collection to be createdversion
- the version of the collection to be createdSBOLValidationException
- if any of the following SBOL validation rules was violated:
10201, 10204, 10206.public boolean removeCollection(Collection collection) throws SBOLValidationException
collection
- the given collection to be removedtrue
if the given collection was successfully removed, false
otherwiseSBOLValidationException
- if the following SBOL validation rule was violated: 12103.public Collection getCollection(String displayId, String version)
A compliant Collection URI is created first. It starts with the given URI prefix after its been successfully validated,
optionally followed by its type, namely TopLevel.COLLECTION
, followed by the given display ID,
and ends with the given version. This URI is used to look up the module definition in this SBOL document.
displayId
- the display ID of the collection to be retrievedversion
- the version of the collection to be retrievednull
otherwisepublic Collection getCollection(URI collectionURI)
collectionURI
- the given identity URI of the collection to be retrievednull
otherwisepublic Set<Collection> getCollections()
Collection
instances owned by this SBOL document.Collection
instances owned by this SBOL document.public void clearCollections() throws SBOLValidationException
This method calls removeCollection(Collection)
to iteratively remove each collection.
SBOLValidationException
- if an SBOL validation rule violation occurred in removeCollection(Collection)
.public Model createModel(String displayId, URI source, URI language, URI framework) throws SBOLValidationException
This method calls createModel(String, String, String, URI, URI, URI)
with this SBOL document's
default URI prefix, an empty version string, and all given arguments.
displayId
- the display ID of the model to be createdsource
- the source of the model to be createdlanguage
- the language of the model to be createdframework
- the framework of the model to be createdSBOLValidationException
- if an SBOL validation rule violation occurred in
createModel(String, String, String, URI, URI, URI)
;public Model createModel(String displayId, String version, URI source, URI language, URI framework) throws SBOLValidationException
This method calls createModel(String, String, String, URI, URI, URI)
with this SBOL document's
default URI prefix, and all given arguments.
displayId
- the display ID of the model to be createdversion
- the version of the model to be createdsource
- the source of the model to be createdlanguage
- the language of the model to be createdframework
- the framework of the model to be createdSBOLValidationException
- if an SBOL validation rule violation occurred in
createModel(String, String, String, URI, URI, URI)
;public Model createModel(String URIprefix, String displayId, String version, URI source, URI language, URI framework) throws SBOLValidationException
This method first creates a compliant URI for the model to be created. It starts with the given URI prefix, followed by the given display ID, and ends with the given version.
URIprefix
- the URI prefix used to construct the compliant URI for the model to be createddisplayId
- the display ID of the model to be createdversion
- the version of the model to be createdsource
- the source of the model to be createdlanguage
- the language of the model to be createdframework
- the framework of the model to be createdSBOLValidationException
- if any of the following SBOL validation rules was violated:
10201, 10202, 10204, 10206, 10220,
10303, 10304, 10305, 10401, 10501, 10701, 10801, 10901, 11101, 11201, 11301, 11401,
11501, 11502, 11504, 11508,
11601, 11701, 11801, 11901, 12001, 12301.public boolean removeModel(Model model) throws SBOLValidationException
model
- the given model to be removedtrue
if the given model
was successfully removed, false
otherwiseSBOLValidationException
- if either of the following SBOL validation rules was violated:
11608, 12103.public Model getModel(String displayId, String version)
This method first creates a compliant URI for the model to be retrieved.
It starts with the given URI prefix after its been successfully validated,
optionally followed by its type, namely TopLevel.MODEL
,
followed by the given display ID, and ends with the given version.
This URI is used to look up the module definition in this SBOL document.
displayId
- the display ID of the model to be retrievedversion
- the version of the model to be retrievednull
otherwisepublic Model getModel(URI modelURI)
modelURI
- the identity URI of the model to be retrievednull
otherwisepublic Set<Model> getModels()
public void clearModels() throws SBOLValidationException
This method calls removeModel(Model)
to iteratively remove each model.
SBOLValidationException
- if an SBOL validation rule violation occurred in removeModel(Model)
.public ComponentDefinition createComponentDefinition(String displayId, Set<URI> types) throws SBOLValidationException
This method calls createComponentDefinition(String, String, String, Set)
with the default URI
prefix of this SBOL document, the given component definition display ID, and an empty version string.
given types.
displayId
- the display ID of the component definition to be createdtypes
- the types of the component definition to be createdSBOLValidationException
- if an SBOL validation rule was violated in createComponentDefinition(String, String, String, Set)
.public ComponentDefinition createComponentDefinition(String displayId, URI type) throws SBOLValidationException
This method first creates an empty set of types, and then adds to this set the given type. It then calls
createComponentDefinition(String, String, String, Set)
with the given display ID, and version,
and the created types.
displayId
- the display ID of the component definition to be createdtype
- the type to be added to the component definition to be createdSBOLValidationException
- if an SBOL validation rule violation occurred in
createComponentDefinition(String, String, String, Set)
.public ComponentDefinition createComponentDefinition(String displayId, String version, Set<URI> types) throws SBOLValidationException
This method calls createComponentDefinition(String, String, String, Set)
with the given
component definition display ID, version, and the given types.
displayId
- the display ID of the component definition to be createdversion
- the version of the component definition to be createdtypes
- the types of the component definition to be createdSBOLValidationException
- if an SBOL validation rule was violated in createComponentDefinition(String, String, String, Set)
.public ComponentDefinition createComponentDefinition(String displayId, String version, URI type) throws SBOLValidationException
This method first creates an empty set of types, and then adds to this set the given type. It then calls
createComponentDefinition(String, String, String, Set)
with the default URI prefix of this SBOL document,
display ID, and version,
and the created types.
displayId
- the display ID of the component definition to be createdversion
- the version of the component definition to be createdtype
- the type to be added to the component definition to be createdSBOLValidationException
- if an SBOL validation rule violation occurred in
createComponentDefinition(String, String, String, Set)
.public ComponentDefinition createComponentDefinition(String URIprefix, String displayId, String version, Set<URI> types) throws SBOLValidationException
This method creates a compliant URI for the component definition to be created first. It starts with the given URI prefix after its been successfully validated, followed by the given display ID, and ends with the given version.
URIprefix
- the URI prefix used to construct the compliant URI for the component definition to be createddisplayId
- the display ID of the component definition to be createdversion
- the version of the component definition to be createdtypes
- the types of the component definition to be createdSBOLValidationException
- if any of the following SBOL validation rules was violated:
10201, 10202, 10204, 10206, 10220,
10502, 10503.public ComponentDefinition createComponentDefinition(String URIprefix, String displayId, String version, URI type) throws SBOLValidationException
This method first creates an empty set of types, and then adds to this set the given type. It then calls
createComponentDefinition(String, String, String, Set)
with the given URI prefix, display ID, and version,
and the created types.
URIprefix
- the URI prefix used to construct the compliant URI for the component definition to be createddisplayId
- the display ID of the component definition to be createdversion
- the version of the component definition to be createdtype
- the type to be added to the component definition to be createdSBOLValidationException
- if an SBOL validation rule violation occurred in
createComponentDefinition(String, String, String, Set)
.public boolean removeComponentDefinition(ComponentDefinition componentDefinition) throws SBOLValidationException
componentDefinition
- the component definition to be removedtrue
if the given component definition was successfully removed, false
otherwiseSBOLValidationException
- if either of the following SBOL validation rules was violated: 10604, 12103.public ComponentDefinition getComponentDefinition(String displayId, String version)
A compliant ComponentDefinition URI is created first. It starts with this SBOL document's default URI prefix
after its been successfully validated, optionally followed by its type, namely TopLevel.COMPONENT_DEFINITION
,
followed by the given display ID, and ends with the given version. This URI is used to look up the module definition in this SBOL document.
displayId
- the display ID of the component definition to be retrievedversion
- the version of the component definition to be retrievednull
otherwisepublic ComponentDefinition getComponentDefinition(URI componentDefinitionURI)
componentDefinitionURI
- the given identity URI of the component definition to be retrievednull
otherwise.public Set<ComponentDefinition> getComponentDefinitions()
public Set<ComponentDefinition> getRootComponentDefinitions()
public Set<ModuleDefinition> getRootModuleDefinitions()
public void clearComponentDefinitions() throws SBOLValidationException
This method calls removeComponentDefinition(ComponentDefinition)
to iteratively
remove each component definition.
SBOLValidationException
- if an SBOL validation rule violation occurred in removeComponentDefinition(ComponentDefinition)
.public Sequence createSequence(String displayId, String elements, URI encoding) throws SBOLValidationException
defaultURIprefix
,
the given arguments, and an empty version string, and then
adds it to this SBOL document's list of Sequence instances.
This method calls createSequence(String, String, String, String, URI)
to do the following
validity checks and create a Sequence instance.
If the defaultURIprefix
does not end with one of the following delimiters: "/", ":", or "#",
then "/" is appended to the end of it.
This method requires the defaultURIprefix
field to be set, and
the given display ID is not null
and is valid.
A Sequence instance is created with a compliant URI. This URI is composed from
the this SBOL document's defaultURIprefix
, the optional type TopLevel.SEQUENCE
,
the given display ID, and an empty version string.
The display ID, persistent identity, and version fields of this instance
are then set accordingly.
displayId
- an intermediate between name and identity that is machine-readableelements
- characters that represents the constituents of a biological or chemical molecule (i.e. nucleotide bases of a molecule of DNA, the amino acid residues of a protein, or the atoms and chemical bonds of a small molecule)encoding
- Indicate how the elements property of a Sequence must be formed and interpretedSBOLValidationException
- if an SBOL validation rule was violated in createSequence(String, String, String, String, URI)
.public Sequence createSequence(String displayId, String version, String elements, URI encoding) throws SBOLValidationException
defaultURIprefix
and the given arguments, and then adds it to this SBOL document's list of Sequence instances.
This method calls createSequence(String, String, String, String, URI)
to do the following
validity checks and create a Sequence instance.
If the defaultURIprefix
does not end with one of the following delimiters: "/", ":", or "#", then
"/" is appended to the end of it.
This method requires the defaultURIprefix
field to be set, and
the given display ID and version arguments are not null
and are both valid.
A Sequence instance is created with a compliant URI. This URI is composed from
the this SBOL document's defaultURIprefix
, the optional type TopLevel.SEQUENCE
,
the given display ID, and version.
The display ID, persistent identity, and version fields of this instance
are then set accordingly.
displayId
- an intermediate between name and identity that is machine-readableversion
- The given version for this objectelements
- characters that represents the constituents of a biological or chemical molecule (i.e. nucleotide bases of a molecule of DNA, the amino acid residues of a protein, or the atoms and chemical bonds of a small molecule)encoding
- Indicate how the elements property of a Sequence must be formed and interpretedSBOLValidationException
- if an SBOL validation rule was violated in createSequence(String, String, String, String, URI)
.public Sequence createSequence(String URIprefix, String displayId, String version, String elements, URI encoding) throws SBOLValidationException
If the given URIprefix
does not end with one of the following delimiters: "/", ":", or "#", then
"/" is appended to the end of it.
This method requires that the given URIprefix
, display ID,
and version are not null
and are valid.
A Sequence instance is created with a compliant URI. This URI is composed from
the given URIprefix
, the optional type TopLevel.SEQUENCE
,
the given display ID, and version.
The display ID, persistent identity, and version fields of this instance
are then set accordingly.
URIprefix
- maps to a domain over which the user has controldisplayId
- an intermediate between name and identity that is machine-readableversion
- The given version for this objectelements
- characters that represents the constituents of a biological or chemical molecule (i.e. nucleotide bases of a molecule of DNA, the amino acid residues of a protein, or the atoms and chemical bonds of a small molecule)encoding
- Indicate how the elements property of a Sequence must be formed and interpretedSBOLValidationException
- if if any of the following SBOL validation rules was violated:
10201, 10202, 10204, 10206, 10220, 10402, 10403, 10405.public void createCopy(SBOLDocument document) throws SBOLValidationException
This method calls createCopy(TopLevel)
for each top-level instance.
document
- the document to be copied fromSBOLValidationException
- if an SBOL validation rule violation occurred in createCopy(TopLevel)
.public TopLevel createCopy(TopLevel topLevel) throws SBOLValidationException
This method calls createCopy(TopLevel, String, String, String)
with the given top-level instance,
and null
for other arguments.
topLevel
- the top-level to be copied fromSBOLValidationException
- if an SBOL validation rule violation occurred in createCopy(TopLevel, String, String, String)
.public TopLevel createCopy(TopLevel topLevel, String displayId) throws SBOLValidationException
This method calls createCopy(TopLevel, String, String, String)
with the given top-level instance,
the default URI prefix for this SBOL document, the given display ID, and the empty version string.
topLevel
- the top-level to be copied fromdisplayId
- the display ID of the created copySBOLValidationException
- if an SBOL validation rule violation occurred in
createCopy(TopLevel, String, String, String)
.public TopLevel rename(TopLevel topLevel, String displayId) throws SBOLValidationException
This method first calls createCopy(TopLevel, String, String, String)
to make a copy of
the given top-level with this SBOL document's default URI prefix, the given display, and an empty
string for version. It then removes the given top-level and then returns the newly-copied top-level.
topLevel
- the top-level to be renameddisplayId
- the given display ID to be renamed toSBOLValidationException
- if either of the following conditions is satisfied:
createCopy(TopLevel, String, String, String)
.public TopLevel createCopy(TopLevel topLevel, String displayId, String version) throws SBOLValidationException
This method calls createCopy(TopLevel, String, String, String)
with the given top-level instance,
the default URI prefix for this SBOL document, the given display ID, and the empty version string.
topLevel
- the top-level to be copied fromdisplayId
- the display ID of the created copyversion
- the version of the created copySBOLValidationException
- if an SBOL validation rule violation occurred in
createCopy(TopLevel, String, String, String)
public TopLevel rename(TopLevel topLevel, String displayId, String version) throws SBOLValidationException
This method first calls createCopy(TopLevel, String, String, String)
to make a copy of
the given top-level with this SBOL document's default URI prefix, the given display ID and version.
It then removes the given top-level and then returns the newly-copied top-level.
topLevel
- the top-level to be renameddisplayId
- the given display ID to be renamed toversion
- the given version to be renamed toSBOLValidationException
- if either of the following conditions is satisfied:
createCopy(TopLevel, String, String, String)
.public TopLevel createCopy(TopLevel topLevel, String URIprefix, String displayId, String version) throws SBOLValidationException
This method creates a compliant URI for the copied top-level with the given default URI prefix, display ID, and version.
topLevel
- the top-level to be copied fromURIprefix
- the URI prefix used to create the compliant URI for the created copydisplayId
- the display ID of the created copyversion
- the version of the created copySBOLValidationException
- if any of the following SBOL validation rules was violated:
10201, 10202, 10204, 10206, 10220,
10303, 10304, 10305,
10401, 10402, 10403, 10405,
10501, 10503, 10513, 10522, 10526,
10602, 10604, 10605, 10607,
10701,
10801, 10802, 10803, 10804, 10805, 10807, 10808, 10809, 10811,
10901, 10905,
11101, 11102, 11103, 11104,
11201, 11202,
11301,
11401, 11402, 11403, 11404, 11405, 11406,
11501, 11502, 11504, 11508,
11601, 11608, 11609,
11701, 11703, 11704, 11705,
11801,
11901,
12001, 12002, 12003,
12103,
12301, 12302.public SBOLDocument createRecursiveCopy(TopLevel topLevel) throws SBOLValidationException
topLevel
- The topLevel object to be recursively copied from this SBOLDocumentSBOLValidationException
- if any of the following SBOL validation rules was violated:
10201, 10202, 10204, 10206, 10220,
10303, 10304, 10305,
10401, 10402, 10403, 10405,
10501, 10503, 10522, 10526,
10602, 10604, 10605, 10607, 10701,
10801, 10802, 10803, 10804, 10805, 10807, 10808, 10809, 10811,
10901, 10905,
11101, 11201, 11301, 11401, 11402, 11403, 11404, 11405, 11406,
11501, 11502, 11504, 11508,
11601, 11608, 11609,
11701, 11703, 11704, 11705,
11801, 10802, 10803, 10804, 10807, 10808, 10809, 10811,
11901,
12001, 12002, 12003,
12101, 12103,
12301, 12302.public SBOLDocument changeURIPrefixVersion(String URIPrefix, String version) throws SBOLValidationException
URIPrefix
- new URI prefixversion
- new versionSBOLValidationException
- if URIprefix or version provided is invalidpublic TopLevel rename(TopLevel topLevel, String URIprefix, String displayId, String version) throws SBOLValidationException
This method first calls createCopy(TopLevel, String, String, String)
to make a copy of
the given top-level with the URI prefix, display ID, and version.
It then removes the given top-level and then returns the newly-copied top-level.
topLevel
- the top-level to be renamedURIprefix
- the given URI prefix to be rename todisplayId
- the given display ID to be renamed toversion
- the given version to be renamed toSBOLValidationException
- if either of the following conditions is satisfied:
createCopy(TopLevel, String, String, String)
.public boolean removeSequence(Sequence sequence) throws SBOLValidationException
sequence
- the given sequence to be removedtrue
if the given sequence was successfully removed, false
otherwiseSBOLValidationException
- if either of the following SBOL validation rules was violated:
10513, 12103.public Sequence getSequence(String displayId, String version)
This method first creates a compliant URI for the sequence to be retrieved.
It starts with the given URI prefix after its been successfully validated,
optionally followed by its type, namely TopLevel.SEQUENCE
, followed by the given display ID,
and ends with the given version. This URI is used to look up the sequence in this SBOL document.
displayId
- an intermediate between name and identity that is machine-readableversion
- The given version for this objectnull
otherwise.public Sequence getSequence(URI sequenceURI)
modelURI
from this
SBOL document's list of sequences.sequenceURI
- takes the given SequenceURI to retrieve the sequence from this SBOL documentnull
otherwise.public Set<Sequence> getSequences()
public void clearSequences() throws SBOLValidationException
This method calls removeSequence(Sequence)
to iteratively remove each sequence.
SBOLValidationException
- if an SBOL validation rule violation occurred in removeSequence(Sequence)
.public GenericTopLevel createGenericTopLevel(String displayId, QName rdfType) throws SBOLValidationException
This method calls createGenericTopLevel(String, String, String, QName)
with the default URI
prefix of this SBOL document, the given component definition display ID, an empty version string,
and the given RDF type.
displayId
- the display ID of the generic top-level to be createdrdfType
- the type of the generic top-level to be createdSBOLValidationException
- if an SBOL validation rule violation occurred in
createGenericTopLevel(String, String, String, QName)
.public GenericTopLevel createGenericTopLevel(String displayId, String version, QName rdfType) throws SBOLValidationException
This method calls createGenericTopLevel(String, String, String, QName)
with the default URI
prefix of this SBOL document, the given component definition display ID and version, and the given RDF type.
displayId
- the display ID of the generic top-level to be createdversion
- the version of the generic top-level to be createdrdfType
- the type of the generic top-level to be createdSBOLValidationException
- if an SBOL validation rule violation occurred in
createGenericTopLevel(String, String, String, QName)
.public GenericTopLevel createGenericTopLevel(String URIprefix, String displayId, String version, QName rdfType) throws SBOLValidationException
This method calls createGenericTopLevel(String, String, String, QName)
with the default URI
prefix of this SBOL document, the given component definition display ID and version, and the given RDF type.
URIprefix
- the given URI prefix used to create a compliant URI for the generic top-level to be createddisplayId
- the display ID of the generic top-level to be createdversion
- the version of the generic top-level to be createdrdfType
- the type of the generic top-level to be createdSBOLValidationException
- if an SBOL validation rules was violated:
10201, 10202, 10204, 10206, 10220, 10303, 10304, 10305, 10401, 10501, 10701, 10801, 10901, 11101, 11201, 11301,
11401, 11501, 11601, 11701, 11801, 11901, 12001, 12301, 12302.public boolean removeGenericTopLevel(GenericTopLevel genericTopLevel) throws SBOLValidationException
genericTopLevel
- the given generic top-level to be removedtrue
if the given generic top-level was successfully removed, false
otherwiseSBOLValidationException
- if the following SBOL validation rule was violated: 12103.public GenericTopLevel getGenericTopLevel(String displayId, String version)
A compliant generic top-level URI is created first. It starts with this SBOL document's default URI prefix
after its been successfully validated, optionally followed by its type, namely TopLevel.GENERIC_TOP_LEVEL
,
followed by the given display ID, and ends with the given version. This URI is used to look up the generic
top-level in this SBOL document.
displayId
- the display ID of the generic top-level to be retrievedversion
- the version of the generic top-level to be retrievednull
otherwise.public GenericTopLevel getGenericTopLevel(URI genericTopLevelURI)
genericTopLevelURI
- the identity URI of the top-level to be retrievednull
otherwise.public Set<GenericTopLevel> getGenericTopLevels()
public void clearGenericTopLevels() throws SBOLValidationException
This method calls removeGenericTopLevel(GenericTopLevel)
to iteratively
remove each generic top-level.
SBOLValidationException
- if an SBOL validation rule violation occurred in removeGenericTopLevel(GenericTopLevel)
.public TopLevel getTopLevel(URI topLevelURI)
topLevelURI
- the identity URI of the top-level to be retrievednull
otherwise.public Set<TopLevel> getTopLevels()
public Set<TopLevel> getByWasDerivedFrom(URI wasDerivedFrom)
wasDerivedFrom
field matches
the given one.wasDerivedFrom
- the wasDerivedFrom
field of which all matching top-levels to be retrievedwasDerivedFrom
fieldpublic SynBioHubFrontend addRegistry(String registryURL)
registryURL
- URL of the registry to addpublic SynBioHubFrontend addRegistry(String registryURL, String uriPrefix)
registryURL
- URL of the registry to adduriPrefix
- URI prefix for everything stored in this repositorypublic void addNamespace(URI nameSpaceURI, String prefix) throws SBOLValidationException
nameSpaceURI
- the URI used to construct a new namespaceprefix
- the prefix used to construct a new namespaceSBOLValidationException
- if namespace URI does not end with a delimeterpublic void addNamespace(QName qName) throws SBOLValidationException
qName
- the QName to be addedSBOLValidationException
- when namespace URI does not end with a delimiterpublic void clearNamespaces()
This method calls removeNamespace(URI)
to iteratively remove each non-required namespace.
public void clearRegistries()
This method calls removeRegistry(String)
to iteratively remove each registry.
public QName getNamespace(String namespacePrefix)
namespacePrefix
- the prefix of the namespace to be retrievednull
otherwisepublic QName getNamespace(URI namespaceURI)
namespaceURI
- the identity URI of the namespace to be retrievednull
otherwisepublic List<QName> getNamespaces()
public SynBioHubFrontend getRegistry(String registryURL)
registryURL
- URL for the registry to returnpublic List<SynBioHubFrontend> getRegistries()
public void removeNamespace(URI namespaceURI)
namespaceURI
- the namespaceURI to be removedpublic void removeRegistry(String registryId)
registryId
- the URL of the registry to be removedpublic void removeTopLevel(TopLevel topLevel) throws SBOLValidationException
topLevel
- the TopLevel object to removeSBOLValidationException
- if an SBOL validation rule violation occurred in any of the following methods:
public void setDefaultURIprefix(String defaultURIprefix) throws IllegalArgumentException
defaultURIprefix
- the given default URI prefixIllegalArgumentException
- if the given URI prefix is not compliantpublic String getDefaultURIprefix()
public boolean isComplete()
A true
value means that all identity URI references
should be able to dereference to instances in the this document, and a false
value means otherwise.
public void setComplete(boolean complete)
A true
value indicates this SBOL document is complete:
any identity URIs should be able to dereference to an instance in this document.
complete
- the given boolean value for the complete flagpublic boolean isCompliant()
A true
value means that all identity URIs in this SBOL document should be compliant,
and a false
value means otherwise.
public boolean isTypesInURIs()
A true
value means that types will be inserted into this document's each top-level's compliant URI when it is created,
and a false
value means otherwise.
public void setTypesInURIs(boolean typesInURIs)
A true
value means that types are inserted into top-level
identity URIs when they are created.
typesInURIs
- the given boolean value for the typesInURIs flagpublic boolean isCreateDefaults()
A true
value means that default components and/or functional components instances should
be created when not present, and a false
value means otherwise.
public void setCreateDefaults(boolean createDefaults)
true
value means that default component instances
should be created when not present.createDefaults
- the given boolean value for the createDefaults flagpublic void read(String fileName) throws SBOLValidationException, IOException, SBOLConversionException
fileName
- a given RDF file nameSBOLValidationException
- if an SBOL validation rule violation occurred in read(File)
.SBOLConversionException
- see SBOLConversionException
IOException
- see IOException
public void read(File file) throws SBOLValidationException, IOException, SBOLConversionException
file
- a given RDF fileSBOLValidationException
- if an SBOL validation rule violation occurred in read(InputStream)
.SBOLConversionException
- see SBOLConversionException
IOException
- see IOException
public void read(InputStream in) throws SBOLValidationException, IOException, SBOLConversionException
in
- a given RDF input streamSBOLValidationException
- if any of the following SBOL validation rules was violated:
10101, 10102, 10105,
10201, 10202, 10203, 10204, 10206, 10208, 10212, 10213, 10220,
10303, 10304, 10305,
10401, 10402, 10403, 10405,
10501, 10502, 10503, 10504, 10507, 10508, 10512, 10513, 10519, 10522, 10526,
10602, 10603, 10604, 10605, 10606, 10607,
10701,
10801, 10802, 10803, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 10811,
10901, 10902, 10904, 10905,
11002,
11101, 11102, 11103, 11104,
11201, 11202,
11301,
11401, 11402, 11403, 11404, 11405, 11406, 11407, 11412,
11501, 11502, 11504, 11508,
11601, 11602, 11604, 11605, 11606, 11607, 11608, 11609,
11701, 11702, 11703, 11704, 11705, 11706,
11801, 11802,
11901, 11902, 11906,
12001, 12002, 12003, 12004,
12101, 12102, 12103,
12301, 12302.SBOLConversionException
- see SBOLConversionException
IOException
- see IOException
public void write(String filename) throws IOException, SBOLConversionException
This method calls SBOLWriter.write(SBOLDocument, File)
by passing this SBOL document, and a
new file with the given file name.
filename
- the given output file nameIOException
- see IOException
SBOLConversionException
- see SBOLConversionException
public void write(String filename, String fileType) throws IOException, SBOLConversionException
This method calls SBOLWriter.write(SBOLDocument, File, String)
by passing this SBOL document, and a
new file with the given file name and type.
filename
- the given output file namefileType
- the serialization formatIOException
- see IOException
SBOLConversionException
- see SBOLConversionException
public void write(File file) throws IOException, SBOLConversionException
This method calls SBOLWriter.write(SBOLDocument, File)
.
file
- the given output fileIOException
- see IOException
SBOLConversionException
- see SBOLConversionException
public void write(File file, String fileType) throws IOException, SBOLConversionException
This method calls SBOLWriter.write(SBOLDocument, OutputStream, String)
.
file
- the given output filefileType
- the given serialization formatIOException
- see IOException
SBOLConversionException
- see SBOLConversionException
public void write(OutputStream out) throws SBOLConversionException
This method calls SBOLWriter.write(SBOLDocument, OutputStream)
by passing
this SBOL document and the given output stream.
out
- the given output streamSBOLConversionException
- see SBOLConversionException
public void write(OutputStream out, String fileType) throws SBOLConversionException, IOException
This method calls SBOLWriter.write(SBOLDocument, OutputStream, String)
by passing
this SBOL document, the given output stream and file type.
out
- the given output streamfileType
- the serialization formatSBOLConversionException
- see SBOLConversionException
IOException
- see IOException
Copyright © 2017. All rights reserved.