Examples of Lang


Examples of org.apache.jena.riot.Lang

        IO.flush(System.out);
    }

    private void processFile(String filename, StreamRDF sink)
    {
        Lang lang = filename.equals("-") ? RDFLanguages.NQUADS : RDFLanguages.filenameToLang(filename, RDFLanguages.NQUADS) ;

        if ( filename.equals("-") )
            RDFDataMgr.parse(sink, System.in, null, RDFLanguages.NQUADS, null) ;
        else
            RDFDataMgr.parse(sink, filename) ;
View Full Code Here

Examples of org.apache.jena.riot.Lang

            String filename = getValue(argFile) ;
            log.info("Dataset: in-memory: load file: "+filename) ;
            if ( ! FileOps.exists(filename) )
                throw new CmdException("File not found: "+filename) ;

            Lang language = RDFLanguages.filenameToLang(filename) ;
            if ( language == null )
                throw new CmdException("Can't guess language for file: "+filename) ;
            InputStream input = IO.openFile(filename) ;
           
            if ( RDFLanguages.isQuads(language) )
View Full Code Here

Examples of org.apache.jena.riot.Lang

        ServletOutputStream output ;
        try { output = action.response.getOutputStream() ; }
        catch (IOException ex) { errorOccurred(ex) ; output = null ; }
       
        TypedOutputStream out = new TypedOutputStream(output, mediaType) ;
        Lang lang = WebContent.contentTypeToLang(mediaType.getContentType()) ;

        if ( action.verbose )
            log.info(format("[%d]   Get: Content-Type=%s, Charset=%s => %s",
                                  action.id, mediaType.getContentType(), mediaType.getCharset(), lang.getName())) ;

        action.beginRead() ;
        try {
            if ( log.isDebugEnabled() )
                log.debug("GET->"+action.getTarget()) ;
View Full Code Here

Examples of org.apache.jena.riot.Lang

    {
        // Yes - we ignore the charset.
        // 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 FusekiException("Unknown lang for "+ts.getMediaType()) ;
        RDFDataMgr.read(graph, base, lang) ;
    }   
View Full Code Here

Examples of org.apache.jena.riot.Lang

        {
            contentType = WebContent.contentTypeTextPlain ;
            charset = WebContent.charsetUTF8 ;
        }

        Lang lang = WebContent.contentTypeToLang(contentType) ;
        if ( lang == null )
            errorBadRequest("Can't determine output content type: "+contentType) ;
       
//        if ( rdfw instanceof RDFXMLWriterI )
//            rdfw.setProperty("showXmlDeclaration", "true") ;
View Full Code Here

Examples of org.apache.jena.riot.Lang

            error(HttpSC.UNSUPPORTED_MEDIA_TYPE_415, "multipart/mixed not supported") ;
            return null ;
        }

        int len = action.request.getContentLength() ;
        Lang lang = WebContent.contentTypeToLang(ct.getContentType()) ;
        if ( lang == null )
        {
            errorBadRequest("Unknown content type for triples: "+contentTypeHeader) ;
            return null ;
        }

        if ( action.verbose )
        {
            if ( len >= 0 )
                log.info(format("[%d]   Body: Content-Length=%d, Content-Type=%s, Charset=%s => %s",
                                      action.id, len, ct.getContentType(), ct.getCharset(), lang.getName())) ;
            else
                log.info(format("[%d]   Body: Content-Type=%s, Charset=%s => %s",
                                          action.id, ct.getContentType(), ct.getCharset(), lang.getName())) ;
        }
       
        try {
            InputStream input = action.request.getInputStream() ;
            boolean buffering = false ;
View Full Code Here

Examples of org.apache.jena.riot.Lang

        String source = update.getSource() ;
        Node dest = update.getDest() ;
        try {
            // Read into temporary storage to protect against parse errors.
            TypedInputStream s = RDFDataMgr.open(source) ;
            Lang lang = RDFLanguages.contentTypeToLang(s.getContentType()) ;
            if ( RDFLanguages.isTriples(lang) ) {
                // Triples
                Graph g = GraphFactory.createGraphMem() ;
                StreamRDF stream = StreamRDFLib.graph(g) ;
                RDFDataMgr.parse(stream, s, source) ;
View Full Code Here

Examples of org.apache.jena.riot.Lang

    {
        // Yes - we ignore the charset.
        // 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

Examples of org.apache.jena.riot.Lang

        if ( modLangParse.skipOnBadTerm() )
        {
            // TODO skipOnBadterm
        }
       
        Lang lang = selectLang(filename, ct, RDFLanguages.NQUADS)
        LangHandler handler = dispatch.get(lang) ;
        if ( handler == null )
            throw new CmdException("Undefined language: "+lang) ;
       
        // If multiple files, choose the overall labels.
View Full Code Here

Examples of org.foray.fotree.xml.prop.Lang

            throw new PropertyException("Invalid property for xml namespace: "
                    + propertyFullName);
        }
        switch (enumeration) {
        case LANG: {
            return new Lang(fobj, propertyFullName, attributeValue);
        }
        default: {
            return null;
        }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.