Skip to content

Commit

Permalink
Guard against URIs (not QNames) being used for tags.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed May 16, 2023
1 parent d28856b commit 9c440ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rdf/rdfxml/writer.rb
Expand Up @@ -259,6 +259,7 @@ def render_subject(subject, builder, **options, &block)
# The first type is used for
first_type = types.shift
type_qname = get_qname(first_type) if first_type
type_qname = nil unless type_qname.is_a?(String)
types.unshift(first_type) if first_type && !type_qname
type_qname ||= "rdf:Description"

Expand Down Expand Up @@ -619,7 +620,7 @@ def expand_curie(curie)
# Turn CURIE into a QNAME or return the RDF::URI
def get_qname(uri)
curie = get_curie(uri)
if curie.nil?
if curie.nil? || curie == ':'
uri
elsif curie.start_with?(":")
curie[1..-1]
Expand Down

0 comments on commit 9c440ca

Please sign in to comment.