When the "object" (as in subject-predicate-object) is an Instances, it
knows how to set its Concept (because that Concept is the object of the
Concept Property that holds the same name of this PropertyValue)

@return
@throws SemanticModelException
971841
public Concept setConceptForObjectInstance() throws SemanticModelException
    {
        Concept foundConcept = null;
        if (null != getObject() && getObject() instanceof Instance && null != subjectInstance)
        {
            SemanticAxiom semanticAxiom = subjectInstance.getConcept().semanticAxiom();
            if (semanticAxiom instanceof Concept)
            {
                Property foundProperty = ((Concept) semanticAxiom).getProperty(name);
                if (null != foundProperty && foundProperty.getObject() instanceof SemanticAxiom)
                {
                    SemanticAxiom axiomForPropertyObject = ((SemanticAxiom) foundProperty.getObject()).semanticAxiom();
                    if (axiomForPropertyObject instanceof Concept)
                    {
                        foundConcept = (Concept) axiomForPropertyObject;
                    }
                }
            }
            Instance objectInstance = (Instance) getObject();
            objectInstance.setConcept(foundConcept);
        }
        return foundConcept;
    }
1038545
@Override
    public void trainOnInstance(Instance inst) {
        if (!this.isInit) {
            this.isInit = true;
            InstancesHeader instances = new InstancesHeader(dataset);
            this.learner.setModelContext(instances);
            this.learner.prepareForUse();
        }
        if (inst.weight() > 0) {
            inst.setDataset(dataset);
            learner.trainOnInstance(inst);
        }
    }
162022
private TransactionException labelTaken(SchemaConcept schemaConcept) {
        if (Schema.MetaSchema.isMetaLabel(schemaConcept.label())) {
            return TransactionException.reservedLabel(schemaConcept.label());
        }
        return PropertyNotUniqueException.cannotCreateProperty(schemaConcept, Schema.VertexProperty.SCHEMA_LABEL, schemaConcept.label());
    }
1250485
protected void setApplicationObject() {
        try {
            Object app = createApplication();
            context.setAttribute(APP, app);
            initializer.set(app);
        } catch (Error e) {
            LOGGER.log(Level.SEVERE, "Failed to initialize "+getApplicationName(),e);
            initializer.setException(e);
            throw e;
        } catch (RuntimeException e) {
            LOGGER.log(Level.SEVERE, "Failed to initialize "+getApplicationName(),e);
            initializer.setException(e);
            throw e;
        } catch (Exception e) {
            LOGGER.log(Level.SEVERE, "Failed to initialize "+getApplicationName(),e);
            initializer.setException(e);
            throw new Error(e);
        } finally {
            // in case the above catch clauses miss this.
            if (!initializer.isDone())
                initializer.cancel(true);
        }
    }
402791
@Override
	public Collection<Object> values() {
		lock.readLock().lock();
		try {
			final List<Object> result = new LinkedList<Object>();
			final boolean useLocalPrefixes = !mixDefaultAndLocalPrefixes && hasLocalPrefixConfigurations();
			for (final Object key : getKeyMap(false).values()) {
				result.add(get(key, useLocalPrefixes));
			}
			return result;
		} finally {
			lock.readLock().unlock();
		}
	}
1133201
public function setSingleTableType() {
    $modelClass = get_class($this);
    $classType = property_exists($modelClass, 'singleTableType') ? $modelClass::$singleTableType : null;
    if ($classType !== null) {
      if ($this->hasGetMutator(static::$singleTableTypeField)) {
        $this->{static::$singleTableTypeField} = $this->mutateAttribute(static::$singleTableTypeField, $classType);
      } else {
        $this->{static::$singleTableTypeField} = $classType;
      }
    } else {
      // We'd like to be able to declare non-leaf classes in the hierarchy as abstract so they can't be instantiated and saved.
      // However, Eloquent expects to instantiate classes at various points. Therefore throw an exception if we try to save
      // and instance that doesn't have a type.
      throw new SingleTableInheritanceException('Cannot save Single table inheritance model without declaring static property $singleTableType.');
    }
  }
161726
protected void add(SubjectNode subject,
                       RDFName predicate,
                       ObjectNode object,
                       Set<Triple> set) throws ResourceIndexException {
        set.add(new SimpleTriple(subject, predicate, object));
    }
856345
protected EObject forceCreateModelElementAndSet(Action action, EObject value) {
    	EObject result = semanticModelBuilder.create(action.getType().getClassifier());
    	semanticModelBuilder.set(result, action.getFeature(), value, null /* ParserRule */, currentNode);
    	insertCompositeNode(action);
    	associateNodeWithAstElement(currentNode, result);
    	return result;
    }
1305236
public ConceptMap getSubstitution(){
        if (substitution == null) {
            Set<Variable> varNames = getVarNames();
            Set<IdPredicate> predicates = getAtoms(IsaAtomBase.class)
                    .map(IsaAtomBase::getTypePredicate)
                    .filter(Objects::nonNull)
                    .filter(p -> varNames.contains(p.getVarName()))
                    .collect(Collectors.toSet());
            getAtoms(IdPredicate.class).forEach(predicates::add);

            HashMap<Variable, Concept> answerMap = new HashMap<>();
            predicates.forEach(p -> {
                Concept concept = tx().getConcept(p.getPredicate());
                if (concept == null) throw GraqlCheckedException.idNotFound(p.getPredicate());
                answerMap.put(p.getVarName(), concept);
            });
            substitution = new ConceptMap(answerMap);
        }
        return substitution;
    }
1035422
@SuppressWarnings("unchecked") // Checked with instanceof
    public void set(String name, Object obj) throws IOException {
        if (name.equalsIgnoreCase(ID)) {
            if (obj instanceof CertificatePolicyId)
                policyIdentifier = (CertificatePolicyId)obj;
            else
                throw new IOException("Attribute value must be instance " +
                    "of CertificatePolicyId.");
        } else if (name.equalsIgnoreCase(QUALIFIERS)) {
            if (policyIdentifier == null) {
                throw new IOException("Attribute must have a " +
                    "CertificatePolicyIdentifier value before " +
                    "PolicyQualifierInfo can be set.");
            }
            if (obj instanceof Set) {
                Iterator<?> i = ((Set<?>)obj).iterator();
                while (i.hasNext()) {
                    Object obj1 = i.next();
                    if (!(obj1 instanceof PolicyQualifierInfo)) {
                        throw new IOException("Attribute value must be a" +
                                    "Set of PolicyQualifierInfo objects.");
                    }
                }
                policyQualifiers = (Set<PolicyQualifierInfo>) obj;
            } else {
                throw new IOException("Attribute value must be of type Set.");
            }
        } else {
            throw new IOException("Attribute name [" + name +
                "] not recognized by PolicyInformation");
        }
    }
1331408
public void setSemanticTypes(StringArray v) {
    if (OntClassMention_Type.featOkTst && ((OntClassMention_Type)jcasType).casFeat_semanticTypes == null)
      jcasType.jcas.throwFeatMissing("semanticTypes", "de.julielab.jules.types.OntClassMention");
    jcasType.ll_cas.ll_setRefValue(addr, ((OntClassMention_Type)jcasType).casFeatCode_semanticTypes, jcasType.ll_cas.ll_getFSRef(v));}
1186653
public Set entrySet() throws ObjectManagerException {
        return new AbstractSetView() {
            public long size() {
                return size;
            }

            public boolean contains(Object object) throws ObjectManagerException {
                if (object instanceof Map.Entry) {
                    Map.Entry entry = (Map.Entry) object;
                    Object v1 = get(entry.getKey()), v2 = entry.getValue();
                    return v1 == null ? v2 == null : v1.equals(v2);
                }
                return false;
            }

            public Iterator iterator() throws ObjectManagerException {
                return makeTreeMapIterator(new AbstractMapEntry.Type() {
                    public Object get(AbstractMapEntry entry) {
                        return entry;
                    }
                });
            }
        };
    }
727754
@Override
    public Model copy() {
        DefaultModel m = new DefaultModel(eb.copy());
        MappingUtils.fill(sm, m.getMapping());
        for (ModelView rc : parent.getViews()) {
            m.attach(rc.copy());
        }
        m.setAttributes(this.getAttributes().copy());
        return m;
    }
530951
private void setChildObjects(Object pParent, ObjectMapper pOM)
        throws SQLException {
        if (pOM == null) {
            throw new NullPointerException("ObjectMapper in readChildObjects "
                                           + "cannot be null!!");
        }

        for (Enumeration keys = pOM.mMapTypes.keys(); keys.hasMoreElements();) {
            String property = (String) keys.nextElement();
            String mapType = (String) pOM.mMapTypes.get(property);
	    
            if (property.length() <= 0 || mapType == null) {
                continue;
            }
	    
            // Get the id of the parent
            Object id = getPropertyValue(pParent, 
                                         pOM.getProperty(pOM.getPrimaryKey()));

            if (mapType.equals(ObjectMapper.OBJECTMAP)) {
                // OBJECT Mapping		

                // Get the class for this property
                Class objectClass = (Class) pOM.mClasses.get(property);
		
                DatabaseReadable dbr = null;
                try {
                    dbr = (DatabaseReadable) objectClass.newInstance();
                }
                catch (Exception e) {
                    mLog.logError(e);
                }
		
                /*
                  Properties mapping = readMapping(objectClass);
                */
		    
                // Get property mapping for child object
                if (pOM.mJoins.containsKey(property))
                    // mapping.setProperty(".join", (String) pOM.joins.get(property));
                    dbr.getMapping().put(".join", pOM.mJoins.get(property));
		
                // Find id and put in where hash
                Hashtable where = new Hashtable();

                // String foreignKey = mapping.getProperty(".foreignKey");
                String foreignKey = (String) 
                    dbr.getMapping().get(".foreignKey");

                if (foreignKey != null) {
                    where.put(".foreignKey", id);
                }

                Object[] child = readObjects(dbr, where);
                // Object[] child = readObjects(objectClass, mapping, where);

                if (child.length < 1)
                    throw new SQLException("No child object with foreign key "
                                           + foreignKey + "=" + id);
                else if (child.length != 1)
                    throw new SQLException("More than one object with foreign "
                                           + "key " + foreignKey + "=" + id);

                // Set child object to the parent
                setPropertyValue(pParent, property, child[0]);
            }
            else if (mapType.equals(ObjectMapper.COLLECTIONMAP)) {
                // COLLECTION Mapping

                // Get property mapping for child object
                Hashtable mapping = pOM.getPropertyMapping(property);

                // Find id and put in where hash
                Hashtable where = new Hashtable();
                String foreignKey = (String) mapping.get(".foreignKey");
                if (foreignKey != null) {
                    where.put(".foreignKey", id);
                }
		
                DBObject dbr = new DBObject();
                dbr.mapping = mapping; // ugh...
                // Read the objects
                Object[] objs = readObjects(dbr, where);

                // Put the objects in a hash
                Hashtable children = new Hashtable();
                for (int i = 0; i < objs.length; i++) {
                    children.put(((DBObject) objs[i]).getId(), 
                                 ((DBObject) objs[i]).getObject());
                }
		
                // Set child properties to parent object
                setPropertyValue(pParent, property, children);
            }
        }
    }
79044
@Override
    public OWLObject getValue() throws OWLException {
        try {
            return translate(ontopBinding.getValue());
        } catch (OntopResultConversionException e) {
            throw new OntopOWLException(e);
        }
    }
1079019
protected function setupObject()
    {
        $schemaType = strtoupper($this->getAttribute("type"));
        $this->copy($this->getDatabase()->getPlatform()->getDomainForType($schemaType));

        //Name
        $this->name = $this->getAttribute("name");

        // Default value
        $defval = $this->getAttribute("defaultValue", $this->getAttribute("default"));
        if ($defval !== null) {
            $this->setDefaultValue(new ColumnDefaultValue($defval, ColumnDefaultValue::TYPE_VALUE));
        } elseif ($this->getAttribute("defaultExpr") !== null) {
            $this->setDefaultValue(new ColumnDefaultValue($this->getAttribute("defaultExpr"), ColumnDefaultValue::TYPE_EXPR));
        }

        $this->size = $this->getAttribute("size");
        $this->scale = $this->getAttribute("scale");
        $this->description = $this->getAttribute("description");
    }
708689
@Override
    public ModelNode cloneModel()
    {
        int len = mSubModels.length;
        ModelNode[] newModels = new ModelNode[len];
        for (int i = 0; i < len; ++i) {
            newModels[i] = mSubModels[i].cloneModel();
        }
        return new ChoiceModel(newModels);
    }