org.openrdf.sesame.sailimpl.omm.security
Class PatternRestriction

java.lang.Object
  extended byorg.openrdf.sesame.sailimpl.omm.security.Restriction
      extended byorg.openrdf.sesame.sailimpl.omm.security.PatternRestriction

public class PatternRestriction
extends Restriction

PatternRestriction.java

Title: Knowledge Control System

Company: OntoText Lab. Sirma AI.

Version:
1.0 Accomodates a Pattern Restriction.
Author:
damyan ognyanoff, borislav popov

Field Summary
static int SPO_OBJECT
           
static int SPO_OBJECT_LITERAL
           
static int SPO_PREDICATE
           
static int SPO_SUBJECT
          subject restriction
 
Fields inherited from class org.openrdf.sesame.sailimpl.omm.security.Restriction
CLASSES, CLASSES_OVER_SCHEMA, CLASSES_OVER_SCHEMA_RESTRICTION, CLASSES_RESTRICTION, INSTANCES, INSTANCES_RESTRICTION, PATTERN, PATTERN_RESTRICTION, PROPERTIES, PROPERTIES_RESTRICTION, QUERY, QUERY_RESTRICTION, REPOSITORY, REPOSITORY_RESTRICTION, SCHEMA, SCHEMA_RESTRICTION
 
Constructor Summary
PatternRestriction(int id, String name, String description)
          Create a Pattern Restriction.
 
Method Summary
 void addObjectRestriction(Literal literal)
          Adds an object restriction.
 void addObjectRestriction(ResourceRestriction objRestr)
          Adds an object restriction.
 void addPredicateRestriction(PropertiesRestriction propRestr)
          Adds a predicate restriction.
 void addSubjectRestriction(ResourceRestriction subjRestr)
          Adds a subject restriction.
 Set getObjectRestrictions()
          Gets the set of object restrictions.
 Set getPredicateRestrictions()
          Gets the set of predicate restrictions
 Set getSubjectRestrictions()
          Gets the set of subject restrictions.
 ArrayList toSql(Map idByLiteral, Map idByRes)
          Creates update queries over the restrictions, res_prop_restrs, query_restrs, pattern_restrs tables.
 
Methods inherited from class org.openrdf.sesame.sailimpl.omm.security.Restriction
createClassesOverSchemaRestriction, createClassesOverSchemaRestriction, createClassesRestriction, createClassesRestriction, createInstancesRestriction, createInstancesRestriction, createPatternRestriction, createPatternRestriction, createPropertiesRestriction, createPropertiesRestriction, createQueryRestriction, createQueryRestriction, createRepositoryRestriction, createRepositoryRestriction, createRestriction, createRestriction, createSchemaRestriction, createSchemaRestriction, getDescription, getId, getName, getRestrictions, getType, getUri, setDescription, setId, setName, setType, setUri, type2Int, type2String
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPO_SUBJECT

public static final int SPO_SUBJECT
subject restriction

See Also:
Constant Field Values

SPO_PREDICATE

public static final int SPO_PREDICATE
See Also:
Constant Field Values

SPO_OBJECT

public static final int SPO_OBJECT
See Also:
Constant Field Values

SPO_OBJECT_LITERAL

public static final int SPO_OBJECT_LITERAL
See Also:
Constant Field Values
Constructor Detail

PatternRestriction

public PatternRestriction(int id,
                          String name,
                          String description)
Create a Pattern Restriction.

Parameters:
id - id of the restriction.
name - name of the restriction.
description - description of the restriction.
Method Detail

addSubjectRestriction

public void addSubjectRestriction(ResourceRestriction subjRestr)
Adds a subject restriction.

Parameters:
subjRestr - subject restriction to be added

addPredicateRestriction

public void addPredicateRestriction(PropertiesRestriction propRestr)
Adds a predicate restriction.

Parameters:
propRestr - predicate restriction to be added

addObjectRestriction

public void addObjectRestriction(ResourceRestriction objRestr)
Adds an object restriction.

Parameters:
objRestr - the object restriction to be set

addObjectRestriction

public void addObjectRestriction(Literal literal)
                          throws NullParameterException
Adds an object restriction.

Parameters:
literal - the literal to be added as object restriction
Throws:
NullParameterException - if the parameter is null.

getSubjectRestrictions

public Set getSubjectRestrictions()
Gets the set of subject restrictions.

Returns:
the set of subject restrictions

getPredicateRestrictions

public Set getPredicateRestrictions()
Gets the set of predicate restrictions

Returns:
the set of predicate restrictions

getObjectRestrictions

public Set getObjectRestrictions()
Gets the set of object restrictions.

Returns:
the set of object restrictions

toSql

public ArrayList toSql(Map idByLiteral,
                       Map idByRes)
                throws NullParameterException,
                       SecurityException
Description copied from class: Restriction
Creates update queries over the restrictions, res_prop_restrs, query_restrs, pattern_restrs tables.

Overrides:
toSql in class Restriction
Parameters:
idByLiteral - ids by literals map
idByRes - ids by resources map
Returns:
A list of update SQL queries, to be used to mirror the objects' properties from memory to an SQL repository.
Throws:
NullParameterException
SecurityException


Copyright © 2002-2006 Aduna BV, GNU LGPL License applies.