org.topbraid.core.model
Class Restrictions

java.lang.Object
  extended by org.topbraid.core.model.Restrictions

public class Restrictions
extends java.lang.Object

Utility methods dealing with owl:Restrictions.

Author:
Holger Knublauch

Constructor Summary
Restrictions()
           
 
Method Summary
static void addRestrictedProperties(java.util.Set<com.hp.hpl.jena.rdf.model.Property> properties, com.hp.hpl.jena.rdf.model.Resource ontClass)
           
static void addRestrictions(java.util.Set<com.hp.hpl.jena.rdf.model.Resource> restrictions, com.hp.hpl.jena.rdf.model.Resource ontClass)
           
static com.hp.hpl.jena.rdf.model.Resource findRestriction(java.util.List ontClasses, IRDFNodeFilter filter)
           
static com.hp.hpl.jena.rdf.model.Resource findRestriction(com.hp.hpl.jena.rdf.model.Resource ontClass, IRDFNodeFilter filter)
          Starting at a given class, this method traverses the superclasses and equivalent classes until it finds an owl:Restriction that meets a given filter criteria.
static com.hp.hpl.jena.rdf.model.Resource findRestrictionForTypes(com.hp.hpl.jena.rdf.model.Resource subject, IRDFNodeFilter filter)
           
static java.util.Set<com.hp.hpl.jena.rdf.model.Property> getDirectRestrictedProperties(com.hp.hpl.jena.rdf.model.Resource ontClass)
           
static java.util.List<com.hp.hpl.jena.rdf.model.Resource> getDirectRestrictions(com.hp.hpl.jena.rdf.model.Resource ontClass)
           
static int getMaxCardinality(com.hp.hpl.jena.rdf.model.Resource ontClass, com.hp.hpl.jena.rdf.model.Resource property)
           
static int getMinCardinality(com.hp.hpl.jena.rdf.model.Resource ontClass, com.hp.hpl.jena.rdf.model.Resource property)
           
static java.util.Set getOnProperties(java.util.Iterator restrictions)
           
static com.hp.hpl.jena.rdf.model.Property getOnProperty(com.hp.hpl.jena.rdf.model.Resource restriction)
           
static java.util.Set<com.hp.hpl.jena.rdf.model.Property> getRestrictedProperties(com.hp.hpl.jena.rdf.model.Resource ontClass)
           
static java.util.Set<com.hp.hpl.jena.rdf.model.Resource> getRestrictions(com.hp.hpl.jena.rdf.model.Resource ontClass)
           
static java.util.Collection getRestrictionsByType(com.hp.hpl.jena.ontology.OntModel ontModel, com.hp.hpl.jena.rdf.model.Property systemProperty)
           
static boolean isRestriction(com.hp.hpl.jena.rdf.model.RDFNode node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Restrictions

public Restrictions()
Method Detail

addRestrictedProperties

public static void addRestrictedProperties(java.util.Set<com.hp.hpl.jena.rdf.model.Property> properties,
                                           com.hp.hpl.jena.rdf.model.Resource ontClass)

addRestrictions

public static void addRestrictions(java.util.Set<com.hp.hpl.jena.rdf.model.Resource> restrictions,
                                   com.hp.hpl.jena.rdf.model.Resource ontClass)

findRestriction

public static com.hp.hpl.jena.rdf.model.Resource findRestriction(com.hp.hpl.jena.rdf.model.Resource ontClass,
                                                                 IRDFNodeFilter filter)
Starting at a given class, this method traverses the superclasses and equivalent classes until it finds an owl:Restriction that meets a given filter criteria. The method also looks into intersection classes. The traversal is breadth-first.

Parameters:
ontClass - the class to start traversal at
filter - the filter that can assess if a restriction meets the condition (this filter is only called with Restriction instances)
Returns:
the first restriction that passed the filter with true, or null

findRestriction

public static com.hp.hpl.jena.rdf.model.Resource findRestriction(java.util.List ontClasses,
                                                                 IRDFNodeFilter filter)

findRestrictionForTypes

public static com.hp.hpl.jena.rdf.model.Resource findRestrictionForTypes(com.hp.hpl.jena.rdf.model.Resource subject,
                                                                         IRDFNodeFilter filter)

getDirectRestrictions

public static java.util.List<com.hp.hpl.jena.rdf.model.Resource> getDirectRestrictions(com.hp.hpl.jena.rdf.model.Resource ontClass)

getDirectRestrictedProperties

public static java.util.Set<com.hp.hpl.jena.rdf.model.Property> getDirectRestrictedProperties(com.hp.hpl.jena.rdf.model.Resource ontClass)

getOnProperty

public static com.hp.hpl.jena.rdf.model.Property getOnProperty(com.hp.hpl.jena.rdf.model.Resource restriction)

getOnProperties

public static java.util.Set getOnProperties(java.util.Iterator restrictions)

getRestrictionsByType

public static java.util.Collection getRestrictionsByType(com.hp.hpl.jena.ontology.OntModel ontModel,
                                                         com.hp.hpl.jena.rdf.model.Property systemProperty)

getMaxCardinality

public static int getMaxCardinality(com.hp.hpl.jena.rdf.model.Resource ontClass,
                                    com.hp.hpl.jena.rdf.model.Resource property)

getMinCardinality

public static int getMinCardinality(com.hp.hpl.jena.rdf.model.Resource ontClass,
                                    com.hp.hpl.jena.rdf.model.Resource property)

getRestrictedProperties

public static java.util.Set<com.hp.hpl.jena.rdf.model.Property> getRestrictedProperties(com.hp.hpl.jena.rdf.model.Resource ontClass)

getRestrictions

public static java.util.Set<com.hp.hpl.jena.rdf.model.Resource> getRestrictions(com.hp.hpl.jena.rdf.model.Resource ontClass)

isRestriction

public static boolean isRestriction(com.hp.hpl.jena.rdf.model.RDFNode node)