<commit_before>package net.sansa_stack.rdf.spark.model.graph
import org.scalatest.FunSuite
import com.holdenkarau.spark.testing.DataFrameSuiteBase
import org.apache.jena.riot.Lang
import net.sansa_stack.rdf.spark.io.rdf._

class GraphOpsTests extends FunSuite with DataFrameSuiteBase {

  import net.sansa_stack.rdf.spark.graph._

  test("loading N-Triples file into Graph should result in size 7") {
    val path = getClass.getResource("/loader/data.nt").getPath
    val lang: Lang = Lang.NTRIPLES

    val triples = spark.rdf(lang, allowBlankLines = true)(path)

    val graph = triples.asGraph()
    val size = graph.size()

    assert(size == 7)
  }

  test("conversation of Graph into RDD should result in 9 triples") {
    val path = getClass.getResource("/loader/data.nt").getPath
    val lang: Lang = Lang.NTRIPLES

    val triples = spark.rdf(lang, allowBlankLines = true)(path)<commit_msg>Update GraphOpsTests :: use new ..model.graph package<commit_after>package net.sansa_stack.rdf.spark.model.graph
import org.scalatest.FunSuite
import com.holdenkarau.spark.testing.DataFrameSuiteBase
import org.apache.jena.riot.Lang
import net.sansa_stack.rdf.spark.io.rdf._

class GraphOpsTests extends FunSuite with DataFrameSuiteBase {

  import net.sansa_stack.rdf.spark.model.graph._

  test("loading N-Triples file into Graph should result in size 7") {
    val path = getClass.getResource("/loader/data.nt").getPath
    val lang: Lang = Lang.NTRIPLES

    val triples = spark.rdf(lang, allowBlankLines = true)(path)

    val graph = triples.asGraph()
    val size = graph.size()

    assert(size == 7)
  }

  test("conversation of Graph into RDD should result in 9 triples") {
    val path = getClass.getResource("/loader/data.nt").getPath
    val lang: Lang = Lang.NTRIPLES

    val triples = spark.rdf(lang, allowBlankLines = true)(path)
{'fraction_non_alphanumeric': 0.10737527114967461, 'fraction_numerical': 0.0032537960954446853, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1797852', 'n_tokens_mistral': 632, 'n_tokens_neox': 600, 'n_words': 144}