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

com.marklogic.spark.reader.file.RdfUtil Maven / Gradle / Ivy

There is a newer version: 2.4.2
Show newest version
/*
 * Copyright © 2024 MarkLogic Corporation. All Rights Reserved.
 */
package com.marklogic.spark.reader.file;

import org.apache.jena.riot.Lang;

public interface RdfUtil {

    static boolean isQuadsFile(String filename) {
        return isTrigFile(filename) || isTrixFile(filename) ||
            filename.endsWith(".nq") ||
            filename.endsWith(".nq.gz");
    }

    static Lang getQuadsLang(String filename) {
        if (isTrigFile(filename)) {
            return Lang.TRIG;
        } else if (isTrixFile(filename)) {
            return Lang.TRIX;
        }
        return Lang.NQ;
    }

    private static boolean isTrigFile(String filename) {
        return filename.endsWith(".trig") || filename.endsWith(".trig.gz");
    }

    private static boolean isTrixFile(String filename) {
        return filename.endsWith(".trix") || filename.endsWith(".trix.gz");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy