Interface Ontology
- All Known Implementing Classes:
OntologyImpl
public interface Ontology
-
Method Summary
Modifier and TypeMethodDescriptionint
Calculate the depth of an entity from the root.int
calculateDepthOfResource
(URIObject res, String root, Set<String> relations) int
calculateDepthOfResource
(org.apache.jena.rdf.model.Resource res) int
calculateDepthOfResource
(org.apache.jena.rdf.model.Resource res, String root) int
calculateDepthOfResource
(org.apache.jena.rdf.model.Resource res, String root, Set<String> relations) int
calculateDepthOfResource
(org.apache.jena.rdf.model.Resource res, org.apache.jena.rdf.model.Resource root) boolean
Check for the existence of the resource in the underlying ontology.boolean
Check for the existence of the resource in the underlying ontology.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) Recursively collects all parents of the given node connected by minimally one relation in the given set of relations.Determine the LCA (Least Common Ancestor) of to concepts.org.apache.jena.rdf.model.Resource
Determine the LCA (Least Common Ancestor) of to concepts.int
getMaxDepthToLeaf
(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.Property
getProperty
(String propertyURI) Fetches the Property object with the given URI from the underlying Jena ontology model.org.apache.jena.rdf.model.Resource
getResource
(URIObject resourceURIObject) Fetches the Resource object with the given URI from the underlying Jena ontology model.org.apache.jena.rdf.model.Resource
getResource
(String resourceURI) Fetches the Resource object with the given URI from the underlying Jena ontology model.int
getShortestPathLength
(URIObject res, URIObject des, String propName) Calculate the shortest path from on entity to another over a specific relation.int
getShortestPathLength
(URIObject source, URIObject destination, Set<String> relations) boolean
isIndividual
(URIObject res) Check whether entity is an Individual.boolean
isIndividual
(org.apache.jena.rdf.model.Resource res) Check whether entity is an Individual.boolean
isSubClassOfProperty
(String relation) Check whether the given relation is a rdfs subclass property.boolean
isTypeProperty
(String relation) Check whether the given relation is a rdf type property.org.apache.jena.query.ResultSet
org.apache.jena.query.ResultSet
-
Method Details
-
isIndividual
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
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
-
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
Calculate the depth of an entity from the root.- Parameters:
res
- the entity.- Returns:
- the depth of the entity from the root.
-
calculateDepthOfResource
-
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
-
calculateDepthOfResource
-
getShortestPathLength
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
-
getAllChildrenForNode
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
- 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:
-
getMaxDepthToLeaf
-
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
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
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
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
Check whether the given relation is a rdfs subclass property. -
isTypeProperty
Check whether the given relation is a rdf type property. -
getResource
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
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
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
- Parameters:
sparqlQuery
- SPARQL string- Returns:
- result set
-
query
- Parameters:
sparqlQuery
- SPARQL string that contains a variable named queryVar.queryVar
- the name of the variable in sparqlQueryqueryUri
- the URI value to set for queryVar- Returns:
- result set
-