Delete extensionAttribute.go and simplify undefined attributes

This commit is contained in:
2024-10-17 21:08:41 +02:00
parent 3172a4865a
commit b70ff82141
3 changed files with 16 additions and 36 deletions

View File

@@ -82,6 +82,12 @@ func isValidLanguageTag(tag LanguageTag) bool {
return err == nil
}
// isValidAttribute checks whether an Attribute is valid. It returns a bool.
func isValidAttribute(attribute string) bool {
regex := regexp.MustCompile(`^[a-zA-Z0-9_]+="[^"]*"$`)
return regex.MatchString(attribute)
}
// NewURN generates an new valid IRI based on a UUID. It returns an IRI.
func NewURN() IRI {
return IRI(fmt.Sprint("urn:uuid:", uuid.New()))