public class OwlThing extends RdfThing
Modifier and Type | Method and Description |
---|---|
boolean |
addDatatypeValue(java.lang.String datatypeName,
RdfDataThing<?> rdfThing)
Add a value for a Datatype property to this OwlThing.
|
boolean |
addDatatypeValue(java.lang.String datatypeName,
java.lang.String value)
Add a value for a Datatype property to this OwlThing.
|
boolean |
addDatatypeValue(java.lang.String datatypeName,
java.lang.String value,
RdfTriple.TripleType relationType)
Add a value for a Datatype property to this OwlThing.
|
static void |
addOwlThing(OwlThing thing)
Add an OwlThing to the cache if it hasn't been added, or if it had been
previously removed
|
boolean |
addRelation(java.lang.String relationName,
OwlThing relatedTo,
RdfTriple.TripleType relationType)
Add a relation to this OwlThing, relating it to another OwlThing
|
void |
addSameAs(java.lang.String altName)
Create a sameAs reference for a particular object.
|
static void |
clearDefined()
Remove all defined OwlThings from the internal tables
|
void |
copyValues(OwlThing otherThing)
Copy explicit properties from another OwlThing to this one.
|
static OwlThing |
createFromElement(org.w3c.dom.Element element)
Create an OwlThing from an OWL RDF element.
|
void |
delete()
Delete this OwlThing from the cache, and remove it from any relations
with other objects.
|
void |
deriveValues()
Derive all values for this OwlThing.
|
static OwlThing |
findOwlThing(java.lang.String name)
Find an OwlThing with the given name.
|
static java.util.Set<java.lang.String> |
getAllThingNames()
Get the names of all OwlThings defined.
|
static java.util.Set<OwlThing> |
getAllThings()
Get all OwlThings defined
|
java.util.Set<java.lang.String> |
getAlternateNames()
Get the set of names this thing is also known as.
|
OwlClass |
getOwlClass()
Get the OwlClass this OwlThing belongs to.
|
static OwlThing |
getOwlThing(java.lang.String name)
Get an OwlThing with the given name.
|
static OwlThing |
getOwlThing(java.lang.String name,
OwlClass owlClass)
Get an OwlThing with the given name and class.
|
java.util.Set<OwlThing> |
getRelated(java.lang.String relationName)
Get all things that are related to this object by the given relationship
name or its descendant properties.
|
java.util.Set<RdfTriple> |
getRelationships()
Get all relationships that this OwlThing has values for
|
java.util.Set<java.lang.String> |
getValues(java.lang.String propertyName)
Get all string values for the given property for this OwlThing.
|
void |
mergeThing(OwlThing owlThing)
Merge another defined thing with this thing
|
boolean |
refineClass(OwlClass newCls)
Refine this OwlThing to be a member of the provided class.
|
void |
removeAllSameAs()
Remove all sameAs links to this OwlThing
|
void |
removeDatatypeValue(java.lang.String propName,
java.lang.String value)
Removes a datatype value to from OwlThing
|
static void |
removeOwlThing(OwlThing thing)
Remove an OwlThing from the cache of things
|
void |
removeRelation(java.lang.String relationName,
OwlThing relatedTo)
Removes a relation to from OwlThing's list of relations.
|
void |
removeRelations(java.lang.String relationName)
Removes all relations of a given relationship name.
|
void |
removeSameAs(java.lang.String altName)
Remove a sameAs reference for a particular object.
|
static void |
replaceRefsToThing(OwlThing oldThing,
OwlThing newThing)
Replace the references to an object with a different object.
|
void |
setName(java.lang.String thingName)
Set the name of this OwlThing.
|
java.lang.String |
toString()
Return a string representation of this OwlThing
|
boolean |
validate()
Validate this OwlThing.
|
getName, getUri, isVariableFlag, matches, setUri, setVariableFlag
public boolean addDatatypeValue(java.lang.String datatypeName, RdfDataThing<?> rdfThing)
datatypeName
- the name of the DatatypePropertyrdfThing
- the value for the propertypublic boolean addDatatypeValue(java.lang.String datatypeName, java.lang.String value)
datatypeName
- the name of the DatatypePropertyvalue
- the value for the propertypublic boolean addDatatypeValue(java.lang.String datatypeName, java.lang.String value, RdfTriple.TripleType relationType)
datatypeName
- the name of the DatatypePropertyvalue
- the value for the propertyrelationType
- the type of relationpublic boolean addRelation(java.lang.String relationName, OwlThing relatedTo, RdfTriple.TripleType relationType)
relationName
- the relationship name. This should be the name of an
OwlObjectPropertyrelatedTo
- the OwlThing this thing is related torelationType
- the type of relationpublic void addSameAs(java.lang.String altName)
altName
- the alternate name for the objectpublic void copyValues(OwlThing otherThing)
otherThing
- the other OwlThingpublic void delete()
public void deriveValues()
OwlClass.setDefinedValues()
method on this OwlThing's
OwlClasspublic java.util.Set<java.lang.String> getAlternateNames()
public OwlClass getOwlClass()
public java.util.Set<OwlThing> getRelated(java.lang.String relationName)
relationName
- the relationship namepublic java.util.Set<RdfTriple> getRelationships()
public java.util.Set<java.lang.String> getValues(java.lang.String propertyName)
propertyName
- the property namepublic void mergeThing(OwlThing owlThing)
owlThing
- the thing to mergepublic boolean refineClass(OwlClass newCls)
newCls
- the new class to refine this object intopublic void removeAllSameAs()
public void removeDatatypeValue(java.lang.String propName, java.lang.String value)
propName
- the property name. This should be the name of an
OwlDatatypeProperty. If null, this will match all properties.value
- the datatype value to removepublic void removeRelation(java.lang.String relationName, OwlThing relatedTo)
relationName
- the relationship name. This should be the name of an
OwlObjectProperty. If null, this will match all properties.relatedTo
- the OwlThing this thing is related topublic void removeRelations(java.lang.String relationName)
relationName
- the relationship name.public void removeSameAs(java.lang.String altName)
altName
- the alternate name for the objectpublic void setName(java.lang.String thingName)
public java.lang.String toString()
public boolean validate()
public static void addOwlThing(OwlThing thing)
thing
- the thing to addpublic static void clearDefined()
public static OwlThing createFromElement(org.w3c.dom.Element element)
element
- the OWL RDF element containing the OwlThing definitionpublic static OwlThing findOwlThing(java.lang.String name)
name
- the name of the OwlThingpublic static java.util.Set<java.lang.String> getAllThingNames()
public static java.util.Set<OwlThing> getAllThings()
public static OwlThing getOwlThing(java.lang.String name)
name
- the name of the OwlThingpublic static OwlThing getOwlThing(java.lang.String name, OwlClass owlClass)
name
- the name of the OwlThingowlClass
- the class of the OwlThingpublic static void removeOwlThing(OwlThing thing)
thing
- the OwlThing to removepublic static void replaceRefsToThing(OwlThing oldThing, OwlThing newThing)
oldThing
- the old thing to replacenewThing
- the new thing