|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.unidu.is.annotation.rework.ontology.JenaModel
JenaModel.java Extended Jena model with additional functions.
| Field Summary | |
protected java.lang.String |
DEFAULT_NAMESPACE
Default namespace of the ontology |
protected com.hp.hpl.jena.rdf.model.InfModel |
infModel
Inference model |
static int |
MEMORY
Memory model |
protected com.hp.hpl.jena.ontology.OntModel |
model
Ontology model |
protected java.lang.String |
namespace
Ontology namespace |
protected com.hp.hpl.jena.ontology.OntModelSpec |
ontModelSpec
ModelSpec |
static int |
PERSISTENT
Persistent model |
protected static java.lang.String |
REWORK
Namespace in owl file |
| Constructor Summary | |
JenaModel()
Creates a new instance without a model. |
|
JenaModel(int modelType)
Creates a new instance with the specified model. |
|
JenaModel(int modelType,
java.lang.String owlModel)
Creates a new instance with the specified model and imports the specified owl serialization. |
|
| Method Summary | |
void |
addAnnotation(JenaModel sourceModel,
java.lang.String annotationUri)
Adds the specified annotation to the model by creating a clone of the individual. |
void |
addAnnotations(JenaModel sourceModel,
java.util.List annotationUris)
Adds the specified annotations to the model by creating clones of the individuals. |
void |
addSubClass(java.lang.String parentUri,
java.lang.String classUri)
Adds the subclass classUri to the class parentUri |
protected void |
createMemoryModel()
Creates a memory model. |
void |
createModel(int modelType)
Creates a new Jena model. |
protected void |
createPersistentModel()
Creates a persistent model. |
void |
createTypesAsAnnotationTypes(java.util.List annotationtypes)
Declares the specified annotation types as instances of annotation |
java.lang.String |
getAllAnnotationsRdqlQuery(java.lang.String modelNamespace)
Returns a rdql query, that returns all annotations |
java.util.List |
getAllAnnotationUris()
Returns a list of all annotation URIs |
java.util.List |
getIndividualURIs(java.lang.String rdqlQuery)
Returns a list of all instances (URIs), which satisfy the query. |
java.lang.String |
getNamespace()
Returns the namespace of the ontology |
com.hp.hpl.jena.ontology.OntModel |
getOntModel()
Returns the Jena OntModel object. |
java.lang.String |
getOwlSerialization()
Serializes the model |
java.util.List |
getSubClasses(java.lang.String parentClassUri,
boolean direct)
Returns all subclass names of the class classname |
java.lang.String |
getUserNamespace(java.lang.String user)
Returns the user's namespace Example: http://rework.is.informatik.uni-duisburg.de/owl/Alan_Smith#"); |
void |
importOWLFile(java.lang.String owlFileUri)
Imports an OWL file. |
void |
importOwlSerialization(java.lang.String owlModel)
Imports an OWL serialization. |
protected void |
init()
Sets the namespace of the model. |
AnnotationIndividual |
loadAnnotationIndividual(java.lang.String annotationUri)
Returns a AnnotationIndiviual with the specified URI |
void |
setNamespace(java.lang.String namespace)
Sets a new namespace. |
void |
updateAnnotations(JenaModel sourceModel,
java.util.List annotationUris)
Updates all annotations, which are mentioned in the specified list |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int PERSISTENT
public static final int MEMORY
protected static final java.lang.String REWORK
protected com.hp.hpl.jena.ontology.OntModel model
protected final com.hp.hpl.jena.ontology.OntModelSpec ontModelSpec
protected com.hp.hpl.jena.rdf.model.InfModel infModel
protected java.lang.String namespace
protected final java.lang.String DEFAULT_NAMESPACE
| Constructor Detail |
public JenaModel()
createModel
public JenaModel(int modelType)
throws ModelException
modelType - Jena model type (JenaModel.PERSISTENT
or JenaModel.MEMORY)
ModelException - if an model error occurs
public JenaModel(int modelType,
java.lang.String owlModel)
throws ModelException
modelType - Model type (JenaModel.PERSISTENT
or JenaModel.MEMORY)owlModel - OWL serialization to import
ModelException - if an model error occurs| Method Detail |
protected void init()
throws ModelException
ModelException - if an model error occurspublic java.lang.String getNamespace()
public java.lang.String getUserNamespace(java.lang.String user)
throws java.lang.NullPointerException,
java.net.URISyntaxException
user - Username (without blank)
java.lang.NullPointerException - If user is null
java.net.URISyntaxException - If user name is invalid (as a part of an uri)
public void setNamespace(java.lang.String namespace)
throws java.net.URISyntaxException
namespace - New namespace
java.net.URISyntaxException - If namespace is not a valid URI
public com.hp.hpl.jena.ontology.OntModel getOntModel()
throws ModelException
ModelException - if an model error occurs
public void createModel(int modelType)
throws ModelException
modelType - Model type (JenaModel.PERSISTENT
or JenaModel.MEMORY)
ModelException - if an model error occurs
protected void createPersistentModel()
throws ModelException
ModelException - if an model error occursprotected void createMemoryModel()
public void importOwlSerialization(java.lang.String owlModel)
throws ModelException
owlModel - Serialized owl model
ModelException - if an model error occurs
public void importOWLFile(java.lang.String owlFileUri)
throws ModelException
owlFileUri - URI of the OWL file to import
ModelException - if an model error occurs
public java.lang.String getOwlSerialization()
throws ModelException
ModelException
public void addSubClass(java.lang.String parentUri,
java.lang.String classUri)
throws ModelException,
ResourceNotFoundException
classUri to the class parentUri
parentUri - Parent class of the new classclassUri - New subclass
ModelException - if an model error occurs
ResourceNotFoundException - if parent class does not exist
public java.util.List getSubClasses(java.lang.String parentClassUri,
boolean direct)
throws ModelException
classname
parentClassUri - URI of the classdirect - Only direct subclasses?
ModelException - if an model error occurs
public void createTypesAsAnnotationTypes(java.util.List annotationtypes)
throws ModelException
annotationtypes - List of annotation types (String without namespace)
ModelException - if a model error occurspublic java.util.List getIndividualURIs(java.lang.String rdqlQuery)
rdqlQuery - rdql Query
public void addAnnotation(JenaModel sourceModel,
java.lang.String annotationUri)
throws ModelException
sourceModel - JenaModel of the specified annotationannotationUri - URI of the annotation to add
ModelException - if a model error occurs
public void addAnnotations(JenaModel sourceModel,
java.util.List annotationUris)
throws ModelException
sourceModel - JenaModel of the specified annotation
ModelException - if a model error occurspublic AnnotationIndividual loadAnnotationIndividual(java.lang.String annotationUri)
annotationUri - URI of the annotation
AnnotationIndividual instancepublic java.lang.String getAllAnnotationsRdqlQuery(java.lang.String modelNamespace)
modelNamespace - Namespace
public java.util.List getAllAnnotationUris()
throws ModelException
ModelException - if a model exception occurs
public void updateAnnotations(JenaModel sourceModel,
java.util.List annotationUris)
throws ModelException
sourceModel - Model of the updated annotationsannotationUris - List of URIs of annotations
ModelException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||