Show / Hide Table of Contents

Class Tools

Tools class which contains a number of utility methods which are declared as static methods.

Inheritance
object
Tools
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public static class Tools

Methods

| Edit this page View Source

CombineHashCodes(params object[])

Does a quick and simple combination of the Hash Codes of two or more objects.

Declaration
public static int CombineHashCodes(params object[] objects)
Parameters
Type Name Description
object[] objects

The objects whose hash codes are to be combined.

Returns
Type Description
int
| Edit this page View Source

IsValidBaseUri(Uri)

Checks whether a Uri is valid as a Base Uri for resolving Relative URIs against.

Declaration
public static bool IsValidBaseUri(Uri baseUri)
Parameters
Type Name Description
Uri baseUri

Base Uri to test.

Returns
Type Description
bool

True if the Base Uri can be used to resolve Relative URIs against.

Remarks

A Base Uri is valid if it is an absolute Uri and not using the mailto: scheme.

| Edit this page View Source

ResolveQName(string, INamespaceMapper, Uri)

Resolves a QName into a Uri using the Namespace Mapper and Base Uri provided.

Declaration
public static string ResolveQName(string qname, INamespaceMapper nsmap, Uri baseUri)
Parameters
Type Name Description
string qname

QName to resolve.

INamespaceMapper nsmap

Namespace Map to resolve against.

Uri baseUri

Base Uri to resolve against.

Returns
Type Description
string
| Edit this page View Source

ResolveQName(string, INamespaceMapper, Uri, bool)

Resolves a QName into a Uri using the Namespace Mapper and Base Uri provided.

Declaration
public static string ResolveQName(string qname, INamespaceMapper nsmap, Uri baseUri, bool allowDefaultPrefixFallback)
Parameters
Type Name Description
string qname

QName to resolve.

INamespaceMapper nsmap

Namespace Map to resolve against.

Uri baseUri

Base Uri to resolve against.

bool allowDefaultPrefixFallback

Whether when the default prefix is used but not defined it can fallback to Base URI.

Returns
Type Description
string
| Edit this page View Source

ResolveUri(string, string, IUriFactory)

Generic Helper Function which Resolves Uri References against a Base Uri.

Declaration
public static string ResolveUri(string uriref, string baseUri, IUriFactory uriFactory = null)
Parameters
Type Name Description
string uriref

Uri Reference to resolve.

string baseUri

Base Uri to resolve against.

IUriFactory uriFactory

The factory to use to create the temporary URI created internally by this method. If not specified, defaults to Root.

Returns
Type Description
string

Resolved Uri as a String.

Exceptions
Type Condition
RdfParseException

RDF Parse Exception if the Uri cannot be resolved for a know reason.

UriFormatException

Uri Format Exception if one/both of the URIs is malformed.

| Edit this page View Source

ResolveUri(Uri, Uri)

Generic Helper Function which Resolves Uri References against a Base Uri.

Declaration
public static Uri ResolveUri(Uri uriref, Uri baseUri)
Parameters
Type Name Description
Uri uriref

Uri Reference to resolve.

Uri baseUri

Base Uri to resolve against.

Returns
Type Description
Uri

Resolved Uri as a String.

Exceptions
Type Condition
UriFormatException

Uri Format Exception if one/both of the URIs is malformed.

| Edit this page View Source

ResolveUriOrQName(IToken, INamespaceMapper, Uri)

Resolves a QName/Uri into a Uri using the Namespace Mapper and Base Uri provided.

Declaration
public static string ResolveUriOrQName(IToken t, INamespaceMapper nsmap, Uri baseUri)
Parameters
Type Name Description
IToken t

QName/Uri to resolve.

INamespaceMapper nsmap

Namespace Map to resolve against.

Uri baseUri

Base Uri to resolve against.

Returns
Type Description
string
| Edit this page View Source

StripUriFragment(Uri, IUriFactory)

Returns a URI with any Fragment ID removed from it.

Declaration
public static Uri StripUriFragment(Uri u, IUriFactory uriFactory = null)
Parameters
Type Name Description
Uri u

URI.

IUriFactory uriFactory

The factory to use to create the returned URI. If not specified, defaults to Root.

Returns
Type Description
Uri
  • Edit this page
  • View Source
In this article
  • Methods
    • CombineHashCodes(params object[])
    • IsValidBaseUri(Uri)
    • ResolveQName(string, INamespaceMapper, Uri)
    • ResolveQName(string, INamespaceMapper, Uri, bool)
    • ResolveUri(string, string, IUriFactory)
    • ResolveUri(Uri, Uri)
    • ResolveUriOrQName(IToken, INamespaceMapper, Uri)
    • StripUriFragment(Uri, IUriFactory)
Back to top Generated by DocFX