Class RelationshipChecker
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.auth.policy.specialrelationships.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.
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringNS_COREprotected static StringNS_OBOprotected static StringURI_INHERES_INprotected static StringURI_REALIZESprotected static StringURI_RELATED_BYprotected static StringURI_RELATES
-
Constructor Summary
Constructors Constructor Description RelationshipChecker(org.apache.jena.ontology.OntModel ontModel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleananyUrisInCommon(List<String> list1, List<String> list2)Are there any URIs that appear in both of these lists?protected PolicyDecisionauthorizedDecision(String message)An AUTHORIZED decision with a message like "PolicyClass: message".org.apache.jena.rdf.model.SelectorcreateSelector(String subjectUri, String predicateUri, String objectUri)org.apache.jena.rdf.model.SelectorcreateSelector(org.apache.jena.rdf.model.Resource subject, String predicateUri, String objectUri)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.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.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.booleanisResourceOfType(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>
-
-
-
Field Detail
-
NS_CORE
protected static final String NS_CORE
- See Also:
- Constant Field Values
-
NS_OBO
protected static final String NS_OBO
- See Also:
- Constant Field Values
-
URI_RELATES
protected static final String URI_RELATES
- See Also:
- Constant Field Values
-
URI_RELATED_BY
protected static final String URI_RELATED_BY
- See Also:
- Constant Field Values
-
URI_INHERES_IN
protected static final String URI_INHERES_IN
- See Also:
- Constant Field Values
-
URI_REALIZES
protected static final String URI_REALIZES
- See Also:
- Constant Field Values
-
-
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".
-
-