Adds a Statement.

@param rank
rank of the statement
@param subject
rdf resource that refers to the statement
508691
public void add(StatementRank rank, Resource subject) {
		if (this.bestRank == rank) {
			subjects.add(subject);
		} else if(bestRank == StatementRank.NORMAL && rank == StatementRank.PREFERRED) {
			//We found a preferred statement
			subjects.clear();
			bestRank = StatementRank.PREFERRED;
			subjects.add(subject);
		}
	}
1266813
public void statementGuaranteesDeterminism(boolean hasLimitOrOffset,
                                               boolean order,
                                               String contentDeterminismDetail) {
        m_statementHasLimitOrOffset = hasLimitOrOffset;
        m_statementIsOrderDeterministic = order;
        if (contentDeterminismDetail != null) {
            m_contentDeterminismDetail = contentDeterminismDetail;
        }
    }
1074427
public void setRoleMembership(String subject, Set<String> roles) {
		validateStringValue(subject);
		Validate.notNull(roles);
		if(roles.isEmpty())
			return;
		Validate.noNullElements(roles);
		
		props.setProperty(String.format(ROLE_MEMBERSHIP_FORMAT, subject), ArrayUtils.toString(encapsulateValues(roles)));
	}
161726
protected void add(SubjectNode subject,
                       RDFName predicate,
                       ObjectNode object,
                       Set<Triple> set) throws ResourceIndexException {
        set.add(new SimpleTriple(subject, predicate, object));
    }
1238419
public boolean addSubject(String subject) {
        try {
            return add(new Meta(Element.SUBJECT, subject));
		} catch (DocumentException de) {
            throw new ExceptionConverter(de);
        }
    }
180311
protected void setCommentLabel(Long id, String caption, String value) {
    Map<String, String> valueMap = answers.get(id);
    if (valueMap == null) {
      valueMap = new LinkedHashMap<>();
    }
    
    valueMap.put(caption, value);
    answers.put(id, valueMap);
  }
1245319
void addSomeValuesRestriction(Resource subject, String propertyUri,
			String rangeUri) {
		this.someValuesQueue.add(new PropertyRestriction(subject, propertyUri,
				rangeUri));
	}
881899
@Override
    public void removedStatement(final Statement s) {
        if (Operation.REMOVE == statements.get(s)) {
            return;
        }
        try {
            // if it's not about the right kind of node, ignore it.
            final Resource subject = s.getSubject();
            validateSubject(subject);
            LOGGER.trace(">> removing statement {}", s);

            final FedoraResource resource = idTranslator.convert(subject);
            final FedoraResource description = resource.getDescription();

            // special logic for handling rdf:type updates.
            // if the object is an already-existing mixin, update
            // the node's mixins. If it isn't, just treat it normally.
            final Property property = s.getPredicate();
            final RDFNode objectNode = s.getObject();

            if (property.equals(RDF.type) && objectNode.isResource()) {
                final Resource mixinResource = objectNode.asResource();
                jcrRdfTools.removeMixin(description, mixinResource, s.getModel().getNsPrefixMap());
                statements.put(s, Operation.REMOVE);
                return;
            }

            jcrRdfTools.removeProperty(description, property, objectNode, s.getModel().getNsPrefixMap());
            statements.put(s, Operation.REMOVE);
        } catch (final ConstraintViolationException e) {
            throw e;
        } catch (final RepositoryException | RepositoryRuntimeException e) {
            exceptions.add(e);
        }

    }
934059
@Override
    public  org.openrdf.model.Statement createObjectProperty(QualifiedName subject, 
                                                             QualifiedName pred,
                                                             QualifiedName object) {
	return new StatementImpl(qualifiedNameToResource(subject), 
	                         qualifiedNameToURI(pred),
				 qualifiedNameToResource(object));
    }
641608
public void addRoleRelation(String roleFrom, String roleTo) throws PropertyException{
		validateStringValue(roleFrom);
		validateStringValue(roleTo);
		
		String relationName = String.format(ROLE_RELATION_FORMAT, getNextRelationIndex());
		props.setProperty(relationName, String.format(ROLE_RELATION_VALUE_FORMAT, roleFrom, roleTo));
		addRelationNameToList(relationName);
	}
389180
public void add(int[] positions) {
    SortedSet<Integer> list = new TreeSet<>();
    for (int p : positions) {
      list.add(p);
    }
    if (mtasPositionType.equals(POSITION_SINGLE)) {
      mtasPositionType = POSITION_SET;
      list.add(mtasPositionStart);
    } else if (mtasPositionType.equals(POSITION_RANGE)) {
      mtasPositionType = POSITION_SET;
      for (int i = mtasPositionStart; i <= mtasPositionEnd; i++) {
        list.add(i);
      }
    } else if (mtasPositionType.equals(POSITION_SET)) {
      for (int p : mtasPositionList) {
        list.add(p);
      }
    }
    mtasPositionList = ArrayUtils
        .toPrimitive(list.toArray(new Integer[list.size()]));
    mtasPositionStart = list.first();
    mtasPositionEnd = list.last();
    if (list.size() == 1) {
      mtasPositionType = POSITION_SINGLE;
      mtasPositionList = null;
    } else if (list.size() == (1 + mtasPositionEnd - mtasPositionStart)) {
      mtasPositionType = POSITION_RANGE;
      mtasPositionList = null;
    }
  }
802818
private void setJettyAuthentication(Subject subject) {
        // In unit test environments there may not be a current connection.  If any nulls are encountered
        // then, by definition, there is no container to update.
        HttpConnection connection = HttpConnection.getCurrentConnection();
        if (connection == null) {
            return;
        }
        Request jettyRequest = connection.getHttpChannel().getRequest();
        if (jettyRequest == null) {
            return;
        }

        // This cast down is safe; subject is always created with this type of principal
        PrincipalWithRoles principal = (PrincipalWithRoles) subject.getPrincipal();
        UserIdentity identity = principal.toUserIdentity();

        jettyRequest.setAuthentication(new UserAuthentication(SecurityContext.BASIC_AUTH, identity));
    }
1302459
String getUriStringForRank(StatementRank rank) {
		switch (rank) {
		case NORMAL:
			return Vocabulary.WB_NORMAL_RANK;
		case PREFERRED:
			return Vocabulary.WB_PREFERRED_RANK;
		case DEPRECATED:
			return Vocabulary.WB_DEPRECATED_RANK;
		default:
			throw new IllegalArgumentException();
		}
	}
890192
public synchronized void add(Resource subject, URI predicate, Value object, Resource... contexts) throws MarkLogicSesameException {
        cache.add(subject,predicate,object,contexts);
        if( cache.size() > cacheSize - 1){
            forceRun();
        }
    }
581879
private function addStatement($modelId, $subject, $predicate, $object, $lang = null) {
        $result = core_kernel_classes_DbWrapper::singleton()->query(
            'SELECT count(*) FROM statements WHERE modelid = ? AND subject = ? AND predicate = ? AND object = ? AND l_language = ?',
            array($modelId, $subject, $predicate, $object, (is_null($lang)) ? '' : $lang)
        );
        
        if (intval($result->fetchColumn()) === 0) {
            $dbWrapper = core_kernel_classes_DbWrapper::singleton();
            $date = $dbWrapper->getPlatForm()->getNowExpression();

            $dbWrapper->insert(
                'statements',
                array(
                    'modelid' =>  $modelId,
                    'subject' =>$subject,
                    'predicate'=> $predicate,
                    'object' => $object,
                    'l_language' => is_null($lang) ? '' : $lang,
                    'author' => 'http://www.tao.lu/Ontologies/TAO.rdf#installator',
                    'epoch' => $date
                )
            );
        }
    }
268195
def add_task(self, subject, status, **attrs):
        
        return Tasks(self.requester).create(
            self.project, subject, status,
            user_story=self.id, **attrs
        )
63283
public static <S> void assertThat(S subject, Feature<? super S,Boolean> feature) {
        assertThat(subject, feature, isQuietlyTrue());
    }