:param string uri: :term:`URI` where the RDF data can be found.
    :rtype: rdflib.Graph or `False` if the URI does not exist
    :raises skosprovider.exceptions.ProviderUnavailableException: if the
        getty.edu services are down
358125
def uri_to_graph(uri, **kwargs):
    '''
    
    '''
    s = kwargs.get('session', requests.Session())
    graph = rdflib.Graph()
    try:
        res = s.get(uri)
    except requests.ConnectionError as e:
        raise ProviderUnavailableException("URI not available: %s" % uri)
    if res.status_code == 404:
        return False
    graph.parse(data=res.content)
    return graph
921426
Drawable getDrawableFromResourceUri(Uri uri) throws FileNotFoundException {
        String authority = uri.getAuthority();
        Resources r;
        if (TextUtils.isEmpty(authority)) {
            throw new FileNotFoundException("No authority: " + uri);
        } else {
            try {
                r = mContext.getPackageManager().getResourcesForApplication(authority);
            } catch (NameNotFoundException ex) {
                throw new FileNotFoundException("No package found for authority: " + uri);
            }
        }
        List<String> path = uri.getPathSegments();
        if (path == null) {
            throw new FileNotFoundException("No path: " + uri);
        }
        int len = path.size();
        int id;
        if (len == 1) {
            try {
                id = Integer.parseInt(path.get(0));
            } catch (NumberFormatException e) {
                throw new FileNotFoundException("Single path segment is not a resource ID: " + uri);
            }
        } else if (len == 2) {
            id = r.getIdentifier(path.get(1), path.get(0), authority);
        } else {
            throw new FileNotFoundException("More than two path segments: " + uri);
        }
        if (id == 0) {
            throw new FileNotFoundException("No resource found for: " + uri);
        }
        return r.getDrawable(id);
    }
451702
def url_from_rdf(rdf, prop):
    '''
    
    '''
    value = rdf.value(prop)
    if isinstance(value, (URIRef, Literal)):
        return value.toPython()
    elif isinstance(value, RdfResource):
        return value.identifier.toPython()
109933
def get(resource_uri)
      result = connection.get("resource") do |request|
        request.query[:uri] = resource_uri.to_s
        request.query.delete(:graph)
      end
      MaybeGraphResult.new(result).value
    end
928044
def resolveURI(self, URI):
        
        ret = libxml2mod.xmlACatalogResolveURI(self._o, URI)
        return ret
361138
def parseURIRaw(str, raw):
    
    ret = libxml2mod.xmlParseURIRaw(str, raw)
    if ret is None:raise uriError('xmlParseURIRaw() failed')
    return URI(_obj=ret)
198122
def goto(uri, headers = nil)
      uri = "http://#{uri}" unless uri =~ %r{://}

      request = HtmlUnit::WebRequest.new(::Java::JavaNet::URL.new(uri))

      request.setAdditionalHeaders(headers) if headers
      request.setCharset(@charset)

      rescue_status_code_exception do
        self.page = @webclient.getPage(request)
      end

      url()
    end
455060
def _get_subject_uri(self, guid=None):
        
        uri = self.uri + '/v1/subject'
        if guid:
            uri += '/' + urllib.quote_plus(guid)
        return uri
1246855
def do_get(self, uri):
        
        self.validate_resource_uri(uri)
        return self._connection.get(uri)
789707
def entry_by_uri(uri, options={})
      raise 'Error: Param uri is nil!' if uri.nil?

      begin
        url = url_for_uri(uri)
        url = append_query_params(url, options)
        client.get(url, options) do |response|
          return false if response.code == 404
          a_hash = parse(response)
          Resource::Entry.from_coach a_hash
        end
      rescue => e
        raise e if debug
        false
      end
    end
734597
public static Uri getUriFromResource(@NonNull Context context, @AnyRes int resId) throws Resources.NotFoundException {
        /** Return a Resources instance for your application's package. */
        Resources res = context.getResources();
        /**
         * Creates a Uri which parses the given encoded URI string.
         * @param uriString an RFC 2396-compliant, encoded URI
         * @throws NullPointerException if uriString is null
         * @return Uri for this given uri string
         */
        /** return uri */
        return Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE +
                "://" + res.getResourcePackageName(resId)
                + '/' + res.getResourceTypeName(resId)
                + '/' + res.getResourceEntryName(resId));
    }
1066920
def Uri(self):
		
		return ("%s://%s%s" % (("https", "http")[self._noSsl == True], self._name, (":" + str(self._port), "")[
			(((self._noSsl == False) and (self._port == 80)) or ((self._noSsl == True) and (self._port == 443)))]))
293061
def uri(self, value, strip_iri=True):
        

        return self.convert_to_uri(value, strip_iri=strip_iri)
378701
private static URI toUri(final URL u) {

        try {
            return u.toURI();
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException("Could not convert URL "+u+" to uri",e);
        }
    }
675560
def uri
      uri = %Q{#{self['rack.url_scheme']}://#{self['SERVER_NAME']}:#{self['SERVER_PORT']}#{self['REQUEST_URI']}}
      begin
        URI.parse(uri)
      rescue StandardError => e
        raise ArgumentError, "Invalid #{uri}", e.backtrace
      end
    end
1154482
def get_uri_obj(uri, storage_args={}):
    

    if isinstance(uri, BaseURI): return uri
    uri_obj = None

    o = urlparse(uri)
    for storage in STORAGES:
        uri_obj = storage.parse_uri(o, storage_args=storage_args)
        if uri_obj is not None:
            break
    #end for
    if uri_obj is None:
        raise TypeError('<{}> is an unsupported URI.'.format(uri))

    return uri_obj
1352823
def _resources_from_graph(graph, uris_and_graphs)
      repo = add_data_to_repository(graph)
      resources = []

      # TODO: ? if uris_and_graphs not passed in, we could get the
      # uris from the graph, and just not create the resoruces with a graph
      # (but they won't be persistable).

      uris_and_graphs.each do |(u,g)|

        # instantiate a new resource
        g ||= {}
        r = self.new(u, g)

        # make a graph of data for this resource's uri
        data_graph = RDF::Graph.new
        repo.query( [RDF::URI.new(u), :predicate, :object] ) do |statement|
          data_graph << statement

          if statement.object.is_a? RDF::Node
            repo.query( [statement.object, :predicate, :object] ) {|s| data_graph << s}
          end
        end

        # use it to hydrate this resource
        r.hydrate!(:graph => data_graph)
        r.new_record = false
        resources << r
      end

      resources
    end