Package org.openrdf.rio

Examples of org.openrdf.rio.RDFParserRegistry


    // (e.g. a value of "fish" for an xsd:integer literal,
    // or a value of 1995-01-01T00:00:00+02:00 for an xsd:gYear literal).
    // The default behavior is to throw an exception when bad literals are encountered,
    // resulting in failure.
    private static void ignoreDatatypesInAllParsers() {
        RDFParserRegistry r = RDFParserRegistry.getInstance();
        Collection<RDFParserFactory> oldFactories = new LinkedList<RDFParserFactory>();
        Collection<RDFParserFactory> newFactories = new LinkedList<RDFParserFactory>();

        for (final RDFFormat f : r.getKeys()) {
            final RDFParserFactory pf = r.get(f);
            pf.getParser().setDatatypeHandling(RDFParser.DatatypeHandling.IGNORE);

            RDFParserFactory pfn = new RDFParserFactory() {
                public RDFFormat getRDFFormat() {
                    return f;
                }

                public RDFParser getParser() {
                    RDFParser p = pf.getParser();
                    p.setDatatypeHandling(RDFParser.DatatypeHandling.IGNORE);
                    return p;
                }
            };

            oldFactories.add(pf);
            newFactories.add(pfn);
        }

        for (RDFParserFactory pf : oldFactories) {
            r.remove(pf);
        }

        for (RDFParserFactory pfn : newFactories) {
            r.add(pfn);
        }
    }
View Full Code Here


    @PostConstruct
    public void initialise() {
        log.info("registering RDF importer ...");


        RDFParserRegistry parserRegistry = RDFParserRegistry.getInstance();

        acceptTypes = new ArrayList<String>();
        for(RDFFormat format : parserRegistry.getKeys()) {
            acceptTypes.addAll(format.getMIMETypes());
        }
        log.info(" - available parsers: {}", Arrays.toString(acceptTypes.toArray()));

    }
View Full Code Here

    @PostConstruct
    public void initialise() {
        log.info("registering RDF importer ...");


        RDFParserRegistry parserRegistry = RDFParserRegistry.getInstance();

        acceptTypes = new ArrayList<String>();
        for(RDFFormat format : parserRegistry.getKeys()) {
            acceptTypes.addAll(format.getMIMETypes());
        }
        log.info(" - available parsers: {}", Arrays.toString(acceptTypes.toArray()));

    }
View Full Code Here

TOP

Related Classes of org.openrdf.rio.RDFParserRegistry

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.