<commit_before>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package org.almibe.ligature

import java.io.Closeable
import java.math.BigDecimal
import java.time.LocalDate
import java.time.LocalTime
import java.util.stream.Stream

sealed class Value
data class Node(val id: String): Value()

sealed class Literal: Value()
data class LangLiteral(val value: String, val langTag: String): Literal()
data class StringLiteral(val value: String): Literal()
data class BooleanLiteral(val value: Boolean): Literal()
data class IntLiteral(val value: Int): Literal()
data class LongLiteral(val value: Long): Literal()
data class DecimalLiteral(val value: BigDecimal): Literal()
data class TimeLiteral(val value: LocalTime): Literal()
data class DateLiteral(val value: LocalDate): Literal()

data class Attribute(val label: String)

data class Statement(
        val entity: Node,
        val attribute: Attribute,
        val value: Value,
        val context: Node? = null
)

interface Store: Closeable {
    fun getDatasetNames(): Stream<String>
    fun getDataset(name: String): Dataset
    fun deleteDataset(name: String)
}

interface Dataset {
    fun getDatasetName(): String
    fun addStatements(statements: Stream<Statement>)
    fun removeStatements(statements: Stream<Statement>)
    fun matchAll(
            entity: Node? = null,
            attribute: Attribute? = null,
            value: Value? = null,
            context: Node? = null
    ): Stream<Statement>
    fun newNode(vararg attributes: Pair<Attribute, Value>): Node
}<commit_msg>reverting newNode method<commit_after>/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

package org.almibe.ligature

import java.io.Closeable
import java.math.BigDecimal
import java.time.LocalDate
import java.time.LocalTime
import java.util.stream.Stream

sealed class Value
data class Node(val id: String): Value()

sealed class Literal: Value()
data class LangLiteral(val value: String, val langTag: String): Literal()
data class StringLiteral(val value: String): Literal()
data class BooleanLiteral(val value: Boolean): Literal()
data class IntLiteral(val value: Int): Literal()
data class LongLiteral(val value: Long): Literal()
data class DecimalLiteral(val value: BigDecimal): Literal()
data class TimeLiteral(val value: LocalTime): Literal()
data class DateLiteral(val value: LocalDate): Literal()

data class Attribute(val label: String)

data class Statement(
        val entity: Node,
        val attribute: Attribute,
        val value: Value,
        val context: Node? = null
)

interface Store: Closeable {
    fun getDatasetNames(): Stream<String>
    fun getDataset(name: String): Dataset
    fun deleteDataset(name: String)
}

interface Dataset {
    fun getDatasetName(): String
    fun addStatements(statements: Stream<Statement>)
    fun removeStatements(statements: Stream<Statement>)
    fun matchAll(
            entity: Node? = null,
            attribute: Attribute? = null,
            value: Value? = null,
            context: Node? = null
    ): Stream<Statement>
    fun newNode(): Node
}
{'fraction_non_alphanumeric': 0.09709887507400829, 'fraction_numerical': 0.002368265245707519, 'mean_word_length': 3.940058479532164, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, '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': '974831', 'n_tokens_mistral': 946, 'n_tokens_neox': 936, 'n_words': 353}