All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.tinkerpop.gremlin.groovy.loaders.SailGraphLoader.groovy Maven / Gradle / Ivy

There is a newer version: 2.6.0
Show newest version
package com.tinkerpop.gremlin.groovy.loaders

import com.tinkerpop.blueprints.impls.sail.SailGraph

/**
 * @author Marko A. Rodriguez (http://markorodriguez.com)
 */
class SailGraphLoader {

    public static void load() {

        SailGraph.metaClass.uri { final String prefix ->
            return ((SailGraph) delegate).expandPrefix(prefix)
        }

        SailGraph.metaClass.qn { final String uri ->
            return ((SailGraph) delegate).prefixNamespace(uri)
        }

        SailGraph.metaClass.loadRDF = { final def fileObject, final String format ->
            try {
                ((SailGraph) delegate).loadRDF(new URL(fileObject).openStream(), "", format, null);
            } catch (MalformedURLException e) {
                ((SailGraph) delegate).loadRDF(new FileInputStream(fileObject), "", format, null);
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy