Add references found from a partial query of bean references.
346738
public void addRefs(Multimap<BeanId, JpaRef> queryRefs) {
        refs.putAll(queryRefs);
        for (BeanId id : refs.keySet()) {
            putIfAbsent(id);
            for (JpaRef ref : refs.get(id)) {
                putIfAbsent(ref.getTarget());
            }
        }
    }
1067509
public <T extends Relation> T add(T statement,
                                     int num,
                                     Collection<T> anonRelationCollection,
                                     HashMap<QualifiedName, Collection<T>> namedRelationMap,
                                     HashMap<QualifiedName, Collection<T>> effectRelationMap,
                                     HashMap<QualifiedName, Collection<T>> causeRelationMap) {
	QualifiedName aid2 = u.getEffect(statement); //wib.getInformed();
	QualifiedName aid1 = u.getCause(statement); //wib.getInformant();

	statement = pFactory.newStatement(statement); // clone
	
	QualifiedName id;
	if (statement instanceof Identifiable) {
	    id=((Identifiable)statement).getId();	
	} else {
	    id=null;
	}

	if (id == null) {

	    boolean found = false;
	    Collection<T> relationCollection = effectRelationMap.get(aid2);
	    if (relationCollection == null) {
		relationCollection = new LinkedList<T>();
		relationCollection.add(statement);
		effectRelationMap.put(aid2, relationCollection);
	    } else {
		for (T u : relationCollection) {
		    if (u.equals(statement)) {
			found = true;
			statement = u;
			break;
		    }
		}
		if (!found) {
		    relationCollection.add(statement);
		}
	    }

	    relationCollection = causeRelationMap.get(aid1);
	    if (relationCollection == null) {
		relationCollection = new LinkedList<T>();
		relationCollection.add(statement);
		causeRelationMap.put(aid1, relationCollection);
	    } else {
		if (!found) {
		    // if we had not found it in the first table, then we
		    // have to add it here too
		    relationCollection.add(statement);
		}
	    }

	    if (!found) {
		anonRelationCollection.add(statement);
	    }
	} else {
	    Collection<T> relationCollection=namedRelationMap.get(id);
	    if (relationCollection==null) {
		relationCollection=new LinkedList<T>();
		relationCollection.add(statement);
		namedRelationMap.put(id, relationCollection);
	    } else {
		boolean found=false;
		for (T u1: relationCollection) {
		    if (sameEdge(u1,statement,num)) {
			found=true;
			mergeAttributes(u1, statement);
			break;			
		    }
		}
		if (!found) {
		    relationCollection.add(statement);
		}
	    }
	}
	return statement;
}
938814
private void appendDirectives(StringBuffer query) {
		StringBuffer sb = new StringBuffer();
		for (String prefix : prefixes.keySet()) {
			sb.append("@PREFIX");
			sb.append(" ");
			sb.append(prefix);
			sb.append(" ");
			sb.append("<");
			sb.append(prefixes.get(prefix));
			sb.append(">");
			sb.append(" .\n");
		}
		sb.append("@PREFIX " + OntopInternal.PREFIX_XSD + " <" + XSD.PREFIX + "> .\n");
		sb.append("@PREFIX " + OntopInternal.PREFIX_OBDA + " <" + Ontop.PREFIX + "> .\n");
		sb.append("@PREFIX " + OntopInternal.PREFIX_RDF + " <" + RDF.PREFIX + "> .\n");
		sb.append("@PREFIX " + OntopInternal.PREFIX_RDFS + " <" + RDFS.PREFIX + "> .\n");
		sb.append("@PREFIX " + OntopInternal.PREFIX_OWL + " <" + OWL.PREFIX + "> .\n");
		query.insert(0, sb);
	}
1359562
def add_reference(self, source, target, **kwargs):
        
        # Tweak keyword arguments for addReference
        addRef_kw = kwargs.copy()
        addRef_kw.setdefault("referenceClass", self.referenceClass)
        if "schema" in addRef_kw:
            del addRef_kw["schema"]
        uid = api.get_uid(target)
        rc = api.get_tool("reference_catalog")
        # throws IndexError if uid is invalid
        rc.addReference(source, uid, self.relationship, **addRef_kw)
        # link the version of the reference
        self.link_version(source, target)
1196808
def addReference(self, reference):
        
        id_ = reference.getId()
        self._referenceIdMap[id_] = reference
        self._referenceNameMap[reference.getLocalId()] = reference
        self._referenceIds.append(id_)
1164221
public void setReferences(IReferences references) {
		Object contextInfo = references.getOneOptional(new Descriptor("pip-services3", "context-info", "*", "*", "1.0"));
		if (contextInfo instanceof ContextInfo && contextInfo != null && _source == null)
			_source = ((ContextInfo) contextInfo).getName();
	}
896176
void appendBuilders(List<RoutesBuilder> list) {
        for (Bean<?> bean : manager.getBeans(RoutesBuilder.class, ANY)) {
            logger.trace("Found RouteBuilder bean {}", bean);

            // certain beans should be ignored
            if (shouldIgnoreBean(bean)) {
                logger.debug("Ignoring RouteBuilder {}", bean);
                continue;
            }

            if (!isFilteredClass(bean)) {
                logger.debug("Ignoring filtered RouteBuilder {}", bean);
                continue;
            }

            logger.debug("Adding instantiated RouteBuilder {}", bean);
            Object instance = manager.getReference(bean, RoutesBuilder.class, manager.createCreationalContext(bean));
            list.add((RoutesBuilder) instance);
        }
    }
656253
def add_eager_constraints(self, models):
        
        self._query.where_in(self.get_foreign_key(), self.get_keys(models))
843846
private static boolean hasReferences(Bean target, BeanId reference) {
        for (String name : target.getReferenceNames()) {
            for (BeanId ref : target.getReference(name)) {
                if (ref.equals(reference)) {
                    return true;
                }
            }
        }
        return false;
    }
809913
private void addRelations(List<RelationHolder> rlHolders, Map<String, Object> values)
    {
        if (rlHolders != null)
        {
            for (RelationHolder relation : rlHolders)
            {
                values.put(relation.getRelationName(), relation.getRelationValue());
            }
        }
    }
645608
public static <T extends RefCounted<T>> Refs<T> tryRef(Iterable<T> reference)
    {
        HashMap<T, Ref<T>> refs = new HashMap<>();
        for (T rc : reference)
        {
            Ref<T> ref = rc.tryRef();
            if (ref == null)
            {
                release(refs.values());
                return null;
            }
            refs.put(rc, ref);
        }
        return new Refs<T>(refs);
    }
261404
function resolveReferences() {

    var elementsById = context.elementsById;
    var references = context.references;

    var i, r;

    for (i = 0; (r = references[i]); i++) {
      var element = r.element;
      var reference = elementsById[r.id];
      var property = getModdleDescriptor(element).propertiesByName[r.property];

      if (!reference) {
        context.addWarning({
          message: 'unresolved reference <' + r.id + '>',
          element: r.element,
          property: r.property,
          value: r.id
        });
      }

      if (property.isMany) {
        var collection = element.get(property.name),
            idx = collection.indexOf(r);

        // we replace an existing place holder (idx != -1) or
        // append to the collection instead
        if (idx === -1) {
          idx = collection.length;
        }

        if (!reference) {
          // remove unresolvable reference
          collection.splice(idx, 1);
        } else {
          // add or update reference in collection
          collection[idx] = reference;
        }
      } else {
        element.set(property.name, reference);
      }
    }
  }
386725
public void setReferences(final String propertyName, final List<BeanId> values) {
        Preconditions.checkNotNull(propertyName);
        if (values == null || values.size() == 0) {
            references.put(propertyName, null);
            return;
        }
        checkCircularReference(values.toArray(new BeanId[values.size()]));
        references.put(propertyName, values);
    }
1233620
private void addFieldsToBuilder(String[] fieldsToSelect, Class clazz, MetamodelImpl metaModel,
            SearchRequestBuilder builder)
    {
        if (fieldsToSelect != null && fieldsToSelect.length > 1 && !(fieldsToSelect[1] == null))
        {
            logger.debug("Fields added in query are: ");
            for (int i = 1; i < fieldsToSelect.length; i++)
            {
                logger.debug(i + " : " + fieldsToSelect[i]);
                builder = builder.addField(((AbstractAttribute) metaModel.entity(clazz).getAttribute(fieldsToSelect[i]))
                        .getJPAColumnName());
            }
        }
    }
80035
private void addFullMBeanInfo(JSONObject pMBeanMap, MBeanInfo pMBeanInfo) {
        for (DataUpdater updater : UPDATERS.values()) {
            updater.update(pMBeanMap,pMBeanInfo,null);
        }
    }
655574
def references(self):
    '''
    
    '''

    if not getattr(self, '_references', False):
      def add_protocol(url):
        return url if url.startswith('http') else 'http:' + url

      self._references = [
        add_protocol(link['*'])
        for link in self.__continued_query({
          'prop': 'extlinks',
          'ellimit': 'max'
        })
      ]

    return self._references
125826
protected void addSortedInserts(List<DbOperation> flush) {
    for (Entry<Class<?>, SortedSet<DbEntityOperation>> operationsForType : inserts.entrySet()) {

      // add inserts to flush
      if(HasDbReferences.class.isAssignableFrom(operationsForType.getKey())) {
        // if this type has self references, we need to resolve the reference order
        flush.addAll(sortByReferences(operationsForType.getValue()));
      } else {
        flush.addAll(operationsForType.getValue());
      }
    }
  }