org.opentox.toxotis.ontology.impl
Class MetaInfoImpl

java.lang.Object
  extended by org.opentox.toxotis.ontology.impl.MetaInfoImpl
All Implemented Interfaces:
Serializable, IHTMLSupport, MetaInfo

public class MetaInfoImpl
extends Object
implements MetaInfo

See Also:
Serialized Form

Constructor Summary
MetaInfoImpl()
           
 
Method Summary
 MetaInfo addAudience(LiteralValue... audience)
           
 MetaInfo addAudience(String... audience)
           
 MetaInfo addComment(LiteralValue... comment)
          Add comments to the current instance of MetaInfo
 MetaInfo addComment(String... comment)
          Add comments to the current instance of MetaInfo
 MetaInfo addContributor(LiteralValue... contributor)
           
 MetaInfo addContributor(String... contributor)
           
 MetaInfo addCreator(LiteralValue... creator)
           
 MetaInfo addCreator(String... creator)
           
 MetaInfo addDescription(LiteralValue... description)
           
 MetaInfo addDescription(String... description)
           
 MetaInfo addHasSource(ResourceValue hasSource)
           
 MetaInfo addIdentifier(LiteralValue... identifier)
           
 MetaInfo addIdentifier(String... identifier)
           
 MetaInfo addIdentifier(String identifier)
           
 MetaInfo addPublisher(LiteralValue... publisher)
           
 MetaInfo addPublisher(String... publisher)
           
 MetaInfo addRights(LiteralValue... rights)
           
 MetaInfo addRights(String... rights)
           
 MetaInfo addSameAs(ResourceValue value)
           
 MetaInfo addSeeAlso(ResourceValue value)
           
 MetaInfo addSubject(LiteralValue... subject)
           
 MetaInfo addSubject(String... subject)
           
 MetaInfo addTitle(LiteralValue... value)
           
 MetaInfo addTitle(String... value)
           
 MetaInfo addTitle(String value)
           
 com.hp.hpl.jena.rdf.model.Resource attachTo(com.hp.hpl.jena.rdf.model.Resource resource, com.hp.hpl.jena.ontology.OntModel model)
          Attaches the meta data to a given resource in an ontological model returning the updated resource.
 boolean equals(Object obj)
           
 Set<LiteralValue> getAudiences()
           
 Set<LiteralValue> getComments()
          The property rdfs:comment is used to provide a human-readable description of a resource.
 Set<LiteralValue> getContributors()
           
 Set<LiteralValue> getCreators()
          The creator is an entity primarily responsible for making the content of the resource.
 LiteralValue getDate()
           
 Set<LiteralValue> getDescriptions()
          An account of the content of the resource.
 long getHash()
           
 Set<ResourceValue> getHasSources()
           
 Set<LiteralValue> getIdentifiers()
          Get the identifier (ID) of the described entity.
 Set<LiteralValue> getPublishers()
           
 Set<LiteralValue> getRights()
          Copyright notes for the underlying resource.
 Set<ResourceValue> getSameAs()
          The built-in OWL property owl:sameAs links an individual to an individual (i.e.
 Set<ResourceValue> getSeeAlso()
          Related to the datatype ontological property rdfs:seeAlso.
 Set<LiteralValue> getSubjects()
          Get the topic of the content of the resource.
 Set<LiteralValue> getTitles()
          Get the name given to the resource.
 int hashCode()
           
 HTMLContainer inHtml()
          Create an HTML container for the online resource.
 boolean isEmpty()
          Check whether the meta info object is empty.
 MetaInfo setAudiences(Set<LiteralValue> audiences)
           
 MetaInfo setComments(Set<LiteralValue> comments)
          Setter for comments as a set.
 MetaInfo setContributors(Set<LiteralValue> contributors)
           
 MetaInfo setCreators(Set<LiteralValue> creators)
           
 MetaInfo setDate(LiteralValue date)
           
 MetaInfo setDateCurrent()
           
 MetaInfo setDescriptions(Set<LiteralValue> descriptions)
          Provide set of descriptions
 void setHash(long hash)
           
 MetaInfo setHasSources(Set<ResourceValue> hasSources)
           
 MetaInfo setIdentifiers(Set<LiteralValue> identifiers)
           
 MetaInfo setPublishers(Set<LiteralValue> publishers)
           
 MetaInfo setRights(Set<LiteralValue> rights)
           
 MetaInfo setSameAs(Set<ResourceValue> values)
           
 MetaInfo setSeeAlso(Set<ResourceValue> values)
           
 MetaInfo setSubjects(Set<LiteralValue> subjects)
           
 MetaInfo setTitles(Set<LiteralValue> values)
           
 String toString()
           
 void writeToStAX(XMLStreamWriter writer)
          Write the meta information in RDF/XML format using an XML Stream Writer.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MetaInfoImpl

public MetaInfoImpl()
Method Detail

toString

public String toString()
Overrides:
toString in class Object

attachTo

public com.hp.hpl.jena.rdf.model.Resource attachTo(com.hp.hpl.jena.rdf.model.Resource resource,
                                                   com.hp.hpl.jena.ontology.OntModel model)
Description copied from interface: MetaInfo
Attaches the meta data to a given resource in an ontological model returning the updated resource. The provided ontological model is also updated with the meta data assigned to the given resource.

Specified by:
attachTo in interface MetaInfo
Parameters:
resource - A resource from an ontological model to which meta data are to be assigned. The resource provided as input to this method is updated according to the metadata and various statements are assigned to it concerning the non-null fields of the metadata object to which the method is applied.
model - The ontological model holding the individual provided in this method.
Returns:
The updated resource with the metadata.

writeToStAX

public void writeToStAX(XMLStreamWriter writer)
                 throws XMLStreamException
Description copied from interface: MetaInfo
Write the meta information in RDF/XML format using an XML Stream Writer. The data are written at the current position of the cursor of the writer. The method appends meta information about the underlying resource that is described in the RDF/XML document. Note that the writter should include at least the following namespaces before the invokation of this method:
 ot   : http://www.opentox.org/api/1.1#
 rdfs : http://www.w3.org/2000/01/rdf-schema#
 rdf  : http://www.w3.org/1999/02/22-rdf-syntax-ns#
 dc   : http://purl.org/dc/elements/1.1/
 
The following code can be used to declare the above namespaces:
 writer.writeNamespace("ot", OTClasses.NS);
 writer.writeNamespace("rdfs", RDFS.getURI());
 writer.writeNamespace("rdf", RDF.getURI());
 writer.writeNamespace("dc", DC.NS);
 writer.writeNamespace("owl", OWL.NS);
 
Additionally you can declare the above as a set of predixes:
 writer.setPrefix("ot", OTClasses.NS);
 writer.setPrefix("rdfs", RDFS.getURI());
 writer.setPrefix("rdf", RDF.getURI());
 writer.setPrefix("dc", DC.NS);
 writer.setPrefix("owl", OWL.NS);
 

Specified by:
writeToStAX in interface MetaInfo
Parameters:
writer - Writer used to write XML data to an Output Stream
Throws:
XMLStreamException - In case there the data that try to be written are not consisent. For example such an exception is thrown if you forget to close a non-empty element in the XML.

getComments

public Set<LiteralValue> getComments()
Description copied from interface: MetaInfo
The property rdfs:comment is used to provide a human-readable description of a resource. Users can specify a set of such comments on a resource of interest.

Specified by:
getComments in interface MetaInfo
Returns:
A comment on the described entity.

setComments

public MetaInfo setComments(Set<LiteralValue> comments)
Description copied from interface: MetaInfo
Setter for comments as a set.

Specified by:
setComments in interface MetaInfo
Parameters:
comments - Comments for the resource
Returns:
The current modifiable MetaInfo object.

addComment

public MetaInfo addComment(String... comment)
Description copied from interface: MetaInfo
Add comments to the current instance of MetaInfo

Specified by:
addComment in interface MetaInfo
Parameters:
comment - Sequence of comments provided for this MetaInfo object as plain strings.
Returns:
The current modifiable MetaInfo object.

addComment

public MetaInfo addComment(LiteralValue... comment)
Description copied from interface: MetaInfo
Add comments to the current instance of MetaInfo

Specified by:
addComment in interface MetaInfo
Parameters:
comment - Sequence of comments provided for this MetaInfo object as literal value objects.
Returns:
The current modifiable MetaInfo object.

getDescriptions

public Set<LiteralValue> getDescriptions()
Description copied from interface: MetaInfo
An account of the content of the resource. Description may include but is not limited to: an abstract, table of contents, reference to a graphical representation of content or a free-text account of the content.

Specified by:
getDescriptions in interface MetaInfo
Returns:
Description as a typed value

setDescriptions

public MetaInfo setDescriptions(Set<LiteralValue> descriptions)
Description copied from interface: MetaInfo
Provide set of descriptions

Specified by:
setDescriptions in interface MetaInfo
Parameters:
descriptions - Set of descriptions as literal values
Returns:

addDescription

public MetaInfo addDescription(LiteralValue... description)
Specified by:
addDescription in interface MetaInfo
Returns:

addDescription

public MetaInfo addDescription(String... description)
Specified by:
addDescription in interface MetaInfo
Returns:

getIdentifiers

public Set<LiteralValue> getIdentifiers()
Description copied from interface: MetaInfo
Get the identifier (ID) of the described entity. An identifier is an unambiguous reference to the resource within a given context. Recommended best practice is to identify the resource by means of a string or number conforming to a formal identification system. Examples of formal identification systems include the Uniform Resource Identifier (URI) (including the Uniform Resource Locator (URL), the Digital Object Identifier (DOI) and the International Standard Book Number (ISBN).

Specified by:
getIdentifiers in interface MetaInfo
Returns:
Identifier as a Typed Value
See Also:
http://dublincore.org/documents/usageguide/elements.shtml

setIdentifiers

public MetaInfo setIdentifiers(Set<LiteralValue> identifiers)
Specified by:
setIdentifiers in interface MetaInfo
Returns:

addIdentifier

public MetaInfo addIdentifier(LiteralValue... identifier)
Specified by:
addIdentifier in interface MetaInfo
Returns:

addIdentifier

public MetaInfo addIdentifier(String... identifier)
Specified by:
addIdentifier in interface MetaInfo
Returns:

getSameAs

public Set<ResourceValue> getSameAs()
Description copied from interface: MetaInfo
The built-in OWL property owl:sameAs links an individual to an individual (i.e. it is an object property). Such an owl:sameAs statement indicates that two URI references actually refer to the same thing: the individuals have the same "identity". For individuals such as "people" this notion is relatively easy to understand. For example, we could state that the following two URI references actually refer to the same person:
 <rdf:Description rdf:about="#William_Jefferson_Clinton">
 <owl:sameAs rdf:resource="#BillClinton"/>
 </rdf:Description>
 
The owl:sameAs statements are often used in defining mappings between ontologies. It is unrealistic to assume everybody will use the same name to refer to individuals. That would require some grand design, which is contrary to the spirit of the web.

Specified by:
getSameAs in interface MetaInfo
Returns:
A link to a resource that resembles the described entity

setSameAs

public MetaInfo setSameAs(Set<ResourceValue> values)
Specified by:
setSameAs in interface MetaInfo
Returns:

addSameAs

public MetaInfo addSameAs(ResourceValue value)
Specified by:
addSameAs in interface MetaInfo
Returns:

getSeeAlso

public Set<ResourceValue> getSeeAlso()
Description copied from interface: MetaInfo
Related to the datatype ontological property rdfs:seeAlso. The property rdfs:seeAlso specifies a resource that might provide additional information about the subject resource. This property may be specialized using rdfs:subPropertyOf to more precisely indicate the nature of the information the object resource has about the subject resource. The object and the subject resources are constrained only to be instances of the class rdfs:Resource.

Specified by:
getSeeAlso in interface MetaInfo
Returns:
A reference to some other entity as a typed value.

setSeeAlso

public MetaInfo setSeeAlso(Set<ResourceValue> values)
Specified by:
setSeeAlso in interface MetaInfo
Returns:

addSeeAlso

public MetaInfo addSeeAlso(ResourceValue value)
Specified by:
addSeeAlso in interface MetaInfo
Returns:

getTitles

public Set<LiteralValue> getTitles()
Description copied from interface: MetaInfo
Get the name given to the resource. Typically, a Title will be a name by which the resource is formally known.

Specified by:
getTitles in interface MetaInfo
Returns:
Tile as a Typed Value

setTitles

public MetaInfo setTitles(Set<LiteralValue> values)
Specified by:
setTitles in interface MetaInfo
Returns:

addTitle

public MetaInfo addTitle(String value)

addTitle

public MetaInfo addTitle(LiteralValue... value)
Specified by:
addTitle in interface MetaInfo
Returns:

addTitle

public MetaInfo addTitle(String... value)
Specified by:
addTitle in interface MetaInfo
Returns:

getSubjects

public Set<LiteralValue> getSubjects()
Description copied from interface: MetaInfo
Get the topic of the content of the resource. Typically, a Subject will be expressed as keywords or key phrases or classification codes that describe the topic of the resource. Recommended best practice is to select a value from a controlled vocabulary or formal classification scheme.

Specified by:
getSubjects in interface MetaInfo
Returns:
Subject as a typed value

setSubjects

public MetaInfo setSubjects(Set<LiteralValue> subjects)
Specified by:
setSubjects in interface MetaInfo
Returns:

addSubject

public MetaInfo addSubject(LiteralValue... subject)
Specified by:
addSubject in interface MetaInfo
Returns:

addSubject

public MetaInfo addSubject(String... subject)
Specified by:
addSubject in interface MetaInfo
Returns:

getPublishers

public Set<LiteralValue> getPublishers()
Specified by:
getPublishers in interface MetaInfo
Returns:

setPublishers

public MetaInfo setPublishers(Set<LiteralValue> publishers)
Specified by:
setPublishers in interface MetaInfo
Returns:

addPublisher

public MetaInfo addPublisher(LiteralValue... publisher)
Specified by:
addPublisher in interface MetaInfo
Returns:

addPublisher

public MetaInfo addPublisher(String... publisher)
Specified by:
addPublisher in interface MetaInfo
Returns:

getCreators

public Set<LiteralValue> getCreators()
Description copied from interface: MetaInfo
The creator is an entity primarily responsible for making the content of the resource. Examples of a Creator include a person, an organization, or a service. Typically the name of the Creator should be used to indicate the entity.

Specified by:
getCreators in interface MetaInfo
Returns:
Creator as a typed value

setCreators

public MetaInfo setCreators(Set<LiteralValue> creators)
Specified by:
setCreators in interface MetaInfo
Returns:

addCreator

public MetaInfo addCreator(LiteralValue... creator)
Specified by:
addCreator in interface MetaInfo
Returns:

addCreator

public MetaInfo addCreator(String... creator)
Specified by:
addCreator in interface MetaInfo
Returns:

getHasSources

public Set<ResourceValue> getHasSources()
Specified by:
getHasSources in interface MetaInfo
Returns:

setHasSources

public MetaInfo setHasSources(Set<ResourceValue> hasSources)
Specified by:
setHasSources in interface MetaInfo
Returns:

addHasSource

public MetaInfo addHasSource(ResourceValue hasSource)
Specified by:
addHasSource in interface MetaInfo
Returns:

getContributors

public Set<LiteralValue> getContributors()
Specified by:
getContributors in interface MetaInfo
Returns:

setContributors

public MetaInfo setContributors(Set<LiteralValue> contributors)
Specified by:
setContributors in interface MetaInfo
Returns:

addContributor

public MetaInfo addContributor(LiteralValue... contributor)
Specified by:
addContributor in interface MetaInfo
Returns:

addContributor

public MetaInfo addContributor(String... contributor)
Specified by:
addContributor in interface MetaInfo
Returns:

getAudiences

public Set<LiteralValue> getAudiences()
Specified by:
getAudiences in interface MetaInfo
Returns:

setAudiences

public MetaInfo setAudiences(Set<LiteralValue> audiences)
Specified by:
setAudiences in interface MetaInfo
Returns:

addAudience

public MetaInfo addAudience(LiteralValue... audience)
Specified by:
addAudience in interface MetaInfo
Returns:

addAudience

public MetaInfo addAudience(String... audience)
Specified by:
addAudience in interface MetaInfo
Returns:

getDate

public LiteralValue getDate()
Specified by:
getDate in interface MetaInfo
Returns:

setDate

public MetaInfo setDate(LiteralValue date)
Specified by:
setDate in interface MetaInfo
Returns:

setDateCurrent

public MetaInfo setDateCurrent()

addIdentifier

public MetaInfo addIdentifier(String identifier)

getHash

public long getHash()
Specified by:
getHash in interface MetaInfo
Returns:

setHash

public void setHash(long hash)
Specified by:
setHash in interface MetaInfo

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

inHtml

public HTMLContainer inHtml()
Description copied from interface: IHTMLSupport
Create an HTML container for the online resource.

Specified by:
inHtml in interface IHTMLSupport
Returns:
HTMLContainer which can be used to create an HTML representation for the component.

isEmpty

public boolean isEmpty()
Description copied from interface: MetaInfo
Check whether the meta info object is empty.

Specified by:
isEmpty in interface MetaInfo
Returns:
true if the MetaInfo object is empty and false otherwise.

getRights

public Set<LiteralValue> getRights()
Description copied from interface: MetaInfo
Copyright notes for the underlying resource.

Specified by:
getRights in interface MetaInfo
Returns:
Set of copyright notes for the underlying resource for which this meta-info element is composed.

setRights

public MetaInfo setRights(Set<LiteralValue> rights)
Specified by:
setRights in interface MetaInfo
Returns:

addRights

public MetaInfo addRights(LiteralValue... rights)
Specified by:
addRights in interface MetaInfo
Returns:

addRights

public MetaInfo addRights(String... rights)
Specified by:
addRights in interface MetaInfo
Returns:


Copyright © 2011-2012 OpenTox. All Rights Reserved.