public class ReactorBaseImpl extends Object implements ReactorBase
Modifier and Type | Field and Description |
---|---|
protected URI |
classURI
the URI of the RDFS class from which this object is an instance
|
protected Model |
model
the underlying RDF2Go model in which the triples representing the
properties of this object are saved
|
Constructor and Description |
---|
ReactorBaseImpl(Model model,
URI classURI,
Resource instanceIdentifier)
Constructor: create a ReactorBaseImpl for the RDFS/OWL schema class
identified by classURI, with instanceIdentifier as the identifing URL or
BlankNode.
|
ReactorBaseImpl(Model model,
URI classURI,
Resource instanceIdentifier,
boolean write)
Constructor: create a ReactorBaseImpl for the RDFS/OWL schema class
identified by classURI, with instanceIdentifier as the identifing URL or
BlankNode.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(URI property,
Object object)
Adds a statement (this, prop, o).
|
boolean |
add(URI property,
Object object,
int maxCard)
Adds a statement (this, prop, o) if the number of statements matching
(this, prop, x) is less then maxCard
|
Object |
castTo(Class<?> targetType)
Cast .this object to the given target Java type.
|
void |
delete()
Delete all statements of the form (this, *,*)
|
boolean |
equals(Object other)
implement
|
Object |
get(URI prop,
Class<?> returnType)
Returns the first x in (this, prop, x) if such a statement is in the
model.
|
Set<Object> |
getAll_AsSet(URI prop,
Class<?> returnType)
Get all values for the given property of this resource instance as a Set.
|
Object[] |
getAll_Inverse(URI property,
Node o,
Class<?> returnType)
Get all resources having the given property and value.
|
Object[] |
getAll(URI prop,
Class<?> returnType)
Returns an array of x with (this, prop, x) if such statements are in the
model.
|
static Object[] |
getAllInstances(Model model,
Class<?> javaClass)
Return all instances of the given class.
|
static Iterator<?> |
getAllInstancesAsIterator(Model model,
Class javaClass,
URI classURI)
Return all instances of the given class as a SubjectResultIterator
object.
|
static Object |
getInstance(Model model,
URI uri,
Class<?> javaClass) |
Model |
getModel() |
URI |
getRDFSClassURI() |
Resource |
getResource()
implements
|
int |
hashCode()
implement
|
static boolean |
hasInstance(Model model,
URI uri,
URI classURI) |
boolean |
hasValue(URI prop) |
boolean |
hasValue(URI prop,
Object value) |
boolean |
in(Model model) |
boolean |
isInstanceof(Class<?> javaClass)
Deprecated.
|
boolean |
isInstanceof(URI classURI)
Check if .this object is an instance of the given RDFS/OWL class URI.
|
boolean |
remove(URI prop,
Object o)
Tries to remove a statement (this, prop, o).
|
boolean |
remove(URI prop,
Object o,
int minCard)
Tries to remove a statement (this, prop, o) if the number of statements
matching (this, prop, x) in the model is less then minCard
|
boolean |
removeAll(URI prop)
remove all (this, rdf:type, prop) statements
|
void |
set(URI prop,
Object o)
Removes all statements (this, prop, x) and set one anew: (this, prop, o).
|
void |
setAll(URI prop,
Object[] o)
Removes all statements (this, prop, x) and sets anew: (this, prop, o[0]),
(this, prop, o[1]), ...
|
void |
setAll(URI prop,
Object[] o,
int maxCard)
Removes all statements (this, prop, x) and sets anew: (this, prop, o[0]),
(this, prop, o[1]), ...
|
String |
toString()
implement
|
boolean |
update(URI prop,
Object oldValue,
Object newValue)
Looks for a statement (this, prop, oldValue) and replaces it by a new
statement (this, prop, newValue).
|
protected Model model
protected URI classURI
public ReactorBaseImpl(Model model, URI classURI, Resource instanceIdentifier, boolean write)
model,
- the underlying RDF2Go modelclassURI,
- URI of the RDFS/OWL class from which this object is an
instanceinstanceIdentifier,
- has to be an URI or URL or BlankNodewrite
- if true, the triple (this, rdf:type, classURI) is written to
the model (in addition to any other triples denoting
properties of the instance)public ReactorBaseImpl(Model model, URI classURI, Resource instanceIdentifier)
model,
- the underlying RDF2Go modelclassURI,
- URI of the RDFS/OWL class from which this object is an
instanceinstanceIdentifier,
- has to be an URI or URL or BlankNodepublic Resource getResource()
getResource
in interface ResourceEntity
ReactorEntity
public URI getRDFSClassURI()
getRDFSClassURI
in interface ReactorBase
public boolean equals(Object other)
public String toString()
public static Object getInstance(Model model, URI uri, Class<?> javaClass) throws Exception
Exception
public static Iterator<?> getAllInstancesAsIterator(Model model, Class javaClass, URI classURI)
model
- -
underlying RDF2Go modeljavaClass
- -
the java class representing the class the instances which
should be returnedclassURI
- -
URI of the (RDFS/OWL) class. currently not usedpublic static Object[] getAllInstances(Model model, Class<?> javaClass)
model
- -
underlying RDF2Go modeljavaClass
- -
the java class representing the class the instances which
should be returnedpublic boolean isInstanceof(URI classURI) throws ModelRuntimeException
isInstanceof
in interface ReactorBase
classURI
- -
URI of the RDFS/OWL classModelRuntimeException
@Deprecated public boolean isInstanceof(Class<?> javaClass) throws ModelRuntimeException
isInstanceof
in interface ReactorBase
javaClass
- -
given Java classModelRuntimeException
public Object castTo(Class<?> targetType)
castTo
in interface ReactorBase
targetType
- -
Java type to which to cast this objectpublic Object get(URI prop, Class<?> returnType) throws RDFDataException
get
in interface ReactorBase
prop
- -
URI of the propertyreturnType
- -
desired Java return typeRDFDataException
public Object[] getAll(URI prop, Class<?> returnType)
getAll
in interface ReactorBase
prop
- -
URI of the propertyreturnType
- -
desired Java return typepublic Object[] getAll_Inverse(URI property, Node o, Class<?> returnType)
property
- -
URI of the propertyo
- -
value of the propertyreturnType
- -
desired Java return typepublic Set<Object> getAll_AsSet(URI prop, Class<?> returnType)
prop
- -
URI of the propertyreturnType
- -
desired Java return typepublic void set(URI prop, Object o)
set
in interface ReactorBase
prop
- -
URI of the propertyo
- -
new value for the propertypublic void setAll(URI prop, Object[] o) throws ModelRuntimeException
setAll
in interface ReactorBase
prop
- -
URI of the propertyo
- -
array of new values for the propertyModelRuntimeException
public void setAll(URI prop, Object[] o, int maxCard) throws ModelRuntimeException, CardinalityException
setAll
in interface ReactorBase
prop
- -
URI of the propertyo
- -
array of new values of the propertymaxCard
- -
the maximum number of triples allowed to match (this, prop, x)CardinalityException
CardinalityException
- if the size of o[] is larger then maxCardModelRuntimeException
public boolean update(URI prop, Object oldValue, Object newValue)
update
in interface ReactorBase
prop
- -
URI of the propertyoldValue
- -
old value of the propertynewValue
- -
new value of the propertypublic boolean hasValue(URI prop, Object value)
prop
- value
- public boolean hasValue(URI prop)
prop
- public boolean add(URI property, Object object)
add
in interface ReactorBase
property
- -
URI of the propertyobject
- -
value of the propertypublic boolean add(URI property, Object object, int maxCard) throws CardinalityException
add
in interface ReactorBase
property
- -
URI of the propertyobject
- -
value of the propertymaxCard
- -
number of occurences of (this, prop, x) allowed in the modelCardinalityException
- if the resource already has more then maxCard values for the
propertypublic boolean remove(URI prop, Object o)
remove
in interface ReactorBase
prop
- -
URI of the propertyo
- -
value of the propertypublic boolean remove(URI prop, Object o, int minCard) throws CardinalityException
remove
in interface ReactorBase
prop
- -
URI of the propertyo
- -
value of the propertyminCard
- -
number of occurences of (this, prop, x) needed in the modelCardinalityException
- if resource has less then minCard values for the propertypublic boolean removeAll(URI prop)
removeAll
in interface ReactorBase
prop,
- Object of a Triplepublic Model getModel()
getModel
in interface ReactorBase
public void delete()
delete
in interface ReactorBase
public boolean in(Model model)
in
in interface ReactorBase
model
- and RDG2GO modelCopyright © 2005–2017 IT-Consulting Dr. Max V?lkel | Project started at FZI Forschungszentrum Informatik, www.fzi.de. All rights reserved.