Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-594

rdfcat silently ignores - as stdin if input type isn't specified

    XMLWordPrintableJSON

Details

    Description

      Treatment of content from standard in by - and /dev/stdin differs when format is not specified.

      Using -, non RDF/XML content is silently ignored. Specifying -n gets it treated correctly.

      $ echo '<s> <p> <o>' | rdfcat -
      <rdf:RDF
          xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      </rdf:RDF>
      
      $ echo '<s> <p> <o>' | rdfcat -n -
      <rdf:RDF
          xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
          xmlns:j.0="file:///home/taylorj/tmp/">
        <rdf:Description rdf:about="file:///home/taylorj/tmp/s">
          <j.0:p rdf:resource="file:///home/taylorj/tmp/o"/>
        </rdf:Description>
      </rdf:RDF>
      

      -n with /dev/stdin works, too. Using /dev/stdin with no format option blows up, though. (It's not silently ignored like - was)

      $ echo '<s> <p> <o>' | rdfcat -n /dev/stdin 
      <rdf:RDF
          xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
          xmlns:j.0="file:///dev/">
        <rdf:Description rdf:about="file:///dev/s">
          <j.0:p rdf:resource="file:///dev/o"/>
        </rdf:Description>
      </rdf:RDF>
      
      $ echo '<s> <p> <o>' | rdfcat /dev/stdin 
      11:46:21 WARN  riot                 :: {W104} Unqualified typed nodes are not allowed. Type treated as a relative URI.
      11:46:21 WARN  riot                 :: {W136} Relative URIs are not permitted in RDF: specifically <s>
      11:46:21 WARN  riot                 :: {W104} Unqualified property elements are not allowed. Treated as a relative URI.
      11:46:21 WARN  riot                 :: {W136} Relative URIs are not permitted in RDF: specifically <p>
      11:46:21 WARN  riot                 :: {W104} Unqualified typed nodes are not allowed. Type treated as a relative URI.
      11:46:21 WARN  riot                 :: {W136} Relative URIs are not permitted in RDF: specifically <o>
      11:46:21 ERROR riot                 :: XML document structures must start and end within the same entity.
      Exception in thread "main" org.apache.jena.riot.RiotException: XML document structures must start and end within the same entity.
              at org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:136)
      …
      

      Attachments

        Activity

          People

            andy Andy Seaborne
            taylorj Joshua Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: