Interface Ontology
-
- All Known Implementing Classes:
OntologyImpl
public interface Ontology
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intcalculateDepthOfResource(URIObject res)Calculate the depth of an entity from the root.intcalculateDepthOfResource(URIObject res, String root, Set<String> relations)intcalculateDepthOfResource(org.apache.jena.rdf.model.Resource res)intcalculateDepthOfResource(org.apache.jena.rdf.model.Resource res, String root)intcalculateDepthOfResource(org.apache.jena.rdf.model.Resource res, String root, Set<String> relations)intcalculateDepthOfResource(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Resource root)booleancontains(URIObject resourceURIobject)Check for the existence of the resource in the underlying ontology.booleancontains(String resourceURI)Check for the existence of the resource in the underlying ontology.Set<String>getAllChildrenForNode(String rootNode, Set<String> relation)Recursively collects all children for a given node which are connected via the given relation.Set<org.apache.jena.rdf.model.Statement>getAllPropertiesOfNode(String nodeURI)Set<String>getAncestors(URIObject res, Set<String> relations, Predicate<String> isValidTreeValuePredicate)Recursively collects all parents of the given node connected by minimally one relation in the given set of relations.URIObjectgetLCA(URIObject queryRes, URIObject caseRes)Determine the LCA (Least Common Ancestor) of to concepts.URIObjectgetLCA(URIObject queryRes, URIObject caseRes, Set<String> relations)org.apache.jena.rdf.model.ResourcegetLCA(String queryRes, String caseRes, String root, Set<String> relations)Determine the LCA (Least Common Ancestor) of to concepts.intgetMaxDepthToLeaf(String root, Set<String> relation)List<org.apache.jena.rdf.model.RDFNode>getObjectsOfProperty(URIObject resourceURIObject, String property)Examine the given resource for the given property and collect its objects.List<org.apache.jena.rdf.model.RDFNode>getObjectsOfProperty(String resourceURI, String property)Examine the given resource for the given property and collect its objects.List<org.apache.jena.rdf.model.RDFNode>getObjectsOfProperty(org.apache.jena.rdf.model.Resource resource, String property)Examine the given resource for the given property and collect its objects.org.apache.jena.rdf.model.PropertygetProperty(String propertyURI)Fetches the Property object with the given URI from the underlying Jena ontology model.org.apache.jena.rdf.model.ResourcegetResource(URIObject resourceURIObject)Fetches the Resource object with the given URI from the underlying Jena ontology model.org.apache.jena.rdf.model.ResourcegetResource(String resourceURI)Fetches the Resource object with the given URI from the underlying Jena ontology model.intgetShortestPathLength(URIObject res, URIObject des, String propName)Calculate the shortest path from on entity to another over a specific relation.intgetShortestPathLength(URIObject source, URIObject destination, Set<String> relations)booleanisIndividual(URIObject res)Check whether entity is an Individual.booleanisIndividual(org.apache.jena.rdf.model.Resource res)Check whether entity is an Individual.booleanisSubClassOfProperty(String relation)Check whether the given relation is a rdfs subclass property.booleanisTypeProperty(String relation)Check whether the given relation is a rdf type property.org.apache.jena.query.ResultSetquery(String sparqlQuery)org.apache.jena.query.ResultSetquery(String sparqlQuery, String queryVar, String queryUri)
-
-
-
Method Detail
-
isIndividual
boolean isIndividual(URIObject res)
Check whether entity is an Individual.- Parameters:
res- the entity.- Returns:
- whether it is an Individual.
-
isIndividual
boolean isIndividual(org.apache.jena.rdf.model.Resource res)
Check whether entity is an Individual.- Parameters:
res- the entity.- Returns:
- whether it is an Individual.
-
getLCA
URIObject getLCA(URIObject queryRes, URIObject caseRes)
Determine the LCA (Least Common Ancestor) of to concepts.- Parameters:
queryRes- the first Entity.caseRes- the second Entity.- Returns:
- the entity of the LCA.
-
getLCA
org.apache.jena.rdf.model.Resource getLCA(String queryRes, String caseRes, String root, Set<String> relations)
Determine the LCA (Least Common Ancestor) of to concepts.- Parameters:
queryRes- the first Entity.caseRes- the second Entity.- Returns:
- the entity of the LCA.
-
calculateDepthOfResource
int calculateDepthOfResource(URIObject res)
Calculate the depth of an entity from the root.- Parameters:
res- the entity.- Returns:
- the depth of the entity from the root.
-
calculateDepthOfResource
int calculateDepthOfResource(URIObject res, String root, Set<String> relations)
-
calculateDepthOfResource
int calculateDepthOfResource(org.apache.jena.rdf.model.Resource res)
-
calculateDepthOfResource
int calculateDepthOfResource(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Resource root)
-
calculateDepthOfResource
int calculateDepthOfResource(org.apache.jena.rdf.model.Resource res, String root)
-
calculateDepthOfResource
int calculateDepthOfResource(org.apache.jena.rdf.model.Resource res, String root, Set<String> relations)
-
getShortestPathLength
int getShortestPathLength(URIObject res, URIObject des, String propName)
Calculate the shortest path from on entity to another over a specific relation.- Parameters:
res- the first entity.des- the second entity.propName- the specific relation.- Returns:
- the length of the shortest path.
-
getShortestPathLength
int getShortestPathLength(URIObject source, URIObject destination, Set<String> relations)
-
getAllChildrenForNode
Set<String> getAllChildrenForNode(String rootNode, Set<String> relation)
Recursively collects all children for a given node which are connected via the given relation.- Parameters:
rootNode- the node whose children should be collected.relation- the relation that is considered during the search.- Returns:
- a set of all children.
-
getAllPropertiesOfNode
Set<org.apache.jena.rdf.model.Statement> getAllPropertiesOfNode(String nodeURI)
- Parameters:
nodeURI- node whose properties should be collected- Returns:
- set of all properties
-
getAncestors
Set<String> getAncestors(URIObject res, Set<String> relations, Predicate<String> isValidTreeValuePredicate)
Recursively collects all parents of the given node connected by minimally one relation in the given set of relations. Is the given node an individual, the classes of the individuals are determined and their parents are collected- Parameters:
res-relations-isValidTreeValuePredicate-- Returns:
-
getObjectsOfProperty
List<org.apache.jena.rdf.model.RDFNode> getObjectsOfProperty(org.apache.jena.rdf.model.Resource resource, String property)
Examine the given resource for the given property and collect its objects.- Parameters:
resource- the resource that will be examined.property- the property that will be looked for.- Returns:
- a list of all nodes representing the object of the predicate that is represented by the given property.
-
getObjectsOfProperty
List<org.apache.jena.rdf.model.RDFNode> getObjectsOfProperty(String resourceURI, String property)
Examine the given resource for the given property and collect its objects.- Parameters:
resourceURI- the resource that will be examined.property- the property that will be looked for.- Returns:
- a list of all nodes representing the object of the predicate that is represented by the given property.
-
getObjectsOfProperty
List<org.apache.jena.rdf.model.RDFNode> getObjectsOfProperty(URIObject resourceURIObject, String property)
Examine the given resource for the given property and collect its objects.- Parameters:
resourceURIObject- the resource that will be examined.property- the property that will be looked for.- Returns:
- a list of all nodes representing the object of the predicate that is represented by the given property.
-
contains
boolean contains(URIObject resourceURIobject)
Check for the existence of the resource in the underlying ontology.- Parameters:
resourceURIobject- the resource that will be examined.- Returns:
- whether the given resource exists in the underlying ontology.
-
contains
boolean contains(String resourceURI)
Check for the existence of the resource in the underlying ontology.- Parameters:
resourceURI- the resource that will be examined.- Returns:
- whether the given resource exists in the underlying ontology.
-
isSubClassOfProperty
boolean isSubClassOfProperty(String relation)
Check whether the given relation is a rdfs subclass property.
-
isTypeProperty
boolean isTypeProperty(String relation)
Check whether the given relation is a rdf type property.
-
getResource
org.apache.jena.rdf.model.Resource getResource(URIObject resourceURIObject)
Fetches the Resource object with the given URI from the underlying Jena ontology model.- Parameters:
resourceURIObject- the URI for which the Resource object should be fetched.- Returns:
- the desired Resource object.
-
getResource
org.apache.jena.rdf.model.Resource getResource(String resourceURI)
Fetches the Resource object with the given URI from the underlying Jena ontology model.- Parameters:
resourceURI- the URI for which the Resource object should be fetched.- Returns:
- the desired Resource object.
-
getProperty
org.apache.jena.rdf.model.Property getProperty(String propertyURI)
Fetches the Property object with the given URI from the underlying Jena ontology model.- Parameters:
propertyURI- the URI for which the Property object should be fetched.- Returns:
- the desired Property object.
-
query
org.apache.jena.query.ResultSet query(String sparqlQuery)
- Parameters:
sparqlQuery- SPARQL string- Returns:
- result set
-
-