com.marklogic.spark.reader.file.RdfUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of marklogic-spark-connector Show documentation
Show all versions of marklogic-spark-connector Show documentation
Spark 3 connector for MarkLogic
/*
* 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");
}
}