Add id_ as an owl:AnnotationProperty
18160
def add_ap(self, id_, label=None, addPrefix=True):
        
        self.add_trip(id_, rdf.type, owl.AnnotationProperty)
        if label:
            self.add_trip(id_, rdfs.label, label)
            if addPrefix:
                prefix = ''.join([s.capitalize() for s in label.split()])
                namespace = self.expand(id_)
                self.add_namespace(prefix, namespace)
760818
public static void addPropertyIdList(
        CmsCmisTypeManager typeManager,
        PropertiesImpl props,
        String typeId,
        Set<String> filter,
        String id,
        List<String> value) {

        if (!checkAddProperty(typeManager, props, typeId, filter, id)) {
            return;
        }

        props.addProperty(new PropertyIdImpl(id, value));
    }
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)
572939
function addCustomFeatureProperties(entity) {
  for (var i = 0; i < customProperties.length; i++) {
    if (entity.propertyNames.indexOf(customProperties[i]) === -1) {
      entity.addProperty(customProperties[i]);
    }
  }
}
1165138
private Collection<RDFNode> getPropertyValues(Property property, Set<PropertyValuePair> annotationSet) {
        return annotationSet.stream()
                .filter(p -> p.getProperty().equals(property))
                .flatMap(p -> p.getValues().stream())
                .collect(Collectors.toList());
    }
251145
def cli(ctx, feature_id, symbol, organism="", sequence=""):
    
    return ctx.gi.annotations.set_symbol(feature_id, symbol, organism=organism, sequence=sequence)
367677
@Override
    public void addRelationIntoMetadata(Field relationField, EntityMetadata metadata)
    {
        // taking field's type as foreign entity, ignoring "targetEntity"
        Class<?> targetEntity = relationField.getType();

        ManyToOne ann = relationField.getAnnotation(ManyToOne.class);
        Relation relation = new Relation(relationField, targetEntity, null, ann.fetch(), Arrays.asList(ann.cascade()),
                ann.optional(), null, // mappedBy is null
                Relation.ForeignKey.MANY_TO_ONE);

        boolean isJoinedByFK = relationField.isAnnotationPresent(JoinColumn.class);

        if (relationField.isAnnotationPresent(AssociationOverride.class))
        {
            AssociationOverride annotation = relationField.getAnnotation(AssociationOverride.class);
            JoinColumn[] joinColumns = annotation.joinColumns();

            relation.setJoinColumnName(joinColumns[0].name());

        }
        else if (isJoinedByFK)
        {
            JoinColumn joinColumnAnn = relationField.getAnnotation(JoinColumn.class);
            relation.setJoinColumnName(StringUtils.isBlank(joinColumnAnn.name()) ? relationField.getName()
                    : joinColumnAnn.name());
        }
        else
        {
            relation.setJoinColumnName(relationField.getName());
        }

        relation.setBiDirectionalField(metadata.getEntityClazz());
        metadata.addRelation(relationField.getName(), relation);

    }
1112079
def __extractProperties(self):
        
        self.properties = [] # @todo: keep adding?
        self.annotationProperties = []
        self.objectProperties = []
        self.datatypeProperties = []

        qres = self.queryHelper.getAllProperties()

        for candidate in qres:

            test_existing_prop = self.getProperty(uri=candidate[0])
            if not test_existing_prop:
                # create it
                self.properties += [OntoProperty(candidate[0], candidate[1], self.namespaces)]
            else:
                # update it
                if candidate[1] and (test_existing_prop.rdftype == rdflib.RDF.Property):
                    test_existing_prop.rdftype = inferMainPropertyType(candidate[1])


        #add more data
        for aProp in self.properties:

            if aProp.rdftype == rdflib.OWL.DatatypeProperty:
                self.datatypeProperties += [aProp]
            elif aProp.rdftype == rdflib.OWL.AnnotationProperty:
                self.annotationProperties += [aProp]
            elif aProp.rdftype == rdflib.OWL.ObjectProperty:
                self.objectProperties += [aProp]
            else:
                pass

            aProp.triples = self.queryHelper.entityTriples(aProp.uri)
            aProp._buildGraph() # force construction of mini graph

            # attach to an ontology [2015-06-15: no property type distinction yet]
            for uri in aProp.getValuesForProperty(rdflib.RDFS.isDefinedBy):
                onto = self.getOntology(str(uri))
                if onto:
                    onto.properties += [aProp]
                    aProp.ontology = onto



            self.__buildDomainRanges(aProp)

            # add direct Supers
            directSupers = self.queryHelper.getPropDirectSupers(aProp.uri)

            for x in directSupers:
                superprop = self.getProperty(uri=x[0])
                if superprop:
                    aProp._parents.append(superprop)

                    # add inverse relationships (= direct subs for superprop)
                    if aProp not in superprop.children():
                         superprop._children.append(aProp)
1358935
public void addClassToId(final Class<?> clazz, final String id) {
        Assert.notNull(clazz, "Class cannot be null");
        Assert.hasText(id, "Alias (id) cannot be null or contain only whitespaces");

        if (classToId.containsKey(clazz)) {
            throw new IllegalArgumentException("Class " + clazz + " has already defined alias (id) " + classToId.get(clazz)
                    + " cannot set another alias " + id);
        }

        if (idToClass.containsKey(id)) {
            throw new IllegalArgumentException("Alias (id) " + id + " is used by another class " + idToClass.get(id)
                    + " and cannot be used by " + clazz);
        }

        classToId.put(clazz, id);
        idToClass.put(id, clazz);
    }
336977
def build_properties(self, hide_implicit_preds=True):
        
        self.all_properties = []  # @todo: keep adding?
        self.all_properties_annotation = []
        self.all_properties_object = []
        self.all_properties_datatype = []

        qres = self.sparqlHelper.getAllProperties(hide_implicit_preds)
        # print("rdflib query done")

        for candidate in qres:

            test_existing_prop = self.get_property(uri=candidate[0])
            if not test_existing_prop:
                # create it
                self.all_properties += [OntoProperty(candidate[0], candidate[1], self.namespaces)]
            else:
                # update it
                if candidate[1] and (test_existing_prop.rdftype == rdflib.RDF.Property):
                    test_existing_prop.rdftype = inferMainPropertyType(candidate[1])
        # print("properties created")

        # add more data
        for aProp in self.all_properties:
            # print("enriching prop..", aProp)
            if aProp.rdftype == rdflib.OWL.DatatypeProperty:
                self.all_properties_datatype += [aProp]
            elif aProp.rdftype == rdflib.OWL.AnnotationProperty:
                self.all_properties_annotation += [aProp]
            elif aProp.rdftype == rdflib.OWL.ObjectProperty:
                self.all_properties_object += [aProp]
            else:
                pass

            aProp.triples = self.sparqlHelper.entityTriples(aProp.uri)
            aProp._buildGraph()  # force construction of mini graph

            # attach to an ontology [2015-06-15: no property type distinction yet]
            for uri in aProp.getValuesForProperty(rdflib.RDFS.isDefinedBy):
                onto = self.get_ontology(uri=str(uri))
                if onto:
                    onto.all_properties += [aProp]
                    aProp.ontology = onto

            self.__buildDomainRanges(aProp)

            # add direct Supers
            directSupers = self.sparqlHelper.getPropDirectSupers(aProp.uri)

            for x in directSupers:
                superprop = self.get_property(uri=x[0])
                # note: extra condition to avoid recursive structures
                if superprop and superprop.uri != aProp.uri:
                    aProp._parents.append(superprop)

                    # add inverse relationships (= direct subs for superprop)
                    if aProp not in superprop.children():
                        superprop._children.append(aProp)

        # sort alphabetically
        self.all_properties = sorted(self.all_properties, key=lambda x: x.qname)

        # computer top layer for properties
        # print("calc toplayer")
        exit = []
        for c in self.all_properties:
            if not c.parents():
                exit += [c]
        self.toplayer_properties = exit
540520
public void parseProperty(Element propertyElement, ActivityImpl activity) {
    String id = propertyElement.attribute("id");
    String name = propertyElement.attribute("name");

    // If name isn't given, use the id as name
    if (name == null) {
      if (id == null) {
        addError("Invalid property usage on line " + propertyElement.getLine() + ": no id or name specified.", propertyElement);
      } else {
        name = id;
      }
    }

    String type = null;
    parsePropertyCustomExtensions(activity, propertyElement, name, type);
  }
1012067
def getAnnotations_via_id(self,
                              annotation_ids,
                              LIMIT=25,
                              _print=True,
                              crawl=False):
        """"""
        url_base = self.base_url + \
            '/api/1/term/get-annotation/{id}?key=' + self.api_key
        urls = [
            url_base.format(id=str(annotation_id))
            for annotation_id in annotation_ids
        ]
        return self.get(urls, LIMIT=LIMIT, _print=_print, crawl=crawl)
775917
private void addLoadPropertyIds(Object[] properties, int count) {
        addNewObjectArray(count);
        for (int i = 0; i != count; ++i) {
            cfw.add(ByteCode.DUP);
            cfw.addPush(i);
            Object id = properties[i];
            if (id instanceof String) {
                cfw.addPush((String)id);
            } else {
                cfw.addPush(((Integer)id).intValue());
                addScriptRuntimeInvoke("wrapInt", "(I)Ljava/lang/Integer;");
            }
            cfw.add(ByteCode.AASTORE);
        }
    }
749559
function addAnnotation(target, key, index, data) {
    const classAnnotationsStore = container.get(AnnotationsServiceName.ClassAnnotationsStore);
    if (index === undefined) {
        // property
        classAnnotationsStore.addPropertyAnnotation(target.constructor, key, Constraints, data);
    }
    else {
        // method parameter
        classAnnotationsStore.addMethodParameterAnnotation(target.constructor, key, index, Constraints, data);
    }
}
388339
private void onIdAttribute(final MetaModelBuilder builder, EntityMetadata entityMetadata, final Class clazz, Field f)
    {
        EntityType entity = (EntityType) builder.getManagedTypes().get(clazz);

        Attribute attrib = entity.getAttribute(f.getName());
        if (!attrib.isCollection() && ((SingularAttribute) attrib).isId())
        {
            entityMetadata.setIdAttribute((SingularAttribute) attrib);
            populateIdAccessorMethods(entityMetadata, clazz, f);
        }
    }
25687
def copyidfobject(self, idfobject):
        
        return addthisbunch(self.idfobjects,
                     self.model,
                     self.idd_info,
                     idfobject, self)
1082687
private function addAjaxPropertyForEditAll()
    {
        $inputProvider = $this->getEnvironment()->getInputProvider();

        if (('select' !== $inputProvider->getParameter('act'))
            && ('edit' !== $inputProvider->getParameter('select'))
            && ('edit' !== $inputProvider->getParameter('mode'))
        ) {
            return;
        }

        $originalProperty = $this->findOriginalPropertyByModelId($inputProvider->getValue('name'));
        if (null === $originalProperty) {
            return;
        }

        $propertiesDefinition = $this->getEnvironment()->getDataDefinition()->getPropertiesDefinition();

        $propertyClass = \get_class($originalProperty);

        $property = new $propertyClass($inputProvider->getValue('name'));
        $property->setLabel($originalProperty->getLabel());
        $property->setDescription($originalProperty->getDescription());
        $property->setDefaultValue($originalProperty->getDefaultValue());
        $property->setExcluded($originalProperty->isExcluded());
        $property->setSearchable($originalProperty->isSearchable());
        $property->setFilterable($originalProperty->isFilterable());
        $property->setWidgetType($originalProperty->getWidgetType());
        $property->setExplanation($originalProperty->getExplanation());
        $property->setExtra($originalProperty->getExtra());

        $propertiesDefinition->addProperty($property);
    }