info.sswap.impl.empire.model
Class DatatypeImpl

java.lang.Object
  extended by info.sswap.impl.empire.model.ModelImpl
      extended by info.sswap.impl.empire.model.ElementImpl
          extended by info.sswap.impl.empire.model.DatatypeImpl
All Implemented Interfaces:
com.clarkparsia.empire.SupportsRdfId, SSWAPDatatype, SSWAPElement, SSWAPModel

public class DatatypeImpl
extends ElementImpl
implements SSWAPDatatype

Implementation of SSWAPDatatype

Author:
Blazej Bulka

Nested Class Summary
 
Nested classes/interfaces inherited from interface info.sswap.api.model.SSWAPDatatype
SSWAPDatatype.XSD
 
Nested classes/interfaces inherited from interface com.clarkparsia.empire.SupportsRdfId
com.clarkparsia.empire.SupportsRdfId.BNodeKey, com.clarkparsia.empire.SupportsRdfId.RdfKey<T>, com.clarkparsia.empire.SupportsRdfId.URIKey
 
Field Summary
private  com.clarkparsia.empire.SupportsRdfId.RdfKey rdfKey
          The RDF identifier of this data type.
private  com.hp.hpl.jena.rdf.model.Resource resource
          The Jena resource that defines this data type (important for fast access to type information).
 
Constructor Summary
DatatypeImpl(SourceModel parent, java.net.URI uri)
          Creates a datatype
 
Method Summary
 void addOneOf(java.util.Collection<SSWAPLiteral> oneOf)
          Adds an owl:oneOf axiom to this datatype
private  com.hp.hpl.jena.rdf.model.Statement createRdfTypeStatement(java.net.URI typeURI)
          Creates a Jena statement that states that this type is an owl:Class.
 boolean equals(java.lang.Object o)
           
 com.clarkparsia.empire.SupportsRdfId.RdfKey getRdfId()
          Gets the RDF identifier of this type.
(package private)  com.hp.hpl.jena.rdf.model.Resource getResource()
          Gets the corresponding Jena resource for this datatype.
 int hashCode()
          Overridden hash code method to make sure that the generated hashcodes are consistent with the overriden equals() method.
 void setRdfId(com.clarkparsia.empire.SupportsRdfId.RdfKey rdfKey)
          Sets the RDF identifier of this type.
 
Methods inherited from class info.sswap.impl.empire.model.ElementImpl
addComment, addLabel, asBoolean, asDouble, asIndividual, asInteger, asList, asLiteral, asString, getComment, getJenaResource, getLabel, isAnonymous, isIndividual, isList, isLiteral
 
Methods inherited from class info.sswap.impl.empire.model.ModelImpl
addImport, assertModel, assertSourceModel, checkProfile, dereference, dereference, doClosure, getAllDependentObjects, getDependentObject, getDocument, getExpressivity, getImports, getInputStream, getNsPrefixMap, getReasoningService, getSourceModel, getTypeSignature, getURI, hasSourceModel, hasSourceModelWithEntityManager, isDereferenced, persist, rdfIdEquals, rdfIdHashCode, refresh, refreshSiblings, removeImport, removeNsPrefix, serialize, serialize, setDereferenced, setNsPrefix, setSourceModel, setURI, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.sswap.api.model.SSWAPElement
addComment, addLabel, asBoolean, asDouble, asIndividual, asInteger, asList, asLiteral, asString, getComment, getLabel, isIndividual, isList, isLiteral
 
Methods inherited from interface info.sswap.api.model.SSWAPModel
addImport, checkProfile, dereference, dereference, doClosure, getDocument, getImports, getInputStream, getNsPrefixMap, getReasoningService, getTypeSignature, getURI, isDereferenced, removeImport, removeNsPrefix, serialize, serialize, setNsPrefix, validate
 

Field Detail

rdfKey

private com.clarkparsia.empire.SupportsRdfId.RdfKey rdfKey
The RDF identifier of this data type.


resource

private com.hp.hpl.jena.rdf.model.Resource resource
The Jena resource that defines this data type (important for fast access to type information). This field is lazily initialized by getResource(). All accesses to this field should be made via the getResource() method.

Constructor Detail

DatatypeImpl

public DatatypeImpl(SourceModel parent,
                    java.net.URI uri)
Creates a datatype

Parameters:
parent - the source model where the datatype should be created
uri - the URI of the datatype (may be null for an anonymous datatype)
Method Detail

createRdfTypeStatement

private com.hp.hpl.jena.rdf.model.Statement createRdfTypeStatement(java.net.URI typeURI)
Creates a Jena statement that states that this type is an owl:Class. The statement is of form: this.rdfKey rdf:type owl:Class .

Returns:
the statement created for the source model of this type

addOneOf

public void addOneOf(java.util.Collection<SSWAPLiteral> oneOf)
Description copied from interface: SSWAPDatatype
Adds an owl:oneOf axiom to this datatype

Specified by:
addOneOf in interface SSWAPDatatype
Parameters:
oneOf - the collection of literals that will be the only valid values for this datatype

getRdfId

public com.clarkparsia.empire.SupportsRdfId.RdfKey getRdfId()
Gets the RDF identifier of this type.

Specified by:
getRdfId in interface com.clarkparsia.empire.SupportsRdfId
Returns:
the RDF identifier of this type (URL or BNode identifier)

setRdfId

public void setRdfId(com.clarkparsia.empire.SupportsRdfId.RdfKey rdfKey)
Sets the RDF identifier of this type.

Specified by:
setRdfId in interface com.clarkparsia.empire.SupportsRdfId
Parameters:
rdfKey - the RDF identifier of this type (URL or BNode identifier).

getResource

com.hp.hpl.jena.rdf.model.Resource getResource()
Gets the corresponding Jena resource for this datatype. This method lazily initializes the "resource" field of this datatype.

Returns:
Jena Resource of this datatype

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overridden hash code method to make sure that the generated hashcodes are consistent with the overriden equals() method.

Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode.


Copyright (c) 2011, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.