Utility Methods
The library provides a number of useful utility methods embodied in a single static VDS.RDF.Tools class which is part of the VDS.RDF namespace. Anywhere you reference VDS.RDF
you'll be able to use the static methods described in this article.
IsValidBaseUri
The IsValidBaseUri(Uri baseUri) method is used to determine whether a URI is valid to be used as a Base URI for resolving relative URIs against. In practise this means that the URI must be absolute and not using the mailto scheme.
Note that this method is only used when it is necessary to resolve a relative URI against a Base URI. It is perfectly acceptable to have a Base URI against which you cannot resolve relative URIs providing no relative URIs are used.
ResolveQName
The ResolveQName(String qname, INamespaceMapper nsmap, Uri baseUri) function is used to resolve a prefixed name to a URI in the context of the given VDS.RDF.INamespaceMapper and Base URI. This is primarily used internally in some of the Parsers and in IUriNode creation.
ResolveUri
The ResolveUri(String uriref, String baseUri, IUriFactory factory = null) method is used to resolve a URI Reference (a relative/absolute URI or a fragment identifier) against a a given Base URI.
It is used internally by most of the Parsers.
The IUriFactory
argument is optional. Omitting it or passing null will use the URI factory instance for creating the returned URI.
ResolveUriOrQName
The ResolveUriOrQName(IToken t, INamespaceMapper nsmap, Uri baseUri) method is used to resolve a UriToken or a QNameToken into a URI in the context of the given INamespaceMapper and Base URI. Again this method is used internally in some of the Parsers.
StripUriFragment
The StripUriFragment(Uri uri, IUriFactory factory = null) is used to return a new URI generated by removing the fragment part from the input URI.
The IUriFactory
argument is optional. Omitting it or passing null will use the URI factory instance for creating the returned URI.