Class RelationshipChecker


  • public class RelationshipChecker
    extends Object
    Look for relationships within an OntModel. Types of resources, links between resources, and links between resources via a context node. Also provides some convenience methods for test lists of URIs and for creating PolicyDecisions.
    • Constructor Detail

      • RelationshipChecker

        public RelationshipChecker​(org.apache.jena.ontology.OntModel ontModel)
    • Method Detail

      • anyUrisInCommon

        public boolean anyUrisInCommon​(List<String> list1,
                                       List<String> list2)
        Are there any URIs that appear in both of these lists?
      • isResourceOfType

        public boolean isResourceOfType​(String resourceUri,
                                        String typeUri)
        Is this resource a member of this type? That is, is there an statement of the form: <resourceUri> rdfs:type <typeUri>
      • getObjectsOfProperty

        public List<String> getObjectsOfProperty​(String resourceUri,
                                                 String propertyUri)
        Get a list of the object URIs that satisfy this statement: <resourceUri> <propertyUri> <objectUri> May return an empty list, but never returns null.
      • getObjectsOfLinkedProperty

        public List<String> getObjectsOfLinkedProperty​(String resourceUri,
                                                       String linkUri,
                                                       String propertyUri)
        Get a list of the object URIs that satisfy these statements: <resourceUri> <linkUri> <contextNodeUri> <contextNodeUri> <propertyUri> <objectUri> May return an empty list, but never returns null.
      • getObjectsThroughLinkingNode

        public List<String> getObjectsThroughLinkingNode​(String resourceUri,
                                                         String property1Uri,
                                                         String linkNodeTypeUri,
                                                         String property2Uri)
        Get a list of URIs for object that link to the specified resource, by means of the specified properties, through a linking node of the specified type. So we're looking for object URIs that statisfy these statements: <resourceUri> <property1Uri> <linkNodeUri> <linkNodeUri> rdfs:type <linkNodeTypeUri> <linkNodeUri> <property2Uri> <objectUri>
      • createSelector

        public org.apache.jena.rdf.model.Selector createSelector​(String subjectUri,
                                                                 String predicateUri,
                                                                 String objectUri)
      • createSelector

        public org.apache.jena.rdf.model.Selector createSelector​(org.apache.jena.rdf.model.Resource subject,
                                                                 String predicateUri,
                                                                 String objectUri)
      • authorizedDecision

        protected PolicyDecision authorizedDecision​(String message)
        An AUTHORIZED decision with a message like "PolicyClass: message".