lib/rdf/rdfxml/reader.rb
# Figure out the subject from the element.
Figure out the subject from the element.
Figure out the subject from the element .
def parse_subject(el, ec)
      old_property_check(el)
      nodeElementURI_check(el)
      about = el.attribute_with_ns("about", RDF.to_uri.to_s)
      id = el.attribute_with_ns("ID", RDF.to_uri.to_s)
      nodeID = el.attribute_with_ns("nodeID", RDF.to_uri.to_s)
      resource = el.attribute_with_ns("resource", RDF.to_uri.to_s)
      if nodeID && about
        add_error(el, "Cannot have rdf:nodeID and rdf:about.")
      elsif nodeID && id
        add_error(el, "Cannot have rdf:nodeID and rdf:ID.")
      end
      case
      when id
        add_debug(el) {"parse_subject, id: #{RDF::NTriples.unescape(id.value).inspect}"}
        id_check(el, RDF::NTriples.unescape(id.value), ec.base) 
      when nodeID
        nodeID = nodeID_check(el, RDF::NTriples.unescape(nodeID.value))
        add_debug(el) {"parse_subject, nodeID: #{nodeID.inspect}"}
        bnode(nodeID)
      when about
        about = RDF::NTriples.unescape(about.value)
        add_debug(el) {"parse_subject, about: #{about.inspect}"}
        uri(ec.base, about)
      when resource
        resource = RDF::NTriples.unescape(resource.value)
        add_debug(el) {"parse_subject, resource: #{resource.inspect}"}
        uri(ec.base, resource)
      else
        add_debug(el, "parse_subject, BNode")
        RDF::Node.new
      end
    end
def parse_subject ( el , ec ) old_property_check ( el ) nodeElementURI_check ( el ) about = el . attribute_with_ns ( "about" , RDF . to_uri . to_s ) id = el . attribute_with_ns ( "ID" , RDF . to_uri . to_s ) nodeID = el . attribute_with_ns ( "nodeID" , RDF . to_uri . to_s ) resource = el . attribute_with_ns ( "resource" , RDF . to_uri . to_s ) if nodeID && about add_error ( el , "Cannot have rdf:nodeID and rdf:about." ) elsif nodeID && id add_error ( el , "Cannot have rdf:nodeID and rdf:ID." ) end case when id add_debug ( el ) { "parse_subject, id: #{RDF::NTriples.unescape(id.value).inspect}" } id_check ( el , RDF :: NTriples . unescape ( id . value ) , ec . base ) when nodeID nodeID = nodeID_check ( el , RDF :: NTriples . unescape ( nodeID . value ) ) add_debug ( el ) { "parse_subject, nodeID: #{nodeID.inspect}" } bnode ( nodeID ) when about about = RDF :: NTriples . unescape ( about . value ) add_debug ( el ) { "parse_subject, about: #{about.inspect}" } uri ( ec . base , about ) when resource resource = RDF :: NTriples . unescape ( resource . value ) add_debug ( el ) { "parse_subject, resource: #{resource.inspect}" } uri ( ec . base , resource ) else add_debug ( el , "parse_subject, BNode" ) RDF :: Node . new end end
Figure out the subject from the element.
Figure out the subject from the element .
# Returns URI # The value of rdf:nodeID must match the XML Name production
el
<not_specific>
ec
<not_specific>