Returns the property that is the REST resource's "unique" name.

@param   {*}         data   - The parsed resource data.
@param   {object}    schema - The JSON schema for the data.
@returns {PropertyInfo}     - The resource's name.
963701
function getResourceName (data, schema) {
  // Try to find the "name" property using several different methods
  let propInfo =
        getResourceNameByValue(data, schema) ||
        getResourceNameByName(data, schema) ||
        getResourceNameByRequired(data, schema) ||
        getResourceNameByFile(data, schema);

  if (propInfo) {
    util.debug('The "%s" property (%j) appears to be the REST resource\'s name', propInfo.name, propInfo.value);

    if (propInfo.value === undefined) {
      propInfo.value = new JsonSchema(propInfo.schema).sample();
      util.debug('Generated new value (%j) for the "%s" property', propInfo.value, propInfo.name);
    }

    return propInfo;
  }
  else {
    util.debug("Unable to determine the unique name for the REST resource. Generating a unique value instead");
    return {
      name: "",
      schema: { type: "string" },
      value: _.uniqueId()
    };
  }
}
1028340
function initJsonSchema (args) {
    // get global validator instance
    var validator = this.global().validator
    // get schema id based on model name - must be globally unique
    this.schemaId = '/model/'+this.name
    // set option to perform schema validation on created/update
    this.validateSchema = args.validate === false ? false : true
    // create schema for model
    var schema = this.schemaMeta = {
        id: this.schemaId,
        properties: {},
        required: [],
        type: 'object',
    }
    // get data column
    var dataColumn = this.columnName('data')
    // create entry in schema for data if model has data
    if (dataColumn) {
        // schema id for data only
        this.schemaDataId = '/model/'+this.name+'/data'
        // create data schema - meta and data schemas are compiled without
        // ref so that the complete schemas can be easily sent to clients
        var schemaData = this.schemaData = schema.properties[dataColumn] = {
            additionalProperties: args.additionalProperties,
            id: this.schemaDataId,
            properties: {},
            type: 'object',
        }
        // merge schema from args over data schema
        _.merge(schemaData.properties, args.properties)
        // if required properties are set then add
        if (args.required) {
            // required must be array
            if (typeof args.required === 'string') {
                args.required = [args.required]
            }
            // throw error if not array
            assert.ok(Array.isArray(args.required), 'required must be array or string')
            // add list of required properties
            schemaData.required = args.required
        }
        // add data schema
        validator.addSchema(schemaData, this.schemaDataId)
    }
    // create schema for each default column
    _.each(this.defaultColumns, (defaultName, columnName) => {
        // skip data column which is already specified
        if (defaultName === 'data') {
            return
        }
        // get column spec
        var column = this.columns[columnName]
        // if there is not schema for type then skip
        if (!defaultSchemas[column.type]) {
            return
        }
        // get column schema
        var columnSchema = _.cloneDeep(defaultSchemas[column.type])
        // set default schema based on type
        schema.properties[columnName] = columnSchema
        // make property required unless nullable
        if (column.null === false) {
            schema.required.push(columnName)
        }
    })
    // add schema
    validator.addSchema(schema, this.schemaId)
}
703632
function getCustomProperty() {
  const type = NodeType.CustomPropertyType;
  const token = tokens[pos];
  const line = token.ln;
  const column = token.col;

  // Skip `--`
  pos += 2;

  const content = getIdentOrInterpolation();

  return newNode(type, content, line, column);
}
157265
function(schemaData) {
    var fields = [];

    if (schemaData &&
           'object' === typeof schemaData &&
           schemaData['fields'] &&
            Array.isArray(schemaData['fields'])) {
      schemaData['fields'].forEach((f) => {
        if (f['field'] && f['type'] && 'nested' !== f['type']) {
          fields.push(f['field']);
        }
      });

    }

    if (fields.length) {
      fields = fields.filter(this.uniqueFilter);
    }

    return fields;
  }
43067
function getSchema(connection) {
  connection.maxRows = Number.MAX_SAFE_INTEGER;
  const driver = drivers[connection.driver];
  return driver.getSchema(connection);
}
976098
function Schema(config, data) {
    const controllers = data.controllers;
    const length = controllers.length;

    this.FullyTyped = FullyTyped;

    // apply controllers to this schema
    for (let i = 0; i < length; i++) controllers[i].call(this, config);

    // add additional properties
    if (config._extension_ && typeof config._extension_ === 'object') {
        const self = this;
        Object.keys(config._extension_).forEach(function(key) {
            self[key] = config._extension_[key];
        });
    }

    // store protected data with schema
    const protect = Object.assign({}, data);

    // create and store hash
    const options = getNormalizedSchemaConfiguration(this);
    protect.hash = crypto
        .createHash('sha256')
        .update(JSON.stringify(prepareForHash(options)))
        .digest('hex');
    instances.set(this, protect);

    /**
     * @name Schema#config
     * @type {object}
     */
    Object.defineProperty(this, 'config', {
        get: function() {
            return util.copy(config);
        }
    });
}
1301529
function load(schema) {
  var obj;
  if (typeof schema == 'string' && schema !== 'null') {
    // This last predicate is to allow `avro.parse('null')` to work similarly
    // to `avro.parse('int')` and other primitives (null needs to be handled
    // separately since it is also a valid JSON identifier).
    try {
      obj = JSON.parse(schema);
    } catch (err) {
      if (~schema.indexOf('/')) {
        // This can't be a valid name, so we interpret is as a filepath. This
        // makes is always feasible to read a file, independent of its name
        // (i.e. even if its name is valid JSON), by prefixing it with `./`.
        obj = JSON.parse(fs.readFileSync(schema));
      }
    }
  }
  if (obj === undefined) {
    obj = schema;
  }
  return obj;
}
803648
function(resource_name, locale) {

		locale = locale || Lava.schema.LOCALE;

		return ((locale in this._resources) && (resource_name in this._resources[locale]))
			? this._resources[locale][resource_name]
			: null;

	}
869179
def get_unique_schema_id(schema):
    # type: (GraphQLSchema) -> str
    """"""
    assert isinstance(schema, GraphQLSchema), (
        "Must receive a GraphQLSchema as schema. Received {}"
    ).format(repr(schema))

    if schema not in _cached_schemas:
        _cached_schemas[schema] = sha1(str(schema).encode("utf-8")).hexdigest()
    return _cached_schemas[schema]
493049
function (data) {
    data = data || {};

    this.category = data.hasOwnProperty('category') ? data.category : 'No category';
    this.id = data.hasOwnProperty('id') ? data.id : '';
    this.group = data.hasOwnProperty('group') ? data.group : '';
    this.lines = data.hasOwnProperty('lines') ? data.lines : 0;
    this.name = data.hasOwnProperty('name') ? data.name : '';
    this.options = data.hasOwnProperty('options') ? data.options : {};
    this.origin = data.hasOwnProperty('origin') ? data.origin : '';
    this.resources = data.hasOwnProperty('resources') ? data.resources : Object.assign({}, getDefaultOptions().resources);
    this.usage = data.hasOwnProperty('usage') ? data.usage : [];
    this.viewId = data.hasOwnProperty('viewId') ? data.viewId : '';
}
597661
function getObjectByKey(data, prop) {
    if (!prop || !~prop.indexOf('.')) return data[prop];

    var result = prop
      , structure = data;

    for (var paths = prop.split('.'), i = 0, length = paths.length; i < length; i++) {
      result = structure[+paths[i] || paths[i]];
      structure = result;
    }

    return result || data[prop];
  }
90421
@Nonnull
  public final Schema getSchema (@Nonnull final IReadableResource aResource)
  {
    ValueEnforcer.notNull (aResource, "Resource");

    return getFromCache (new CommonsArrayList <> (aResource));
  }
306241
function(schemaName, schemaJSON) {
  if (typeof schemaName != 'string' || typeof schemaJSON != 'object') {
    console.error('redblade@schema parameter error')
    return
  }

  SCHEMA[schemaName] = initSchema(schemaJSON, schemaName)
}
631020
private function getSchemaPropertyName(Schema $property)
    {
        if (null === $this->schema) {
            return null;
        }

        foreach ($this->schema->getProperties() as $name => $schemaProperty) {
            if ($schemaProperty === $property) {
                return $name;
            }
        }

        return null;
    }
400265
function findDefinition(schema, ref) {
  var propertyPath = ref.split('/').slice(1); // Ignore the #/uri at the beginning.
  var currentProperty = propertyPath.splice(0, 1)[0];

  var currentValue = schema;

  while (currentProperty) {
    currentValue = currentValue[currentProperty];
    currentProperty = propertyPath.splice(0, 1)[0];
  }

  return currentValue;
}
291702
def schema(self):
        

        if self.headers is None:
            raise exceptions.NoResourceLoadedException(
                'Resource must be loaded to find schema')
        try:
            fields = self.specification.get('fields', {})
            parsed = {
                'primaryKey': 'id',
                'fields': [{
                        'name': header,
                        'type': fields[header]['type'],
                        'description': fields[header]['description']
                        } for header in self.headers]
                }
        except KeyError:
            raise exceptions.NotABudgetDataPackageException(
                'Includes other fields than the Budget Data Package fields')
        return parsed
235835
@GET
    @Path("/uniqueAttribute/type/{typeName}")
    @Consumes(Servlets.JSON_MEDIA_TYPE)
    @Produces(Servlets.JSON_MEDIA_TYPE)
    public AtlasEntityWithExtInfo getByUniqueAttributes(@PathParam("typeName") String typeName,
                                                        @Context HttpServletRequest servletRequest) throws AtlasBaseException {
        AtlasPerfTracer perf = null;

        try {
            Map<String, Object> attributes = getAttributes(servletRequest);

            if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
                perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "EntityREST.getByUniqueAttributes(" + typeName + "," + attributes + ")");
            }

            AtlasEntityType entityType = ensureEntityType(typeName);

            validateUniqueAttribute(entityType, attributes);

            return entitiesStore.getByUniqueAttributes(entityType, attributes);
        } finally {
            AtlasPerfTracer.log(perf);
        }
    }