Add a statement about the object for each predicate, value pair expressed
in the DC datastream.
183611
private void addDCTriples(Datastream ds,
                              URIReference objURI,
                              Set<Triple> set) throws Exception {
        DCFields dc = new DCFields(ds.getContentStream());
        Map<RDFName, List<DCField>> map = dc.getMap();
        for (RDFName predicate : map.keySet()) {
            for (DCField dcField : map.get(predicate)) {
                String lang = dcField.getLang();
                if (lang == null) {
                    add(objURI, predicate, dcField.getValue(), set);
                } else {
                    add(objURI, predicate, dcField.getValue(), lang, set);
                }
            }
        }
    }
121305
def add_predicate(self, predicate_obj):
        
        if self.srl_layer is None:
            self.srl_layer = Csrl()
            self.root.append(self.srl_layer.get_node())
        self.srl_layer.add_predicate(predicate_obj)
173651
def add(attrs, inputs, proto_obj):
    """"""
    new_attr = {}

    if 'broadcast' in attrs and attrs['broadcast'] == 1:
        broadcast_axis = attrs['axis']
        op_value = translation_utils._fix_broadcast('broadcast_add', inputs,
                                                    broadcast_axis, proto_obj)
        return op_value, new_attr, inputs
    return 'broadcast_add', new_attr, inputs
734310
private void addPredicateReference(String theResourceName, String theParamName, List<? extends IQueryParameterType> theList) {
		assert theParamName.contains(".") == false;

		if (theList.get(0).getMissing() != null) {
			addPredicateParamMissing(theResourceName, theParamName, theList.get(0).getMissing());
			return;
		}

		Join<ResourceTable, ResourceLink> join = createJoin(JoinEnum.REFERENCE, theParamName);

		List<IIdType> targetIds = new ArrayList<>();
		List<String> targetQualifiedUrls = new ArrayList<>();

		for (int orIdx = 0; orIdx < theList.size(); orIdx++) {
			IQueryParameterType nextOr = theList.get(orIdx);

			if (nextOr instanceof ReferenceParam) {
				ReferenceParam ref = (ReferenceParam) nextOr;

				if (isBlank(ref.getChain())) {

					/*
					 * Handle non-chained search, e.g. Patient?organization=Organization/123
					 */

					IIdType dt = new IdDt(ref.getBaseUrl(), ref.getResourceType(), ref.getIdPart(), null);

					if (dt.hasBaseUrl()) {
						if (myDaoConfig.getTreatBaseUrlsAsLocal().contains(dt.getBaseUrl())) {
							dt = dt.toUnqualified();
							targetIds.add(dt);
						} else {
							targetQualifiedUrls.add(dt.getValue());
						}
					} else {
						targetIds.add(dt);
					}

				} else {

					/*
					 * Handle chained search, e.g. Patient?organization.name=Kwik-e-mart
					 */

					addPredicateReferenceWithChain(theResourceName, theParamName, theList, join, new ArrayList<>(), ref);
					return;

				}

			} else {
				throw new IllegalArgumentException("Invalid token type (expecting ReferenceParam): " + nextOr.getClass());
			}

		}

		List<Predicate> codePredicates = new ArrayList<>();

		// Resources by ID
		List<Long> targetPids = myIdHelperService.translateForcedIdToPids(targetIds);
		if (!targetPids.isEmpty()) {
			ourLog.debug("Searching for resource link with target PIDs: {}", targetPids);
			Predicate pathPredicate = createResourceLinkPathPredicate(theResourceName, theParamName, join);
			Predicate pidPredicate = join.get("myTargetResourcePid").in(targetPids);
			codePredicates.add(myBuilder.and(pathPredicate, pidPredicate));
		}

		// Resources by fully qualified URL
		if (!targetQualifiedUrls.isEmpty()) {
			ourLog.debug("Searching for resource link with target URLs: {}", targetQualifiedUrls);
			Predicate pathPredicate = createResourceLinkPathPredicate(theResourceName, theParamName, join);
			Predicate pidPredicate = join.get("myTargetResourceUrl").in(targetQualifiedUrls);
			codePredicates.add(myBuilder.and(pathPredicate, pidPredicate));
		}

		if (codePredicates.size() > 0) {
			myPredicates.add(myBuilder.or(toArray(codePredicates)));
		} else {
			// Add a predicate that will never match
			Predicate pidPredicate = join.get("myTargetResourcePid").in(-1L);
			myPredicates.clear();
			myPredicates.add(pidPredicate);
		}
	}
313270
def add_triple(self, subject, predicate, object):
        

        def filter_ontid(ontid):
            if ontid.startswith('http://'):
                pass
            elif ontid.prefix == 'ILXTEMP':
                ontid = 'tmp_' + ontid.suffix
            else:
                ontid = 'ilx_' + ontid.suffix
            return ontid

        # this split between annotations and relationships is severely annoying
        # because you have to know before hand which one it is (sigh)
        s = OntId(subject)
        p = OntId(predicate)
        o = self._get_type(object)
        if type(o) == str:
            func = self.ilx_cli.add_annotation
        elif type(o) == OntId:
            func = self.ilx_cli.add_relationship
            o = filter_ontid(o)
        else:
            raise TypeError(f'what are you giving me?! {object!r}')

        s = filter_ontid(s)
        p = filter_ontid(p)

        resp = func(s, p, o)
        return resp
428597
def add_property(self, pred, obj):
        
        pred = Uri(pred)
        try:
            self[pred].append(obj)
        # except AttributeError:
        #     new_list = [self[pred]]
        #     new_list.append(obj)
        #     self[pred] = new_list
        except KeyError:
            try:
                new_prop = self.properties[pred]
            except AttributeError:
                self.properties = {}
                self.add_property(pred, obj)
                return
            except KeyError:
                try:
                    new_prop = MODULE.rdfclass.properties[pred]
                except KeyError:
                    new_prop = MODULE.rdfclass.make_property({},
                                                      pred, self.class_names)
                try:
                    self.properties[pred] = new_prop
                except AttributeError:
                    self.properties = {pred: new_prop}
            init_prop = new_prop(self, get_attr(self, "dataset"))
            setattr(self,
                    pred,
                    init_prop)
            self[pred] = init_prop
            self[pred].append(obj)
        if self.dataset:
            self.dataset.add_rmap_item(self, pred, obj)
648275
public void addValue(Object current, Object value) throws ParseException, IOException {
		throw new RuntimeException(ERR_MSG + " addValue(Object current, Object value) in " + this.getClass());
	}
520704
function addData(a)
        {
            if(isObject(a.event.value) || isArray(a.event.value))
            {
                if(!isObservable(a.event.value))
                {
                    a.preventDefault();
                    var local = a.event.local,
                        str = local.__kbscopeString+(local.__kbscopeString.length !== 0 ? '.' : '')+a.key,
                        builder = (isObject(a.event.value) ? KObject : KArray)(local.__kbname,local,str);
                    
                    overwrite(builder).parseData(a.event.value);
                    if(local[a.key] === undefined)
                    {
                      local.add(a.key,builder);
                    }
                    else if(isArray(local))
                    {
                      local.splice(a.key,0,builder);
                    }
                    else if(isObject(local))
                    {
                      local.set(a.key,builder);
                    }
                }
            }
        }
885118
public AnimaQuery<T> and(String statement, Object value) {
        return this.where(statement, value);
    }
356493
def add_predicate(self, key, value, predicate_type='equals'):
        
        if predicate_type not in operators:
            predicate_type = operator_lkup.get(predicate_type)
        if predicate_type:
            self.predicates.append({'type': predicate_type,
                                    'key': key,
                                    'value': value
                                    })
        else:
            raise Exception("predicate type not a valid operator")
934059
@Override
    public  org.openrdf.model.Statement createObjectProperty(QualifiedName subject, 
                                                             QualifiedName pred,
                                                             QualifiedName object) {
	return new StatementImpl(qualifiedNameToResource(subject), 
	                         qualifiedNameToURI(pred),
				 qualifiedNameToResource(object));
    }
1259439
@Override
    public void add(Iterable<? extends Statement> statements, Resource... contexts) throws RepositoryException {
        Iterator <? extends Statement> iter = statements.iterator();
        while(iter.hasNext()){
            Statement st = iter.next();
            add(st, mergeResource(st.getContext(), contexts));
        }
    }
445787
def add_statement(self, line: str, lineno: Optional[int] = None) -> None:
        ''''''
        # there can be only one statement block
        if self.category() != 'statements':
            self.values = [line]
        else:
            self.values.append(line)
        if self.statements and self.statements[-1][0] == '!':
            self.statements[-1][-1] += line
        else:
            self.statements.append(['!', line])
        if lineno:
            self.lineno = lineno
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
                )
            );
        }
    }
1372130
public void addPredicate(final INodeReadTrx mTransaction) {

        assert getPipeStack().size() >= 2;

        final AbsAxis mPredicate = getPipeStack().pop().getExpr();

        if (mPredicate instanceof LiteralExpr) {

            mPredicate.hasNext();
            // if is numeric literal -> abbrev for position()
            final int type = mTransaction.getNode().getTypeKey();
            if (type == NamePageHash.generateHashForString("xs:integer")
                || type == NamePageHash.generateHashForString("xs:double")
                || type == NamePageHash.generateHashForString("xs:float")
                || type == NamePageHash.generateHashForString("xs:decimal")) {

                throw new IllegalStateException("function fn:position() is not implemented yet.");

                // getExpression().add(
                // new PosFilter(transaction, (int)
                // Double.parseDouble(transaction
                // .getValue())));
                // return; // TODO: YES! it is dirty!

                // AtomicValue pos =
                // new AtomicValue(mTransaction.getNode().getRawValue(),
                // mTransaction
                // .keyForName("xs:integer"));
                // long position = mTransaction.getItemList().addItem(pos);
                // mPredicate.reset(mTransaction.getNode().getNodeKey());
                // IAxis function =
                // new FNPosition(mTransaction, new ArrayList<IAxis>(),
                // FuncDef.POS.getMin(), FuncDef.POS
                // .getMax(),
                // mTransaction.keyForName(FuncDef.POS.getReturnType()));
                // IAxis expectedPos = new LiteralExpr(mTransaction, position);
                //
                // mPredicate = new ValueComp(mTransaction, function,
                // expectedPos, CompKind.EQ);

            }
        }

        getExpression().add(new PredicateFilterAxis(mTransaction, mPredicate));

    }
689214
public static void dumpIf(String name, Object obj, Predicate<String> evalPredicate, Predicate<Map.Entry<String, Object>> dumpPredicate, StringPrinter printer) {
		printer.println(name + ": " + obj.getClass().getName());
		fieldsAndGetters(obj, evalPredicate).filter(dumpPredicate).forEach(entry -> {
			printer.println("\t" + entry.getKey() + " = " + entry.getValue());
		});
	}
1125058
private final Statement funcStatement(Data data, Body parent) throws TemplateException {
	int pos = data.srcCode.getPos();

	// read 5 tokens (returntype,access modifier,"abstract|final|static","function", function name)
	String str = variableDec(data, false);
	// if there is no token at all we have no function
	if (str == null) {
	    data.srcCode.setPos(pos);
	    return null;
	}
	comments(data);
	String[] tokens = new String[] { str, null, null, null, null };

	tokens[1] = variableDec(data, false);
	comments(data);
	if (tokens[1] != null) {
	    tokens[2] = variableDec(data, false);
	    comments(data);
	    if (tokens[2] != null) {
		tokens[3] = variableDec(data, false);
		comments(data);
		if (tokens[3] != null) {
		    tokens[4] = identifier(data, false);
		    comments(data);
		}
	    }
	}

	// function name
	String functionName = null;
	for (int i = tokens.length - 1; i >= 0; i--) {
	    // first from right is the function name
	    if (tokens[i] != null) {
		functionName = tokens[i];
		tokens[i] = null;
		break;
	    }
	}
	if (functionName == null || functionName.indexOf(',') != -1 || functionName.indexOf('[') != -1) {
	    data.srcCode.setPos(pos);
	    return null;
	}
	// throw new TemplateException(data.srcCode, "invalid syntax");

	String returnType = null;

	// search for "function"
	boolean hasOthers = false, first = true;
	for (int i = tokens.length - 1; i >= 0; i--) {
	    if ("function".equalsIgnoreCase(tokens[i])) {
		// if it is the first "function" (from right) and we had already something else, the syntax is
		// broken!
		if (hasOthers && first) throw new TemplateException(data.srcCode, "invalid syntax");
		// we already have a return type,so this is the 3th "function"!
		else if (returnType != null) throw new TemplateException(data.srcCode, "invalid syntax");
		else if (!first) returnType = tokens[i];
		first = false;
		tokens[i] = null;
	    }
	    else if (tokens[i] != null) {
		hasOthers = true;
	    }
	}
	// no "function" found
	if (first) {
	    data.srcCode.setPos(pos);
	    return null;
	}

	// access modifier
	int _access, access = -1;
	for (int i = 0; i < tokens.length; i++) {
	    if (tokens[i] != null && (_access = ComponentUtil.toIntAccess(tokens[i], -1)) != -1) {
		// we already have an access modifier
		if (access != -1) {
		    // we already have a return type
		    if (returnType != null) throw new TemplateException(data.srcCode, "invalid syntax");
		    returnType = tokens[i];
		}
		else access = _access;
		tokens[i] = null;

	    }
	}
	// no access defined
	if (access == -1) access = Component.ACCESS_PUBLIC;

	// Non access modifier
	int _modifier, modifier = Component.MODIFIER_NONE;
	boolean isStatic = false;
	for (int i = 0; i < tokens.length; i++) {
	    if (tokens[i] != null) {
		_modifier = ComponentUtil.toModifier(tokens[i], Component.MODIFIER_NONE, Component.MODIFIER_NONE);

		// abstract|final
		if (_modifier != Component.MODIFIER_NONE) {
		    // we already have an Non access modifier
		    if (modifier != Component.MODIFIER_NONE || isStatic) {
			// we already have a return type
			if (returnType != null) throw new TemplateException(data.srcCode, "invalid syntax");
			returnType = tokens[i];
		    }
		    else modifier = _modifier;
		    tokens[i] = null;
		}
		// static
		else if (tokens[i].equalsIgnoreCase("static")) {
		    // we already have an Non access modifier
		    if (modifier != Component.MODIFIER_NONE || isStatic) {
			// we already have a return type
			if (returnType != null) throw new TemplateException(data.srcCode, "invalid syntax");
			returnType = tokens[i];
		    }
		    else isStatic = true;
		    tokens[i] = null;
		}
	    }
	}

	// return type
	for (int i = 0; i < tokens.length; i++) {
	    if (tokens[i] != null) {
		if (returnType != null) throw new TemplateException(data.srcCode, "invalid syntax");
		returnType = tokens[i];
	    }
	}

	Position line = data.srcCode.getPosition();

	// comments(data);

	// Name
	if (!data.isCFC && !data.isInterface) {
	    FunctionLibFunction flf = getFLF(data, functionName);
	    try {
		if (flf != null && flf.getFunctionClassDefinition().getClazz() != CFFunction.class) {
		    PageSource ps = null;
		    if (data.srcCode instanceof PageSourceCode) {
			ps = ((PageSourceCode) data.srcCode).getPageSource();
		    }

		    String path = null;
		    if (ps != null) {
			path = ps.getDisplayPath();
			path = path.replace('\\', '/');
		    }
		    if (path == null || path.indexOf("/library/function/") == -1)// TODO make better
			throw new TemplateException(data.srcCode, "The name [" + functionName + "] is already used by a built in Function");
		}
	    }
	    catch (Throwable t) {
		ExceptionUtil.rethrowIfNecessary(t);
		throw new PageRuntimeException(Caster.toPageException(t));
	    }
	}
	Function res = closurePart(data, functionName, access, modifier, returnType, line, false);
	if (isStatic) {

	    if (data.context == CTX_INTERFACE) throw new TemplateException(data.srcCode, "static functions are not allowed within the interface body");

	    TagOther tag = createStaticTag(data, res.getStart());

	    tag.getBody().addStatement(res);
	    return tag;
	}
	return res;
    }