|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibspan.tss.core.semantic.Memory
public class Memory
This class provides a set of methods for transparent operating on Jena memory-based model.
Examples say more then thousand of words:
Memory mem = new Memory();
Memory mem = new Memory(rdfString);
Memory mem = new Memory(someModel);
Memory mem = new Memory(someThing);
mem.addThing(otherThing);
String otherString = mem.dump();
OWLData data = mem.buildOWLData()
OntModel
,
Thing
,
OWLData
Field Summary | |
---|---|
static String |
DEFAULT_BASE_NS
Default base namespace URI. |
static String |
DEFAULT_LANG
Default serialization language. |
Constructor Summary | |
---|---|
Memory()
Creates Memory with empy model. |
|
Memory(OntModel model)
Creates Memory object with given model. |
|
Memory(OWLData data)
|
|
Memory(String rdf)
Creates Memory object with model with RDF statements
represented in language DEFAULT_LANG . |
|
Memory(String rdf,
String base)
Creates Memory object with model including RDF statements
represented in language DEFAULT_LANG . |
|
Memory(com.ibm.adtech.jastor.Thing thing)
|
|
Memory(com.ibm.adtech.jastor.Thing thing,
boolean asRoot)
Creates Memory object with model including resource of
given Thing. |
Method Summary | |
---|---|
void |
add(Memory mem)
|
void |
add(OntModel newModel)
|
void |
add(OWLData data)
|
Resource |
add(Resource r)
Creates a copy of given resource if it is not there |
void |
add(com.ibm.adtech.jastor.Thing thing)
Remembers thing in memory and registers it as one of the
roots. |
Resource |
addProperties(Resource root)
Recursive method which copy resource with all properties recursively into memory. |
void |
addRoot(com.ibm.adtech.jastor.Thing thing)
Remembers thing in memory and registers it as one of the
roots. |
OWLData |
buildOWLData()
Creates OWLData containing internal model of this Memory object. |
Resource |
createAnonResource()
Creates and returns anonymous resource in the memory. |
static OntModel |
createDefaultOntModel()
Answer a new ontology model which will process in-memory models of ontologies expressed the default ontology language (OWL). |
String |
dump()
Returns a serialized represention of the internal model in a language DEFAULT_LANG . |
OntModel |
getModel()
Returns internal model. |
protected static String |
model2rdf(OntModel model)
Returns a serialized represention of a model in a language DEFAULT_LANG |
protected static String |
model2rdf(OntModel model,
String lang)
Returns a serialized represention of a model in a language lang |
protected static String |
model2rdf(OntModel model,
String lang,
String base)
Returns a serialized represention of a model in a language DEFAULT_LANG |
protected static OntModel |
rdf2model(String rdf)
Add RDF statements represented in language DEFAULT_LANG to
the model. |
protected static OntModel |
rdf2model(String rdf,
String base)
Add RDF statements represented in language DEFAULT_LANG to
the model. |
protected static OntModel |
rdf2model(String rdf,
String base,
String lang)
Add RDF statements represented in language lang to the
model. |
void |
registerRoot(Resource root)
|
void |
registerRoot(com.ibm.adtech.jastor.Thing root)
|
void |
removeProperties(com.ibm.adtech.jastor.Thing root)
Recursive method which remove resource with all properties recursively from the memory. |
void |
removeThing(com.ibm.adtech.jastor.Thing thing)
Removes thing and related properties from memory. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_LANG
public static final String DEFAULT_BASE_NS
Constructor Detail |
---|
public Memory()
Memory
with empy model.
public Memory(String rdf)
Memory
object with model with RDF statements
represented in language DEFAULT_LANG
.
rdf
- the source input of the input serialization.DEFAULT_LANG
public Memory(String rdf, String base)
Memory
object with model including RDF statements
represented in language DEFAULT_LANG
.
rdf
- the source input of the input serialization.base
- the base uri to be used when converting relative URI's to
absolute URI's. The base URI may be null if there are no
relative URIs to convert. A base URI of "" may permit relative
URIs to be used in the model.public Memory(OntModel model)
Memory
object with given model.
model
- existing model.public Memory(com.ibm.adtech.jastor.Thing thing)
public Memory(com.ibm.adtech.jastor.Thing thing, boolean asRoot) throws AnonymousResourceException
Memory
object with model including resource of
given Thing.
model
- existing model.
AnonymousResourceException
public Memory(OWLData data)
data
- Method Detail |
---|
public void registerRoot(com.ibm.adtech.jastor.Thing root) throws AnonymousResourceException
AnonymousResourceException
public void registerRoot(Resource root) throws AnonymousResourceException
AnonymousResourceException
public void add(OWLData data)
public void add(Memory mem)
public OntModel getModel()
public void add(OntModel newModel)
public String dump()
DEFAULT_LANG
.
DEFAULT_LANG
public void add(com.ibm.adtech.jastor.Thing thing)
thing
in memory and registers it as one of the
roots.
More precisely, copies resource of thing
into internal
model.
thing
- given thing
AnonymousResourceException
public void addRoot(com.ibm.adtech.jastor.Thing thing) throws AnonymousResourceException
thing
in memory and registers it as one of the
roots.
More precisely, copies resource of thing
into internal
model.
thing
- given thing
AnonymousResourceException
public OWLData buildOWLData()
DEFAULT_LANG
and all
resources registered as roots will be added as values of
withRootURI
property of OWLData object.
public Resource add(Resource r)
r
- public Resource createAnonResource()
public static OntModel createDefaultOntModel()
protected static String model2rdf(OntModel model)
DEFAULT_LANG.
- Parameters:
model
- the source model of the output serialization.
- Returns:
- serialized representation
- See Also:
DEFAULT_LANG
protected static String model2rdf(OntModel model, String lang)
lang.
- Parameters:
model
- the source model of the output serialization.lang
- the language in which the RDF should be serialized
- Returns:
- serialized representation.
protected static String model2rdf(OntModel model, String lang, String base)
DEFAULT_LANG.
- Parameters:
model
- the source model of the output serialization.lang
- the language in which the RDF should be serializedbase
- the base uri for relative URI calculations; null means use only absolute URI's.
- Returns:
- serialized representation
protected static OntModel rdf2model(String rdf)
DEFAULT_LANG
to
the model.
rdf
- the source input of the input serialization.
DEFAULT_LANG
protected static OntModel rdf2model(String rdf, String base)
DEFAULT_LANG
to
the model.
rdf
- the source input of the input serialization.base
- the base uri to be used when converting relative URI's to
absolute URI's. The base URI may be DEFAULT_LANG
protected static OntModel rdf2model(String rdf, String base, String lang)
lang
to the
model.
rdf
- the source input of the input serialization.base
- the base uri to be used when converting relative URI's to
absolute URI's. The base URI may be lang
- the langauge of the serialization; null
selects
the default.
public Resource addProperties(Resource root)
r
- resource which properties should be added
public void removeProperties(com.ibm.adtech.jastor.Thing root)
root
- resource which properties should be removedpublic void removeThing(com.ibm.adtech.jastor.Thing thing) throws AnonymousResourceException
thing
- thing to be removed
AnonymousResourceException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |