org.topbraid.core.model
Class Domains

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

public class Domains
extends java.lang.Object

Utility methods dealing with properties.

Author:
Holger Knublauch

Constructor Summary
Domains()
           
 
Method Summary
static java.util.List<com.hp.hpl.jena.rdf.model.Property> getRelevantProperties(com.hp.hpl.jena.rdf.model.Resource subject)
           
static java.util.List<com.hp.hpl.jena.rdf.model.Property> getRelevantProperties(com.hp.hpl.jena.rdf.model.Resource subject, java.util.Set types)
           
static java.util.Set getUnionDomainClasses(com.hp.hpl.jena.rdf.model.Property property)
           
static java.util.Set<com.hp.hpl.jena.rdf.model.Property> getUnionDomainProperties(com.hp.hpl.jena.rdf.model.Resource cls)
          Gets all properties that have a given class in their (direct) union domain.
static boolean hasMatchingDomain(com.hp.hpl.jena.rdf.model.Property property, com.hp.hpl.jena.rdf.model.Resource subject)
          Checks if a property has a domain statement that matches one of the types of a given resource.
static boolean hasMatchingDomain(com.hp.hpl.jena.rdf.model.Property property, com.hp.hpl.jena.rdf.model.Resource subject, java.util.Collection matchCache)
           
static boolean isDomainless(com.hp.hpl.jena.rdf.model.Resource property)
          Checks whether a property is domainless.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Domains

public Domains()
Method Detail

getRelevantProperties

public static java.util.List<com.hp.hpl.jena.rdf.model.Property> getRelevantProperties(com.hp.hpl.jena.rdf.model.Resource subject)

getRelevantProperties

public static java.util.List<com.hp.hpl.jena.rdf.model.Property> getRelevantProperties(com.hp.hpl.jena.rdf.model.Resource subject,
                                                                                       java.util.Set types)

getUnionDomainClasses

public static java.util.Set getUnionDomainClasses(com.hp.hpl.jena.rdf.model.Property property)

getUnionDomainProperties

public static java.util.Set<com.hp.hpl.jena.rdf.model.Property> getUnionDomainProperties(com.hp.hpl.jena.rdf.model.Resource cls)
Gets all properties that have a given class in their (direct) union domain.

Parameters:
cls - the class to get the properties for
Returns:
a Set of Properties

hasMatchingDomain

public static boolean hasMatchingDomain(com.hp.hpl.jena.rdf.model.Property property,
                                        com.hp.hpl.jena.rdf.model.Resource subject)
Checks if a property has a domain statement that matches one of the types of a given resource.

Parameters:
property - the property to analyze the domain of
subject - the resource that is expected to have a type from the domain
Returns:
true if the property has a matching domain

hasMatchingDomain

public static boolean hasMatchingDomain(com.hp.hpl.jena.rdf.model.Property property,
                                        com.hp.hpl.jena.rdf.model.Resource subject,
                                        java.util.Collection matchCache)

isDomainless

public static boolean isDomainless(com.hp.hpl.jena.rdf.model.Resource property)
Checks whether a property is domainless. A property counts as domainless if it either has no rdfs:domain statement attached, or only rdfs:Resource as its domain (this is common for some system properties).

Parameters:
property - the property to check the domain of
Returns:
true if property is domainless according to the definition above