@@ -15,7 +15,6 @@ limitations under the License.
1515*/
1616
1717using System ;
18- using System . Text . RegularExpressions ;
1918
2019namespace RDFSharp . Model
2120{
@@ -25,11 +24,6 @@ namespace RDFSharp.Model
2524 public sealed class RDFNamespace : IEquatable < RDFNamespace >
2625 {
2726 #region Properties
28- /// <summary>
29- /// Regex for validation of prefixes
30- /// </summary>
31- internal static readonly Lazy < Regex > PrefixRegex = new Lazy < Regex > ( ( ) => new Regex ( @"^[a-zA-Z0-9_\-]+$" , RegexOptions . Compiled ) ) ;
32-
3327 /// <summary>
3428 /// Unique representation of the namespace
3529 /// </summary>
@@ -69,7 +63,7 @@ public RDFNamespace(string prefix, string uri)
6963
7064 //Prefix must contain only letters/numbers and cannot be "bnode" or "xmlns"
7165 string finalPrefix = prefix . Trim ( ) ;
72- if ( ! PrefixRegex . Value . Match ( finalPrefix ) . Success )
66+ if ( ! RDFModelShims . PrefixRegexShim . Match ( finalPrefix ) . Success )
7367 throw new RDFModelException ( "Cannot create RDFNamespace because \" prefix\" parameter contains unallowed characters" ) ;
7468 if ( finalPrefix . Equals ( "bnode" , StringComparison . OrdinalIgnoreCase ) || finalPrefix . Equals ( "xmlns" , StringComparison . OrdinalIgnoreCase ) )
7569 throw new RDFModelException ( "Cannot create RDFNamespace because \" prefix\" parameter cannot be \" bnode\" or \" xmlns\" " ) ;
@@ -110,7 +104,7 @@ public RDFNamespace SetDereferenceUri(Uri dereferenceUri)
110104 if ( dereferenceUri != null &&
111105 dereferenceUri . IsAbsoluteUri &&
112106 ! dereferenceUri . ToString ( ) . StartsWith ( "bnode:" , StringComparison . OrdinalIgnoreCase ) &&
113- ! dereferenceUri . ToString ( ) . StartsWith ( "xmlns:" , StringComparison . OrdinalIgnoreCase ) )
107+ ! dereferenceUri . ToString ( ) . StartsWith ( "xmlns:" , StringComparison . OrdinalIgnoreCase ) )
114108 {
115109 DereferenceUri = dereferenceUri ;
116110 }
0 commit comments