When providing a schema and a prefix  the prefix has to be the schema ending with a dot.
494404
protected void ensurePrefixAndSchemaFitToegether(String prefix, String schema) {
    if (schema == null) {
      return;
    } else if (prefix == null || (prefix != null && !prefix.startsWith(schema + "."))) {
      throw new ProcessEngineException("When setting a schema the prefix has to be schema + '.'. Received schema: " + schema + " prefix: " + prefix);
    }
  }
720969
function resolvePrefixAndFile (nonAbsoluteFilePath, prefix) {
  // prefix is not absolute
  if (path.parse(prefix).root === '') {
    return path.resolve(process.cwd(), prefix, nonAbsoluteFilePath)
  }

  // prefix is absolute
  return path.resolve(prefix, nonAbsoluteFilePath)
}
809682
def add_shex(self, schema: str) -> "PrefixLibrary":
        
        if '\n' in schema or '\r' in schema or ' ' in schema:
            shex = schema
        else:
            shex = load_shex_file(schema)

        for line in shex.split('\n'):
            line = line.strip()
            m = re.match(r'PREFIX\s+(\S+):\s+<(\S+)>', line)
            if not m:
                m = re.match(r"@prefix\s+(\S+):\s+<(\S+)>\s+\.", line)
            if m:
                setattr(self, m.group(1).upper(), Namespace(m.group(2)))
        return self
647265
def schema_completer(prefix):
    
    from c7n import schema
    load_resources()
    components = prefix.split('.')

    if components[0] in provider.clouds.keys():
        cloud_provider = components.pop(0)
        provider_resources = provider.resources(cloud_provider)
    else:
        cloud_provider = 'aws'
        provider_resources = provider.resources('aws')
        components[0] = "aws.%s" % components[0]

    # Completions for resource
    if len(components) == 1:
        choices = [r for r in provider.resources().keys()
                   if r.startswith(components[0])]
        if len(choices) == 1:
            choices += ['{}{}'.format(choices[0], '.')]
        return choices

    if components[0] not in provider_resources.keys():
        return []

    # Completions for category
    if len(components) == 2:
        choices = ['{}.{}'.format(components[0], x)
                   for x in ('actions', 'filters') if x.startswith(components[1])]
        if len(choices) == 1:
            choices += ['{}{}'.format(choices[0], '.')]
        return choices

    # Completions for item
    elif len(components) == 3:
        resource_mapping = schema.resource_vocabulary(cloud_provider)
        return ['{}.{}.{}'.format(components[0], components[1], x)
                for x in resource_mapping[components[0]][components[1]]]

    return []
1279251
def schema_term(self):
        """"""

        if not self.name:
            raise MetapackError("Resource for url '{}' doe not have name".format(self.url))

        t = self.doc.find_first('Root.Table', value=self.get_value('name'))
        frm = 'name'

        if not t:
            t = self.doc.find_first('Root.Table', value=self.get_value('schema'))
            frm = 'schema'

        if not t:
            frm = None

        return t
700537
function someSchemasValidate(propName) {
    return schema[propName].some(function (possibleType) {
      var tempInput = {},
        tempSchema = {},
        tempErrs;

      tempInput[propName] = input[propName];
      tempSchema[propName] = possibleType;
      tempErrs = getErrs({
        input: tempInput,
        schema: tempSchema,
        optional: optional
      });

      return tempErrs.length === 0;
    });
  }
349126
def schema(root_url, service, name):
    """"""
    root_url = root_url.rstrip('/')
    name = name.lstrip('/')
    if root_url == OLD_ROOT_URL:
        return 'https://schemas.taskcluster.net/{}/{}'.format(service, name)
    else:
        return '{}/schemas/{}/{}'.format(root_url, service, name)
410572
def build_prefixes(namespaces=None):
    
    if namespaces is None:
        namespaces = [
            ('bf', str(BIBFRAME)),
            ('schema', str(SCHEMA_ORG))
        ]
    output = "PREFIX {}: <{}>\n".format(
        namespaces[0][0],
        namespaces[0][1])
    if len(namespaces) == 1:
        return output
    else:
        for namespace in namespaces[1:]:
            output += "PREFIX  {}: <{}>\n".format(namespace[0], namespace[1])
    return output
1166626
private String makeAlias(String prefix) {

        int i = 0;
        String result;
        do {
            if (i == 0) {
                result = prefix;
            } else {
                result = prefix + i;
            }

        } while (m_usedAliases.contains(result));
        m_usedAliases.add(result);
        return result;

    }
607244
function () {
    var str = '{';
    for (var i in this.schema){
      if (i == 'preset') continue;
      str += i + ': ';
      var type = this.schema[i].type;
      if (type == 'vec3') {
        str += '{ x: ' + this.data[i].x + ', y: ' + this.data[i].y + ', z: ' + this.data[i].z + '}';
      }
      else if (type == 'string' || type == 'color') {
        str += '"' + this.data[i] + '"';
      }
      else {
        str += this.data[i];
      }
      str += ', ';
    }
    str += '}';
    console.log(str);
  }
802722
private String fixPrefix(String prefix) {
		String fixedPrefix = prefix.startsWith("/") ? prefix : "/" + prefix;
		return fixedPrefix.endsWith("/") ? fixedPrefix : fixedPrefix + "/";
	}
362907
function compIndex(schema, root, baseId) {
  /* jshint validthis: true */
  for (var i=0; i<this._compilations.length; i++) {
    var c = this._compilations[i];
    if (c.schema == schema && c.root == root && c.baseId == baseId) return i;
  }
  return -1;
}
1279156
def is_prefix(pre_path, path):
    """"""
    pre_path = pre_path.strip('.')
    path = path.strip('.')
    return not pre_path or path.startswith(pre_path + '.')
1106652
function validate(doc, schema, prefix, options) {
  schema.validate(doc, prefix, options);
}
155492
function endCompiling(schema, root, baseId) {
  /* jshint validthis: true */
  var i = compIndex.call(this, schema, root, baseId);
  if (i >= 0) this._compilations.splice(i, 1);
}
346142
def namespace(self, prefix=None):
        
        ns = self.schema.tns
        if ns[0] is None:
            ns = (prefix, ns[1])
        return ns
725598
private String removePrefix(String key) {

        if (key.startsWith(PREFIX_TYPE)) {
            return key.substring(PREFIX_TYPE.length());
        }
        return key;
    }