|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectit.polito.elite.ontology.OntologyAbstraction
it.polito.elite.ontology.OWLOntologyWrapper
public class OWLOntologyWrapper
Field Summary | |
---|---|
private edu.stanford.smi.protegex.owl.model.OWLModel |
owlModel
|
private java.util.Hashtable<java.lang.String,RelationType> |
RelationsCache
|
Fields inherited from class it.polito.elite.ontology.OntologyAbstraction |
---|
log |
Constructor Summary | |
---|---|
OWLOntologyWrapper(edu.stanford.smi.protege.model.KnowledgeBase kb)
|
Method Summary | |
---|---|
void |
addAnnotationProperty(java.lang.String property,
boolean isObjectProperty)
|
boolean |
addAnnotationProperty4URI(java.lang.String uri,
java.lang.String property,
java.lang.Object value)
Adds an annotation property of type property, having object as value, referred to a given concept (OWL class) |
void |
addImport(java.lang.String URI)
|
void |
addNameSpace(java.lang.String prefix,
java.lang.String namespace)
|
boolean |
canQuery()
|
void |
confirmLogicViewSupport()
|
NodeTypeAbstraction |
createNodeTypeAbstraction(NodeTypesEnum t,
java.lang.String expression)
It is sufficient that it handles NamedClasses and NamedInstances |
java.util.HashSet<java.lang.String> |
getAllClasses(boolean listImportedClasses)
Returns all the classes (concepts) in a knowldge base |
java.util.HashSet<java.lang.String> |
getAllInstances()
A method for getting all the instances of a concept in the ontology (for a OWL model) |
java.util.Hashtable<java.lang.String,RelationType> |
getAllRelations(boolean listImported)
Lists all the slots declared in a protege knowledge base, excluding the imported slots if listImported is true. |
private java.util.Hashtable<java.lang.String,RelationType> |
getAllRelationsOWL(boolean listImported)
|
java.util.Hashtable<java.lang.String,java.lang.Object> |
getAnnotationProperties(java.lang.String resourceURI,
boolean isNamedClass)
A method that returns an hashtable containing all the annotations relative to the input class |
java.util.Hashtable<java.lang.String,java.util.HashSet<RelationData>> |
getDatatypeProperties(java.lang.String concept)
A method that, given the name of a concept, provides as result a Hastable containing the couples datatype property, xsd type for each datatype property which has the given concept as domain. |
java.util.Hashtable<java.lang.String,java.util.HashSet<NodeTypeAbstraction>> |
getInstancesDatatypeProperties(java.lang.String instance)
A method that, given the name of a concept, provides as result a Hastable containing the couples datatype property, value for each datatype property which has the given concept as domain. |
java.util.Hashtable<java.lang.String,java.util.HashSet<NodeTypeAbstraction>> |
getInstancesObjectProperties(java.lang.String instance)
Returns an Hashtable containing for each instance "linked" to the instance i, a Set of objectProperties that start from i and reach the "linked" instance (usually such set is composed by only one objectProperty). |
java.util.HashSet<java.lang.String> |
getInstancesOfConcept(java.lang.String concept)
A method for getting all the instances of a concept in the ontology (for a RDF/RDFS model) |
edu.stanford.smi.protegex.owl.model.OWLModel |
getModel()
|
int |
getNumberOfSubClasses(java.lang.String clsName)
A method that provides the number of direct subclasses for a given class (identified by its name) |
java.util.Hashtable<java.lang.String,java.util.HashSet<RelationData>> |
getObjectProperties(java.lang.String uri,
boolean direct,
boolean listImportedClass)
Give the uri of a class, returns an hashtable of relations starting from the class together with an Hashset of endnodes for each relations (relationUri, EndNodes) |
NodeTypeAbstraction |
getPropertyRange(java.lang.String propertyURI)
|
RelationType |
getRelationType(java.lang.String relURI)
A method that tells if a relation is towards a literal |
java.util.Hashtable<java.lang.String,java.util.HashSet<NodeTypeAbstraction>> |
getRestrictions(java.lang.String clsURI)
Retrieves restrictions specified for the concept identified by a given URI |
java.util.HashSet<java.lang.String> |
getRoots(boolean listImportedClasses)
Lists all the root classes of the ontology (leaved here for backward compatibility) |
java.util.HashSet<java.lang.String> |
getSubClasses(java.lang.String clsName)
A method for retrieving all the subclasses of a given class given its name |
java.util.HashSet<java.lang.String> |
getSuperClasses(java.lang.String clsName)
A method for retrieving all the superclasses of a given class given its name |
boolean |
hasInstances(java.lang.String concept)
A method for checking if a given concept c has some instances or not |
boolean |
isPrefixDefined(java.lang.String prefix)
|
boolean |
isURI_imported(java.lang.String URI)
|
java.util.HashSet<NodeTypeAbstraction> |
query(java.lang.String queryString,
QueryLanguageEnum lang,
int queryType)
|
boolean |
removeAnnotationProperty4URI(java.lang.String clsURI,
java.lang.String property,
java.lang.Object value)
Remove an annotation property of type property, having object as value, referred to a given concept (OWL class) |
void |
saveOntology(java.lang.String pathFname)
|
void |
setLogicalConstraints(java.lang.String clsURI,
ConceptData data)
Retrieves "logical" information about the concept and stores it in proper fields of the relative ConceptData: DifferentFrom, SameAs, Anonymous Superclasses (unions, intersections) |
void |
setLogicalConstraints(java.lang.String instanceURI,
InstanceData data)
Retrieves "logical" information about the concept and stores it in proper fields of the relative Instance Data |
Methods inherited from class it.polito.elite.ontology.OntologyAbstraction |
---|
createOntologyAbstraction, setLoggingLevel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private edu.stanford.smi.protegex.owl.model.OWLModel owlModel
private java.util.Hashtable<java.lang.String,RelationType> RelationsCache
Constructor Detail |
---|
public OWLOntologyWrapper(edu.stanford.smi.protege.model.KnowledgeBase kb)
Method Detail |
---|
public void addAnnotationProperty(java.lang.String property, boolean isObjectProperty)
public boolean addAnnotationProperty4URI(java.lang.String uri, java.lang.String property, java.lang.Object value)
addAnnotationProperty4URI
in class OntologyAbstraction
uri
- the URI of the conceptproperty
- The name of the annotation property we want to addvalue
- The value of the annotation
public void addImport(java.lang.String URI)
public void addNameSpace(java.lang.String prefix, java.lang.String namespace)
public boolean canQuery()
canQuery
in class OntologyAbstraction
public void confirmLogicViewSupport()
confirmLogicViewSupport
in class OntologyAbstraction
public NodeTypeAbstraction createNodeTypeAbstraction(NodeTypesEnum t, java.lang.String expression)
OntologyAbstraction
createNodeTypeAbstraction
in class OntologyAbstraction
t
- typeexpression
- the expression (at now the URI of concept/individual)
public java.util.HashSet<java.lang.String> getAllClasses(boolean listImportedClasses)
getAllClasses
in class OntologyAbstraction
listImportedClasses
- true if also imported classes should be shown
public java.util.HashSet<java.lang.String> getAllInstances()
getAllInstances
in class OntologyAbstraction
public java.util.Hashtable<java.lang.String,RelationType> getAllRelations(boolean listImported)
getAllRelations
in class OntologyAbstraction
listImported
- true if slots coming from imported classes shall be shown
private java.util.Hashtable<java.lang.String,RelationType> getAllRelationsOWL(boolean listImported)
public java.util.Hashtable<java.lang.String,java.lang.Object> getAnnotationProperties(java.lang.String resourceURI, boolean isNamedClass)
getAnnotationProperties
in class OntologyAbstraction
resourceURI
- the class or propery we want to extract annotation properties from
public java.util.Hashtable<java.lang.String,java.util.HashSet<RelationData>> getDatatypeProperties(java.lang.String concept)
getDatatypeProperties
in class OntologyAbstraction
concept
-
public java.util.Hashtable<java.lang.String,java.util.HashSet<NodeTypeAbstraction>> getInstancesDatatypeProperties(java.lang.String instance)
getInstancesDatatypeProperties
in class OntologyAbstraction
instance
- The instance URI
public java.util.Hashtable<java.lang.String,java.util.HashSet<NodeTypeAbstraction>> getInstancesObjectProperties(java.lang.String instance)
getInstancesObjectProperties
in class OntologyAbstraction
instance
- the instance i
public java.util.HashSet<java.lang.String> getInstancesOfConcept(java.lang.String concept)
OntologyAbstraction
getInstancesOfConcept
in class OntologyAbstraction
concept
- The concept URI
public edu.stanford.smi.protegex.owl.model.OWLModel getModel()
public int getNumberOfSubClasses(java.lang.String clsName)
getNumberOfSubClasses
in class OntologyAbstraction
clsName
- the name of the class
public java.util.Hashtable<java.lang.String,java.util.HashSet<RelationData>> getObjectProperties(java.lang.String uri, boolean direct, boolean listImportedClass)
getObjectProperties
in class OntologyAbstraction
uri
- the uri of the starting classdirect
- --direct relations only (currently ignored)listImportedClass
- --
show system classes or not (to be deprecated)
public NodeTypeAbstraction getPropertyRange(java.lang.String propertyURI)
getPropertyRange
in class OntologyAbstraction
public RelationType getRelationType(java.lang.String relURI)
OntologyAbstraction
getRelationType
in class OntologyAbstraction
public java.util.Hashtable<java.lang.String,java.util.HashSet<NodeTypeAbstraction>> getRestrictions(java.lang.String clsURI)
OntologyAbstraction
getRestrictions
in class OntologyAbstraction
clsURI
- The URI of the concept
public java.util.HashSet<java.lang.String> getRoots(boolean listImportedClasses)
getRoots
in class OntologyAbstraction
listImportedClasses
- true if also imported classes should be shown
public java.util.HashSet<java.lang.String> getSubClasses(java.lang.String clsName)
getSubClasses
in class OntologyAbstraction
clsName
- the class name
public java.util.HashSet<java.lang.String> getSuperClasses(java.lang.String clsName)
getSuperClasses
in class OntologyAbstraction
clsName
- the class name
public boolean hasInstances(java.lang.String concept)
hasInstances
in class OntologyAbstraction
concept
- the concept for which instances might exist
public boolean isPrefixDefined(java.lang.String prefix)
public boolean isURI_imported(java.lang.String URI)
public java.util.HashSet<NodeTypeAbstraction> query(java.lang.String queryString, QueryLanguageEnum lang, int queryType)
public boolean removeAnnotationProperty4URI(java.lang.String clsURI, java.lang.String property, java.lang.Object value)
removeAnnotationProperty4URI
in class OntologyAbstraction
clsURI
- the URI of the concept or the object property with the annotationproperty
- The name of the annotation property we want to removevalue
- The value of the annotation
public void saveOntology(java.lang.String pathFname)
public void setLogicalConstraints(java.lang.String clsURI, ConceptData data)
setLogicalConstraints
in class OntologyAbstraction
clsURI
- the concept class namedata
- the concept datapublic void setLogicalConstraints(java.lang.String instanceURI, InstanceData data)
setLogicalConstraints
in class OntologyAbstraction
instanceURI
- the instance namedata
- the instance data
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |