Skip to content

Commit

Permalink
FIX Namespace prefix should also support "-" character (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco authored and Marco committed Dec 7, 2018
1 parent 58d7aaf commit 18995a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RDFSharp/Model/RDFNamespace.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public RDFNamespace(String prefix, String uri) {
if (prefix != null && prefix.Trim() != String.Empty) {
prefix = prefix.Trim();

if (Regex.IsMatch(prefix, @"^[a-zA-Z0-9_]+$")) {
if (Regex.IsMatch(prefix, @"^[a-zA-Z0-9_\-]+$")) {
if (prefix.ToUpperInvariant() == "BNODE" || prefix.ToUpperInvariant() == "XMLNS") {
throw new RDFModelException("Cannot create RDFNamespace because \"prefix\" parameter cannot be \"bnode\" or \"xmlns\"");
}
Expand Down

0 comments on commit 18995a6

Please sign in to comment.