Examples of Lang


Examples of org.apache.jena.riot.Lang

//        if ( false )
//            SetupTDB.makeNodeTable(location, locationString, 0, outputFile, 0) ;

        for( String filename : datafiles)
        {
            Lang lang = RDFLanguages.filenameToLang(filename, RDFLanguages.NQUADS) ;
            if ( lang == null )
                // Does not happen due to default above.
                cmdError("File suffix not recognized: " +filename) ;
            if ( ! FileOps.exists(filename) )
                cmdError("File does not exist: "+filename) ;
View Full Code Here

Examples of org.apache.jena.riot.Lang

            bitbucket = true ;
        }

        if ( cmdLine.contains(argSyntax) ) {
            String syntax = cmdLine.getValue(argSyntax) ;
            Lang lang$ = RDFLanguages.nameToLang(syntax) ;
            if ( lang$ == null )
                throw new CmdException("Can not detemine the synatx from '" + syntax + "'") ;
            this.lang = lang$ ;
        }
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 = RDFDataMgr.determineLang(source, s.getContentType(), null) ;
           
            if ( RDFLanguages.isTriples(lang) ) {
                // Triples
                Graph g = GraphFactory.createGraphMem() ;
                StreamRDF stream = StreamRDFLib.graph(g) ;
View Full Code Here

Examples of org.apache.jena.riot.Lang

        }
       
        boolean allTriples = true ;
        for ( String url : urls )
        {
            Lang lang = RDFLanguages.filenameToLang(url, RDFLanguages.NQUADS) ;
            if ( lang != null && RDFLanguages.isQuads(lang) )
            {
                allTriples = false ;
                break ;
            }
        }
       
        if ( allTriples && graphName == null )
        {
            loadDefaultGraph(urls) ;
            return ;
        }
       
        if ( graphName == null )
        {
            loadQuads(urls) ;
            return ;
        }

        // graphName != null
        if ( ! allTriples )
        {
            for ( String url : urls )
            {
                Lang lang = RDFLanguages.filenameToLang(url, RDFLanguages.NQUADS) ;
                if ( lang == null )
                    // Does not happen due to default above.
                    cmdError("File suffix not recognized: " +url) ;
                if ( lang != null && ! RDFLanguages.isTriples(lang) )
                    cmdError("Can only load triples into a named model: "+url) ;
View Full Code Here

Examples of org.apache.jena.riot.Lang

    {
        if ( false )
        {
            for ( String url : urls )
            {
                Lang lang = RDFLanguages.filenameToLang(url) ;
                if ( lang != null && RDFLanguages.isQuads(lang) )
                    throw new TDBException("Not a triples language") ;
            }
        }
View Full Code Here

Examples of org.apache.jena.riot.Lang

            try {
                Graph g = GraphFactory.createDefaultGraph() ;
                HttpEntity entity = response.getEntity() ;
                // org.apache.http.entity.ContentType ;
                String ct = contentType(response) ;
                Lang lang = RDFLanguages.contentTypeToLang(ct) ;
                StreamRDF dest = StreamRDFLib.graph(g) ;
                InputStream in = entity.getContent() ;
                RDFDataMgr.parse(dest, in, baseIRI, lang) ;
                in.close() ;
                this.graph = g ;
View Full Code Here

Examples of org.apache.jena.riot.Lang

            bitbucket = true ;
        }

        if ( cmdLine.contains(argSyntax) ) {
            String syntax = cmdLine.getValue(argSyntax) ;
            Lang lang$ = RDFLanguages.nameToLang(syntax) ;
            if ( lang$ == null )
                throw new CmdException("Can not detemine the synatx from '" + syntax + "'") ;
            this.lang = lang$ ;
        }
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

    @Override
    public RDFReader getReader(String langname)
    {
        // If RDF/XML, then return an ARP
       
        Lang lang = RDFLanguages.nameToLang(langname) ;
        if ( RDFLanguages.RDFXML.equals(lang) )
            return new RDFReaderRIOT_ARP() ;
        return new RDFReaderRIOT(langname) ;
    }
View Full Code Here

Examples of org.apache.jena.riot.Lang

//        if ( false )
//            SetupTDB.makeNodeTable(location, locationString, 0, outputFile, 0) ;

        for( String filename : datafiles)
        {
            Lang lang = RDFLanguages.filenameToLang(filename, RDFLanguages.NQUADS) ;
            if ( lang == null )
                // Does not happen due to default above.
                cmdError("File suffix not recognized: " +filename) ;
            if ( ! FileOps.exists(filename) )
                cmdError("File does not exist: "+filename) ;
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.