Package org.apache.jena.riot

Examples of org.apache.jena.riot.RiotException


                JsonUtils.writePrettyPrint(writer, obj) ;
            else
                JsonUtils.write(writer, obj) ;
        }
        catch (JsonLdError | JsonMappingException | JsonGenerationException e) {
            throw new RiotException(e) ;
        }
        catch (IOException e) {
            IO.exception(e) ;
        }
    }
View Full Code Here


        {
            Resource r = TestUtils.getResource(item, RDF.type) ;
            if ( r == null )
                r = dftTestType ;
            if ( r == null )
                throw new RiotException("Can't determine the test type") ;
           
            if ( labelPrefix != null )
                testName = labelPrefix+testName ;
           
            // In Turtle tests, the action directly names the file to process.
View Full Code Here

        // Either it's XML and so the XML parser deals with it, or the
        // language determines the charset and the parsers offer InputStreams.  
      
        Lang lang = WebContent.contentTypeToLang(ts.getContentType()) ;
        if ( lang == null )
            throw new RiotException("Unknown lang for "+ts.getMediaType()) ;
        RDFDataMgr.read(graph, ts, lang) ;
    }       
View Full Code Here

        @Override
        public void warning(String message, long line, long col)
        {}
        @Override
        public void error(String message, long line, long col)
        { throw new RiotException(fmtMessage(message, line, col)) ; }
View Full Code Here

        public void error(String message, long line, long col)
        { throw new RiotException(fmtMessage(message, line, col)) ; }

        @Override
        public void fatal(String message, long line, long col)
        { throw new RiotException(fmtMessage(message, line, col)) ; }
View Full Code Here

        public void error(String message, long line, long col)
        { output(message, line, col, "Error", "error") ; }
   
        @Override
        public void fatal(String message, long line, long col)
        { output(message, line, col, "Fatal", "error") ; throw new RiotException(fmtMessage(message, line, col)) ; }
View Full Code Here

     */
    private static IRI exceptions(IRI iri) {
        if ( !showExceptions ) return iri ;
        if ( ! iri.hasViolation(false) ) return iri ;
        String msg = iri.violations(false).next().getShortMessage() ;
        throw new RiotException(msg) ;
    }
View Full Code Here

    {
        if ( lang == null )
            lang = RDFLanguages.RDFXML ;
        String name = mapLangToWriterName.get(lang) ;
        if ( name == null )
            throw new RiotException("Not a triples language: "+lang) ;
        return dummy.getWriter(name) ;
    }
View Full Code Here

    private void checkTriple(Node subject, Node predicate, Node object, long line, long col)
    {
        if ( subject == null || ( ! subject.isURI() && ! subject.isBlank() ) )
        {
            errorHandler.error("Subject is not a URI or blank node", line, col) ;
            throw new RiotException("Bad subject: "+subject) ;
        }
        if ( predicate == null || ( ! predicate.isURI() ) )
        {
            errorHandler.error("Predicate not a URI", line, col) ;
            throw new RiotException("Bad predicate: "+predicate) ;
        }
        if ( object == null || ( ! object.isURI() && ! object.isBlank() && ! object.isLiteral() ) )
        {
            errorHandler.error("Object is not a URI, blank node or literal", line, col) ;
            throw new RiotException("Bad object: "+object) ;
        }
    }
View Full Code Here

    private void checkQuad(Node graph, Node subject, Node predicate, Node object, long line, long col)
    {
        if ( graph != null && ! graph.isURI() )
        {
            errorHandler.error("Graph name is not a URI", line, col) ;
            throw new RiotException("Bad graph name: "+graph) ;
        }       
        checkTriple(subject,predicate,object,line,col) ;
    }
View Full Code Here

TOP

Related Classes of org.apache.jena.riot.RiotException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.