Gets primary topic for a uri.  foaf : primaryTopic is check for or <#this>
@param  {object} store an rdflib store
@param  {string} uri   a uri
@return {string} the primary topic or null
333003
function primaryTopic(store, uri) {
  var ret
  var pred

  var FOAF = $rdf.Namespace("http://xmlns.com/foaf/0.1/")

  var ret = store.any($rdf.sym(uri), FOAF('primaryTopic'), null, $rdf.sym(uri))

  if (!ret) {
    var sub = $rdf.sym(uri + '#this')
    pred = store.any(sub, null, null, $rdf.sym(uri))
    if (pred) {
      ret = sub.uri
    }
  } else {
    ret = ret.uri
  }

  return ret
}
336158
private URI getBaseURI(URI configKey) throws URISyntaxException {
    return new URI(configKey.getScheme(), configKey.getAuthority(), null, configKey.getQuery(), configKey.getFragment());
  }
1028255
function isAncestorTopic (topic, node) {
    var nodeTopic = getTopic(node);

    return topic === nodeTopic
      || startsWith(topic, nodeTopic + '.')
      || nodeTopic === '';
  }
240479
function get(key, store = getDefaultStore()) {
  let req
  return store[IDBStore]('readonly', store => {
    req = store.get(key)
  }).then(() => req.result)
}
1303529
protected static String getResource(Uri uri) {
        if (!isAPIUri(uri)) {
            return null;
        }

        String scheme = uri.getScheme();
        String apiScheme = getBaseUri().getScheme();

        // Strip out the protocol and store the result in the "remainder" variable
        String remainder = uri.toString().substring(scheme.length());

        // Strip out the protocol from the base URI
        String apiRemainder = getBaseUri().toString().substring(apiScheme.length());

        // Check that the remainder starts with the apiRemainder
        if (!remainder.startsWith(apiRemainder)) {
            return null;
        }

        // Return the path, stripped out of the base uri's path
        return uri.getPath().substring(getBaseUri().getPath().length());
    }
341144
function CacheStore(options) {
    if (!options.id) {
        throw new IdNotDefinedError();
    }
    var storeType, _cache;

    function parseKey(key) {
        return key.replace(/[^a-z0-9]/gi, '_').replace(/^-+/, '').replace(/-+$/, '').toLowerCase();
    }

    /**
     * Returns Cache Store object
     * @returns {Object}
     */
    this.getCacheStore = function () {
        return _cache;
    };

    /**
     * Method initiates cache store depends on type
     * @param type {String} cache store type
     * @returns {CacheStore}
     */
    this._setStoreType = function (type) {
        storeType = type;
        var ttl = options.expires || DEFAULT_EXPIRATION_TIME;
        options.max = options.max || 0; //makes lru cache to store infinite no of items
        switch (type) {
            case STORE_TYPE_MEMORY:
                _cache = CacheManager.caching({store: STORE_TYPE_MEMORY, max: options.max, ttl: ttl});
                break;

            case STORE_TYPE_REDIS:
                _cache = CacheManager.caching({store: RedisStore, db: options.db, ttl: ttl, host: options.host,
                    port: options.port, id: options.id
                });
                break;

            default :
                throw new InvalidCacheStoreTypeError(type);

        }
        //exposing delete method alias of _del
        _cache.delete = _cache.del;
        return this;
    };

    //setting public functions
    /**
     * Gets cache item
     * @param key {String} Key to retrieve cache item
     * @param next {Function} callback. parameters are err, value
     */
    this.get = function (key, next) {
        _cache.get(parseKey(key), next);
    };

    /**
     * Sets cache item in cache.
     * @param key {String} Key to retrieve cache item
     * @param value {String} Value to save cache item
     * @param next {Function} callback. parameters are err
     */
    this.set = function (key, value, next) {
        _cache.set(parseKey(key), value, next);
    };

    /**
     * Delete from cache
     * @param key {String} Key to retrieve cache item
     * @param next {Function} callback. parameters are err
     */
    this.delete = function (key, next) {
        _cache.del(parseKey(key), next);
    };

    /**
     * Wraps a function in cache, the first time the function is run,
     * its results are stored in cache so subsequent calls retrieve from cache
     * instead of calling the function.
     *
     * @example
     *
     *      var key = 'user_' + user_id;
     *      cache.wrap(key, function(cb) {
     *          User.get(user_id, cb);
     *      }, function(err, user) {
     *         console.log(user);
     *      });
     *
     * @param key {String} Key to retrieve cache item
     * @param wrapFn
     * @param next {Function} callback. parameters are err, value
     */
    this.wrap = function (key, wrapFn, next) {
        _cache.wrap(parseKey(key), wrapFn, next);
    };

    /**
     * Flushes the current cache store
     * @param next {Function} callback. parameters are err, success
     */
    this.reset = function (next) {
        _cache.reset(next);
    };

    /**
     * Gets all keys associated with this cache store
     * @param next {Function} callback. parameters are err, keys
     */
    this.keys = function (next) {
        _cache.keys(next);
    };
}
247903
function(url) {
		var query = getQueryString(url);
		for (var name in query) {
			if (query[name] === '?') {
				return name;
			}
		}
		return null;
	}
468143
def load_uri(self, uri, verbose):
        

        if verbose: printDebug("----------")
        if verbose: printDebug("Reading: <%s>" % uri)
        success = False
        for f in self.rdf_format_opts:
            if verbose: printDebug(".. trying rdf serialization: <%s>" % f)
            try:
                self.rdfgraph.parse(uri, format=f)
                if verbose: printDebug("..... success!", bold=True)
                success = True
                self.sources_valid += [uri]
                break
            except:
                if verbose: printDebug("..... failed")

        if not success == True:
            self.loading_failed(self.rdf_format_opts)
            self.sources_invalid += [uri]
1020314
function site(bidderRequest) {
  const pubId = bidderRequest && bidderRequest.length > 0 ? bidderRequest[0].params.cp : '0';
  const appParams = bidderRequest[0].params.app;
  if (!appParams) {
    return {
      publisher: {
        id: pubId.toString(),
      },
      ref: referrer(),
      page: utils.getTopWindowLocation().href,
    }
  }
  return null;
}
595051
String getURI (String prefix)
    {
        if ("".equals(prefix)) {
            return defaultNS;
        } else if (prefixTable == null) {
            return null;
        } else {
            return (String)prefixTable.get(prefix);
        }
    }
25310
public E get(String uri) {
		
		if(map==empty)
			return null;
		
		synchronized (map) {
			return map.get(uri);
		}
	}
819823
@Sensitive
    private String getStoredReq(HttpServletRequest req, ReferrerURLCookieHandler referrerURLHandler) {
        String storedReq = referrerURLHandler.getReferrerURLFromCookies(req, ReferrerURLCookieHandler.REFERRER_URL_COOKIENAME);
        if (storedReq != null) {
            if (storedReq.equals("/"))
                storedReq = "";
            else if (storedReq.startsWith("/"))
                storedReq = storedReq.substring(1);
        } else {
            storedReq = "";
        }
        return storedReq;
    }
1163854
function listRemote(store, attrs) {
      // Request url data
      if(store.url) {
        var xhr = new XMLHttpRequest();
        xhr.open("GET", store.url, true);
        xhr.setRequestHeader("Content-Type", "application/json");
        // Callback
        xhr.onload = function(e) {
          // If operation has been completed - ready state 4
          if (xhr.readyState === 4) {
            // Response status succesfully completed - status 200
            if (xhr.status === 200) {
              // Set up store
              store._setUpData(xhr.response);
              // Remove unnecesary arguments for the list process
              delete attrs[0];
              // Update store data items length
              store.size = Object.keys(store.data.asObject()).length;
              // Process store data filters and lists
              StoreMemory.processData(store, attrs);
              // Trigger user callback once data has been retrieved
              vcomet.triggerCallback("onListRemote", store);
            } else {
              // Request error output
              vcomet.error.log(xhr.statusText);
            }
          }
        };
        // Execute request
        store.onLoaded(function(){xhr.send()});
        
      }
    }
506229
function (uris) {
                uris.forEach(function (u) {
                  console.log('Dropped on group: ' + u)
                  var thing = kb.sym(u)
                  var toBeFetched = [thing.doc(), group.doc()]

                  kb.fetcher.load(toBeFetched).then(function (xhrs) {
                    var types = kb.findTypeURIs(thing)
                    for (var ty in types) {
                      console.log('    drop object type includes: ' + ty) // @@ Allow email addresses and phone numbers to be dropped?
                    }
                    if (ns.vcard('Individual').uri in types || ns.vcard('Organization').uri in types) {
                      var pname = kb.any(thing, ns.vcard('fn'))
                      if (!pname) return alert('No vcard name known for ' + thing)
                      var already = kb.holds(group, ns.vcard('hasMember'), thing, group.doc())
                      if (already) return alert('ALREADY added ' + pname + ' to group ' + name)
                      var message = 'Add ' + pname + ' to group ' + name + '?'
                      if (confirm(message)) {
                        var ins = [ $rdf.st(group, ns.vcard('hasMember'), thing, group.doc()),
                          $rdf.st(thing, ns.vcard('fn'), pname, group.doc())]
                        kb.updater.update([], ins, function (uri, ok, err) {
                          if (!ok) return complain('Error adding member to group ' + group + ': ' + err)
                          console.log('Added ' + pname + ' to group ' + name)
                          // @@ refresh UI
                        })
                      }
                    }
                  }).catch(function (e) {
                    complain('Error looking up dropped thing ' + thing + ' and group: ' + e)
                  })
                })
              }
1097144
function get(name) {
    validateArgumentsLength(arguments.length, 1);
    var entries = getInternalParamsState(this).entries;
    var key = name + '';
    var i = 0;
    for (; i < entries.length; i++) if (entries[i].key === key) return entries[i].value;
    return null;
  }
894329
@Nullable
    private Record getRecord(final URI layer, @Nullable final URI id) throws Throwable {
        final Record record = id == null ? null : getSession().retrieve(layer).ids(id).exec()
                .getUnique();
        if (record != null && layer.equals(KS.MENTION)) {
            final String template = "SELECT ?e WHERE { ?e $$ $$ "
                    + (getUIConfig().isDenotedByAllowsGraphs() ? ""
                            : "FILTER NOT EXISTS { GRAPH ?e { ?s ?p ?o } } ") + "}";
            for (final URI entityID : getSession()
                    .sparql(template, getUIConfig().getDenotedByProperty(), id).execTuples()
                    .transform(URI.class, true, "e")) {
                record.add(KS.REFERS_TO, entityID);
            }
        }
        return record;
    }
1193941
function is(store, uri, type) {
  var ret = false

  var types = store.findTypeURIs($rdf.sym(uri))

  if (types && types[type]) {
    ret = true
  }

  return ret
}