Collects constraints for relationships

@return
511370
private Stream<ConstraintRelationshipInfo> constraintsForRelationship(Map<String,Object> config) {
        Schema schema = db.schema();

        SchemaConfig schemaConfig = new SchemaConfig(config);
        Set<String> includeRelationships = schemaConfig.getRelationships();
        Set<String> excludeRelationships = schemaConfig.getExcludeRelationships();

        try ( Statement ignore = tx.acquireStatement() ) {
            TokenRead tokenRead = tx.tokenRead();
            Iterable<ConstraintDefinition> constraintsIterator;

            if(!includeRelationships.isEmpty()) {
                constraintsIterator = includeRelationships.stream()
                        .filter(type -> !excludeRelationships.contains(type) && tokenRead.relationshipType(type) != -1)
                        .flatMap(type -> {
                            Iterable<ConstraintDefinition> constraintsForType = schema.getConstraints(RelationshipType.withName(type));
                            return StreamSupport.stream(constraintsForType.spliterator(), false);
                        })
                        .collect(Collectors.toList());
            } else {
                Iterable<ConstraintDefinition> allConstraints = schema.getConstraints();
                constraintsIterator = StreamSupport.stream(allConstraints.spliterator(),false)
                        .filter(index -> !excludeRelationships.contains(index.getRelationshipType().name()))
                        .collect(Collectors.toList());
            }

            Stream<ConstraintRelationshipInfo> constraintRelationshipInfoStream = StreamSupport.stream(constraintsIterator.spliterator(), false)
                    .filter(constraintDefinition -> constraintDefinition.isConstraintType(ConstraintType.RELATIONSHIP_PROPERTY_EXISTENCE))
                    .map(this::relationshipInfoFromConstraintDefinition);

            return constraintRelationshipInfoStream;
        }
    }
449563
FieldConstraints extractValidationRules() {
    Annotation[] annotations = field.getAnnotations();
    FieldConstraints fieldConstraints = new FieldConstraints();

    for (Annotation annotation : annotations) {
      if (Iterables.contains(relevantAnnotationClasses, annotation.annotationType())) {
        ConstraintAttributes constraintAttributes = new ConstraintAttributes(annotation);
        BuiltInConstraint supportedValidator = BuiltInConstraint.valueOfAnnotationClassOrNull(annotation
          .annotationType());
        if (supportedValidator == null) {
          fieldConstraints.put(annotation.annotationType().getName(), constraintAttributes);
        } else {
          fieldConstraints.put(supportedValidator.toString(),
            supportedValidator.createDecoratorFor(constraintAttributes));
        }
      }
    }

    return fieldConstraints;
  }
957289
OrderedHashSet getDependentConstraints(int colIndex) {

        OrderedHashSet set = new OrderedHashSet();

        for (int i = 0, size = constraintList.length; i < size; i++) {
            Constraint c = constraintList[i];

            if (c.hasColumnOnly(colIndex)) {
                set.add(c);
            }
        }

        return set;
    }
576115
public List<BeanType<ConstraintMappingsType<T>>> getAllBean()
   {
      List<BeanType<ConstraintMappingsType<T>>> list = new ArrayList<BeanType<ConstraintMappingsType<T>>>();
      List<Node> nodeList = childNode.get("bean");
      for(Node node: nodeList)
      {
         BeanType<ConstraintMappingsType<T>>  type = new BeanTypeImpl<ConstraintMappingsType<T>>(this, "bean", childNode, node);
         list.add(type);
      }
      return list;
   }
1111740
public GridBagConstraints getGBConstraints()
    {
        if (m_gbconstraints == null)
        {
            m_gbconstraints = new GridBagConstraints();
            m_gbconstraints.insets = new Insets(2, 2, 2, 2);
            m_gbconstraints.ipadx = 2;
            m_gbconstraints.ipady = 2;
        }
        return m_gbconstraints;
    }
1139066
public function addConstraints()
    {
        if (static::$constraints) {
            // For belongs to relationships, which are essentially the inverse of has one
            // or has many relationships, we need to actually query on the primary key
            // of the related models matching on the foreign key that's on a parent.
            $this->query->where($this->otherKey, '=', $this->parent->{$this->foreignKey});
        }
    }
795141
public List<ConstraintDefinitionType<ValidationMappingDescriptor>> getAllConstraintDefinition()
   {
      List<ConstraintDefinitionType<ValidationMappingDescriptor>> list = new ArrayList<ConstraintDefinitionType<ValidationMappingDescriptor>>();
      List<Node> nodeList = model.get("constraint-definition");
      for(Node node: nodeList)
      {
         ConstraintDefinitionType<ValidationMappingDescriptor>  type = new ConstraintDefinitionTypeImpl<ValidationMappingDescriptor>(this, "constraint-definition", model, node);
         list.add(type);
      }
      return list;
   }
1168957
def relations(cls):
        
        return [c.key for c in cls.__mapper__.iterate_properties
                if isinstance(c, RelationshipProperty)]
1278413
@Override
	public Set<String> getContainedIds() {
		Set<String> s = super.getContainedIds();
		s.addAll(constraint.getContainedIds());
		return s;
	}
1351228
public Collection<Constraint<? super SolutionType, ? super DataType>> getViolatedConstraints(SolutionType solution){
        // return set with all violated constraints
        return Stream.concat(mandatoryConstraints.stream(), penalizingConstraints.stream())
                     .filter(c -> !c.validate(solution, data).passed())
                     .collect(Collectors.toSet());
    }
140425
public List<UniqueConstraint<CollectionTable<T>>> getAllUniqueConstraint()
   {
      List<UniqueConstraint<CollectionTable<T>>> list = new ArrayList<UniqueConstraint<CollectionTable<T>>>();
      List<Node> nodeList = childNode.get("unique-constraint");
      for(Node node: nodeList)
      {
         UniqueConstraint<CollectionTable<T>>  type = new UniqueConstraintImpl<CollectionTable<T>>(this, "unique-constraint", childNode, node);
         list.add(type);
      }
      return list;
   }
646440
public List<TopicRelationship> getLinkListTopicRelationships() {
        final ArrayList<TopicRelationship> relationships = new ArrayList<TopicRelationship>();
        for (final TopicRelationship relationship : topicRelationships) {
            if (relationship.getType() == RelationshipType.LINKLIST) {
                relationships.add(relationship);
            }
        }
        for (final TargetRelationship relationship : topicTargetRelationships) {
            if (relationship.getType() == RelationshipType.LINKLIST) {
                relationships.add(new TopicRelationship(relationship.getPrimaryRelationship(), (SpecTopic) relationship.getSecondaryRelationship(),
                        relationship.getType()));
            }
        }
        return relationships;
    }
999847
public List<QueryImpl> getDependingQueries() {
        if (dependingQueries == null) {
            dependingQueries = usedQueries == null ? Collections.<QueryImpl>emptyList() : collectDependingQueries(new LinkedList<QueryImpl>());
        }
        return dependingQueries;
    }
818192
@SuppressWarnings("unchecked")
    @Override
    public Map getConstrainedProperties() {
        verifyContextIsInitialized();
        if(constrainedProperties == null) {
            ConstrainedDiscovery constrainedDiscovery = GrailsFactoriesLoader.loadFactory(ConstrainedDiscovery.class);
            if(constrainedDiscovery == null) {
                constrainedProperties = Collections.emptyMap();
            }
            else {
                constrainedProperties = constrainedDiscovery.findConstrainedProperties(persistentEntity);
            }
        }
        return constrainedProperties;
    }
416545
public TreeSet<String> getAllRelations() {
		TreeSet<String> set = new TreeSet<String>(); 
		Iterator<FNLPDoc> it1 = docs.iterator();
		while(it1.hasNext()){
			FNLPDoc doc = it1.next();
			Iterator<FNLPSent> it2 = doc.sentences.iterator();
			while(it2.hasNext()){
				FNLPSent sent = it2.next();
				if(!sent.hasRelation())
					continue;
				for(int i=0;i<sent.size();i++){					
					set.add(sent.relations[i]);
				}
			}

		}
		return set;
		
	}
957449
public List<Relationship> getNextRelationships() {
        final List<Relationship> nextRelationships = new LinkedList<Relationship>();
        for (final Relationship r : relationships) {
            if (r.getType() == RelationshipType.NEXT) {
                nextRelationships.add(r);
            }
        }
        return nextRelationships;
    }
64187
def get_implicit_constraints(self,relations):
        ''' '''

        constraints = []
        for relation in [r for r in relations if not r.is_negated()]  :
            const_dict = relation.get_constants()
            for constant in const_dict:
                for position in const_dict[constant]:
                    constraints.append( \
                        relation.get_name() + '.' + self.mapPositionToColumnName(relation,position) + ' = ' + str(constant) \
                    )
        return constraints