public final class RdfsProperty extends RdfsElem
Modifier and Type | Class and Description |
---|---|
static class |
RdfsProperty.Kind
We need this one with OWL, since we cannot distinguish between dataType and range (OWL always
uses range plus some other tags).
|
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
_dataType |
private java.lang.String |
_domain |
private java.lang.String |
_invRoleName |
private RdfsProperty.Kind |
_kind
Legacy RDF does not allow us to distinguish with certainty the kind of property at
construction, except for association ends.
|
private static org.apache.log4j.Logger |
_logger |
private java.lang.String |
_multiplicity |
private java.lang.String |
_range |
invalidCharsPattern
Constructor and Description |
---|
RdfsProperty(RdfsModel model,
org.w3c.dom.Element elem)
Creates instance from DOM Element.
|
RdfsProperty(RdfsModel model,
java.lang.String about,
java.lang.String label,
java.lang.String comment,
java.lang.String pckage,
boolean validateAbout,
java.lang.String domain,
RdfsProperty.Kind kind,
java.lang.String dataType,
java.lang.String range,
java.lang.String invRoleName,
java.lang.String multiplicity)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
doEquals(boolean isForEquals,
java.lang.Object obj,
java.util.List<RdfsDifference> diffs) |
boolean |
equals(java.lang.Object obj)
Uses all the instance fields, except for _kind.
|
java.lang.String |
getDatatype() |
java.util.List<RdfsDifference> |
getDiffs(RdfsElem other)
Calculates differences between this instance and
other and returns them in a
list of Strings. |
java.lang.String |
getDomain() |
private char |
getFirstChar(java.lang.String s) |
java.lang.String |
getInvRoleName() |
java.lang.String |
getKind()
Returns the string describing the kind of this element.
|
private char |
getLastChar(java.lang.String s) |
java.lang.String |
getMultiplicity() |
java.lang.String |
getNameAndMultiplicity() |
java.lang.String |
getRange() |
int |
hashCode()
Uses all the instance fields, except for _kind.
|
boolean |
isAssocEnd() |
boolean |
isDatatypeAttr() |
boolean |
isEnumAttr() |
(package private) boolean |
isEnumAttr(java.lang.String range) |
static boolean |
isPrimitiveType(java.lang.String className) |
boolean |
isSimpleAttr() |
private java.lang.String |
parseAndCheckRdfMultiplicity(org.w3c.dom.Element elem) |
(package private) void |
setDtClassAndCrossCheckDtAttribute()
Sets a class as datatype class based on the definition of the property (i.e., when datatype
defined for this attribute).
|
java.lang.String |
toString() |
java.lang.String |
toStringLong() |
private void |
validateDatatypeAndRange() |
formatDiff, formatMissingAndAdded, getAbout, getComment, getLabel, getModel, getName, getPackage, getSchemaLabel
private static final org.apache.log4j.Logger _logger
private final java.lang.String _domain
private java.lang.String _dataType
private final java.lang.String _range
private final java.lang.String _invRoleName
private final java.lang.String _multiplicity
private final RdfsProperty.Kind _kind
RdfsProperty(RdfsModel model, org.w3c.dom.Element elem) throws CimSchemaException
model
- elem
- CimSchemaException
- if about attribute contains an invalid URI.public RdfsProperty(RdfsModel model, java.lang.String about, java.lang.String label, java.lang.String comment, java.lang.String pckage, boolean validateAbout, java.lang.String domain, RdfsProperty.Kind kind, java.lang.String dataType, java.lang.String range, java.lang.String invRoleName, java.lang.String multiplicity) throws CimSchemaException
model
- about
- label
- comment
- pckage
- validateAbout
- domain
- kind
- range
- invRoleName
- null for attributemultiplicity
- empty string for attributeCimSchemaException
private void validateDatatypeAndRange()
private java.lang.String parseAndCheckRdfMultiplicity(org.w3c.dom.Element elem)
public boolean isAssocEnd()
public static boolean isPrimitiveType(java.lang.String className)
public boolean isSimpleAttr()
public boolean isDatatypeAttr()
public boolean isEnumAttr()
boolean isEnumAttr(java.lang.String range)
public java.lang.String getDomain()
public java.lang.String getRange()
public java.lang.String getDatatype()
public java.lang.String getInvRoleName()
public java.lang.String getMultiplicity()
public java.lang.String getNameAndMultiplicity()
public java.lang.String getKind()
RdfsElem
void setDtClassAndCrossCheckDtAttribute()
Since RDF does not give us stereotypes, we have to "search" for them. We deduce that class is a datatype if this attribute's datatype is defined by that class. The class is supposed to not be a subclass, i.e., it must have been found to be a first level class.
public java.lang.String toStringLong()
toStringLong
in class RdfsElem
public int hashCode()
public boolean equals(java.lang.Object obj)
private boolean doEquals(boolean isForEquals, java.lang.Object obj, java.util.List<RdfsDifference> diffs)
private char getFirstChar(java.lang.String s)
private char getLastChar(java.lang.String s)
public final java.util.List<RdfsDifference> getDiffs(RdfsElem other)
RdfsElem
other
and returns them in a
list of Strings. While RdfsElem.equals(Object)
method ignores some known differences between
elements in different dialects, this method catches them all.
Implementation note: Subclasses that override this method are expected to first call super.runDiff().
Copyright 2009-2015 Tatjana (Tanja) Kostic