Interface Ontology

  • All Known Implementing Classes:
    OntologyImpl

    public interface Ontology
    • 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​(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.
      • 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:
      • getMaxDepthToLeaf

        int getMaxDepthToLeaf​(String root,
                              Set<String> relation)
      • 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
      • query

        org.apache.jena.query.ResultSet query​(String sparqlQuery,
                                              String queryVar,
                                              String queryUri)
        Parameters:
        sparqlQuery - SPARQL string that contains a variable named queryVar.
        queryVar - the name of the variable in sparqlQuery
        queryUri - the URI value to set for queryVar
        Returns:
        result set