Concept class.

A wrapper for the SKOS Concept JSON object

@constructor
@param {Object} concept - A Concept JSON object
490175
function Concept(concept) {
  if (!(concept.prefLabel && concept.id && concept.type === 'Concept')) {
    throw new Error('Invalid concept: "' + concept.id + '"');
  }
  this.id = concept.id;
  this.prefLabel = concept.prefLabel;
  this.altLabel = concept.altLabel;
  this.hiddenLabel = concept.hiddenLabel;
  this.definition = concept.definition;
  this._topConceptOf = concept.topConceptOf;
  this._partOfScheme = false;
  this._originalConcept = concept;
  this._broaderConcepts = [];
  this._narrowerConcepts = [];
  this._relatedConcepts = [];
}
540608
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof Identifiers)){
    return new Identifiers(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(Identifiers.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
930827
function( cls ) {
				var classes = this.getCustomData( 'classes' );
				if ( !this.hasClass( cls ) ) {
					!classes && ( classes = [] ), classes.push( cls );
					this.setCustomData( 'classes', classes );
					this.addClass( cls );
				}
			}
1245364
function preview(name, content) {
  console.log('=======');
  console.log('JSON SCHEMA PREVIEW BEGIN: ' + name);
  console.log('=======');
  console.log(JSON.stringify(content, null, 2));
  console.log('=======');
  console.log('JSON SCHEMA PREVIEW END: ' + name);
  return Promise.resolve();
}
76690
function(objects) {
      if (!_.isArray(objects)) {
        objects = [objects];
      }

      var change = new Parse.Op.Relation(objects, []);
      this.parent.set(this.key, change);
      this.targetClassName = change._targetClassName;
    }
210457
def transform_deprecated_concepts(rdf, cs):
    """"""

    deprecated_concepts = []

    for conc in rdf.subjects(RDF.type, SKOSEXT.DeprecatedConcept):
        rdf.add((conc, RDF.type, SKOS.Concept))
        rdf.add((conc, OWL.deprecated, Literal("true", datatype=XSD.boolean)))
        deprecated_concepts.append(conc)

    if len(deprecated_concepts) > 0:
        ns = cs.replace(localname(cs), '')
        dcs = create_concept_scheme(
            rdf, ns, 'deprecatedconceptscheme')
        logging.debug("creating deprecated concept scheme %s", dcs)
        for conc in deprecated_concepts:
            rdf.add((conc, SKOS.inScheme, dcs))
348595
function Class(name,options) {

  this.name = name || "";
  this.mixins = [];
  this.methods = {};
  this.properties = {};

  if (lib.type.isObject(options)) {
    var keys = Object.keys(options);
    var length = keys.length;
    for (var i = 0; i < length; i++) {
      var key = keys[i];
      var value = options[key];
      if (key === "constructor") {
        this.addConstructor(value);
      } else if (key === "inherits") {
        this.inherit(value);
      } else if (key === "mixins") {
        this.mixin(value);
      } else if (lib.type.isFunction(value) && lib.inherits.superOf(value,Property)) {
        this.addProperty(key,value);
      } else {
        this.addMethod(key,value);
      }
    }
  }

}
302794
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof Event)){
    return new Event(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(Event.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
749164
def concept(self, cid, **kwargs):
        '''  '''
        if cid not in self.__concept_map:
            if 'default' in kwargs:
                return kwargs['default']
            else:
                raise KeyError("Invalid cid")
        else:
            return self.__concept_map[cid]
202430
def add_concept_filter(self, concept, concept_name=None):
        
        if concept in self.query_params.keys():
            if not concept_name:
                concept_name = concept
            if isinstance(self.query_params[concept], list):
                if self.es_version == '1':
                    es_filter = {'or': []}
                    for or_filter in self.query_params[concept]:
                        es_filter['or'].append(self._build_concept_term(concept_name, or_filter))
                else:
                    es_filter = {"bool": {"should": []}}
                    for or_filter in self.query_params[concept]:
                        es_filter["bool"]["should"].append(self._build_concept_term(concept_name, or_filter))
            else:
                es_filter = self._build_concept_term(concept_name, self.query_params[concept])
            self.filters.append(es_filter)
576131
function constructor(attributes, options) {
      var hooks = []
        , local = {};

      options = options || {};

      //
      // Set the database name and/or urlRoot if provided in the options.
      //
      if (options.database) this.database = options.database;
      if (options.urlRoot) this.urlRoot = options.urlRoot;

      //
      // Copy attributes to a new object and provide a MongoDB OfbjectID.
      //
      attributes = attributes || {};
      for (var key in attributes) local[key] = attributes[key];

      //
      // If the provided `_id` is an ObjectID assume the model is stored.
      // If it is not an ObjectID, remove it from the provided data.
      // MongoDB will provide an ObjectID by default.
      //
      if ('_id' in local) try {
        local._id = new ObjectID(local._id);
      } catch (error) { delete local._id; }

      //
      // Define restricted non-enumerated properties.
      //
      predefine(this, fossa);

      //
      // Check for presence of before/after hooks and setup.
      //
      if (this.before) hooks.push('before');
      if (this.after) hooks.push('after');
      this.setup(hooks);

      //
      // Call original Backbone Model constructor.
      //
      backbone.Model.call(this, local, options);
    }
312966
public void addChild(Concept concept) {
        if (taxonomy != concept.taxonomy) {
            throw new IllegalArgumentException("Concepts are not from the same taxonomy.");
        }

        if (children == null) {
            children = new ArrayList<>();
        }
        
        children.add(concept);
        concept.parent = this;
    }
441194
def new_concept(self, tag, clemma="", tokens=None, cidx=None, **kwargs):
        ''' 
        '''
        if cidx is None:
            cidx = self.new_concept_id()
        if tokens:
            tokens = (t if isinstance(t, Token) else self[t] for t in tokens)
        c = Concept(cidx=cidx, tag=tag, clemma=clemma, sent=self, tokens=tokens, **kwargs)
        return self.add_concept(c)
1206993
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof SourceCitation)){
    return new SourceCitation(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(SourceCitation.isInstance(json)){
    return json;
  }
  
  this.init(json);
}
339852
function createAbstractClass(params, constructor) {
        var def,
            savedMembers,
            key,
            value;

        // Handle abstract methods
        if (hasOwn(params, '$abstracts')) {
            savedMembers = params.$abstracts;
            delete params.$abstracts;
        }

        // Create the class definition
        def = Class.$create(params, constructor);
        def[$abstract] = true;

        // Grab binds
        if (savedMembers) {
            for (key in savedMembers) {
                value = savedMembers[key];

                if (value[$bound]) {
                    insert(def[$class].binds, key);
                }
            }
        }

        return def;
    }
760927
public void cacheConcept(Concept concept) {
        conceptCache.put(concept.id(), concept);
        if (concept.isSchemaConcept()) {
            SchemaConcept schemaConcept = concept.asSchemaConcept();
            schemaConceptCache.put(schemaConcept.label(), schemaConcept);
            labelCache.put(schemaConcept.label(), schemaConcept.labelId());
        }
    }
1212821
function(json){
  
  // Protect against forgetting the new keyword when calling the constructor
  if(!(this instanceof PlaceDescription)){
    return new PlaceDescription(json);
  }
  
  // If the given object is already an instance then just return it. DON'T copy it.
  if(PlaceDescription.isInstance(json)){
    return json;
  }
  
  this.init(json);
}