Package org.openrdf.rio

Examples of org.openrdf.rio.RDFFormat


                    int i = s.lastIndexOf('.');
                    if (i <= 0) {
                        LOGGER.warning("dump file name could not be parsed. Periodic data dumps will not be generated.");
                    } else {
                        String ext = s.substring(i + 1);
                        RDFFormat format = SesameTools.rdfFormatByExtension(ext);
                        if (null == format) {
                            LOGGER.warning("dump file format not recognized. Periodic data dumps will not be generated.");
                        } else {
                            new Timer().schedule(
                                    new DumpFileGeneratorTask(this, file, format, compressed),
View Full Code Here


    ////////////////////////////////////////////////////////////////////////////
    // convenience methods, may be moved ///////////////////////////////////////

    public void dump(final OutputStream out) throws RepositoryException, RDFHandlerException {
        RDFFormat format = RDFFormat.TRIG;
        LOGGER.info("dumping triple store in format " + format.getName() + " to output stream");
        RDFHandler h = Rio.createWriter(format, out);
        RepositoryConnection rc = getRepository().getConnection();
        try {
            rc.begin();
            rc.export(h);
View Full Code Here

     */
    //@RaiseEvent("ontologyChanged")
    private int importData(InputStream is, String format, Resource user, URI context, String baseUri) throws MarmottaImportException {

        // TODO: need to figure out format automatically!
        RDFFormat f = getFormat(format);

        final String taskName = String.format("RDF Importer Task %d (%s)", ++taskCounter, f.getName());
        Task task = taskManagerService.createSubTask(taskName,"Importer");
        task.updateMessage("importing data into Apache Marmotta repository");
        task.updateDetailMessage("format", f.getDefaultMIMEType());
        task.updateDetailMessage("baseUri", baseUri);

        int count = 0;

        try {
View Full Code Here

     */
    @Override
    public int importData(Reader reader, String format, Resource user, URI context) throws MarmottaImportException {

        // TODO: need to figure out format automatically!
        RDFFormat f = getFormat(format);

        String baseUri = configurationService.getBaseUri() + "resource/";
        final String taskName = String.format("RDF Importer Task %d (%s)", ++taskCounter, f.getName());
        Task task = taskManagerService.createSubTask(taskName, "Importer");
        task.updateMessage("importing data into Apache Marmotta repository");
        task.updateDetailMessage("format", f.getDefaultMIMEType());
        task.updateDetailMessage("baseURI", baseUri);

        int count = 0;

        try {
View Full Code Here

    public List<String> getTypes(@QueryParam("filename") String filename) {
        if(filename == null)
            return new ArrayList<String>(importService.getAcceptTypes());
        else {
            List<String> result = new ArrayList<String>();
            RDFFormat format = Rio.getParserFormatForFileName(filename);
            if(format != null) {
                result.addAll(format.getMIMETypes());
            }
            return result;
        }
    }
View Full Code Here

    }

    public FileBackend(File file, String mimetype) {
        super();

        RDFFormat format = null;

        if(mimetype != null) {
            format = RDFFormat.forMIMEType(mimetype);
        }
View Full Code Here

    }

    public FileBackend(URL url, String mimetype) {
        super();

        RDFFormat format = null;

        if(mimetype != null) {
            format = RDFFormat.forMIMEType(mimetype);
        }
View Full Code Here

    public Representation dereference(final String uri) throws RippleException {
        return new FileRepresentation(uri);
    }

    public static MediaType findMediaType(final String uri) throws RippleException {
        RDFFormat format = RDFFormat.forFileName(uri);
        if (null == format) {
            throw new RippleException("no matching media type for " + uri);
        }

        List<String> types = format.getMIMETypes();
        if (0 == types.size()) {
            throw new IllegalStateException("RDF format has no media type(s): " + format);
        }

        return new MediaType(types.iterator().next());
View Full Code Here

    }

    public FileBackend(File file, String mimetype) {
        super();

        RDFFormat format = null;

        if(mimetype != null) {
            format = RDFFormat.forMIMEType(mimetype);
        }
View Full Code Here

    }

    public FileBackend(URL url, String mimetype) {
        super();

        RDFFormat format = null;

        if(mimetype != null) {
            format = RDFFormat.forMIMEType(mimetype);
        }
View Full Code Here

TOP

Related Classes of org.openrdf.rio.RDFFormat

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.